29 #include "localInitData.h"
30 #include "frameData.h"
39 #include <tclap/CmdLine.h>
43 LocalInitData::LocalInitData()
44 : _maxFrames( 0xffffffffu )
46 , _isResident( false )
49 # ifdef _WIN32 // final INSTALL_DIR is not known at compile time
50 _filenames.push_back(
"../share/Equalizer/data" );
52 _filenames.push_back( std::string( EQ_INSTALL_DIR ) +
53 std::string(
"share/Equalizer/data" ));
54 _filenames.push_back( std::string(
"/usr/share/Equalizer/data" ));
57 _filenames.push_back( std::string( EQ_SOURCE_DIR ) +
58 std::string(
"examples/eqPly" ));
62 const LocalInitData& LocalInitData::operator = (
const LocalInitData& from )
64 _maxFrames = from._maxFrames;
66 _isResident = from._isResident;
67 _filenames = from._filenames;
68 _pathFilename = from._pathFilename;
70 setWindowSystem( from.getWindowSystem( ));
71 setRenderMode( from.getRenderMode( ));
74 if( from.useInvertedFaces( ))
75 enableInvertedFaces();
76 if( !from.showLogo( ))
84 void LocalInitData::parseArguments(
const int argc,
char** argv )
88 std::string wsHelp =
"Window System API ( one of: ";
100 const std::string& desc = EqPly::getHelp();
103 TCLAP::MultiArg<std::string> modelArg(
"m",
"model",
104 "ply model file name or directory",
105 false,
"string", command );
106 TCLAP::SwitchArg colorArg(
"b",
"blackAndWhite",
107 "Don't use colors from ply file",
109 TCLAP::SwitchArg residentArg(
"r",
"resident",
110 "Keep client resident (see resident node documentation on website)",
112 TCLAP::ValueArg<uint32_t> framesArg(
"n",
"numFrames",
113 "Maximum number of rendered frames",
114 false, 0xffffffffu,
"unsigned",
116 TCLAP::ValueArg<std::string> wsArg(
"w",
"windowSystem", wsHelp,
117 false,
"auto",
"string", command );
118 TCLAP::ValueArg<std::string> modeArg(
"c",
"renderMode",
119 "Rendering Mode (immediate, displayList, VBO)",
120 false,
"auto",
"string",
122 TCLAP::SwitchArg glslArg(
"g",
"glsl",
"Enable GLSL shaders",
124 TCLAP::SwitchArg invFacesArg(
"i",
"invertFaces",
125 "Invert faces (valid during binary file creation)",
127 TCLAP::ValueArg<std::string> pathArg(
"a",
"cameraPath",
128 "File containing camera path animation",
129 false,
"",
"string", command );
130 TCLAP::SwitchArg overlayArg(
"o",
"noOverlay",
"Disable overlay logo",
132 TCLAP::UnlabeledMultiArg< std::string >
133 ignoreArgs(
"ignore",
"Ignored unlabeled arguments",
false,
"any",
135 TCLAP::SwitchArg roiArg(
"d",
"disableROI",
"Disable ROI", command,
138 #ifdef TCPLAP_HAS_IGNOREUNMATCHED
139 command.ignoreUnmatched(
true );
141 command.parse( argc, argv );
143 if( modelArg.isSet( ))
146 _filenames = modelArg.getValue();
150 std::string windowSystem = wsArg.getValue();
151 transform( windowSystem.begin(), windowSystem.end(),
152 windowSystem.begin(), (int(*)(int))std::toupper );
154 setWindowSystem( windowSystem );
157 _color = !colorArg.isSet();
159 if( framesArg.isSet( ))
160 _maxFrames = framesArg.getValue();
162 if( residentArg.isSet( ))
165 if( modeArg.isSet() )
167 std::string mode = modeArg.getValue();
168 transform( mode.begin(), mode.end(), mode.begin(),
169 (int(*)(int))std::tolower );
171 if( mode ==
"immediate" )
172 setRenderMode( mesh::RENDER_MODE_IMMEDIATE );
173 else if( mode ==
"displaylist" )
174 setRenderMode( mesh::RENDER_MODE_DISPLAY_LIST );
175 else if( mode ==
"vbo" )
176 setRenderMode( mesh::RENDER_MODE_BUFFER_OBJECT );
179 if( pathArg.isSet( ))
180 _pathFilename = pathArg.getValue();
182 if( glslArg.isSet() )
184 if( invFacesArg.isSet() )
185 enableInvertedFaces();
186 if( overlayArg.isSet( ))
191 catch(
const TCLAP::ArgException& exception )
193 LBERROR <<
"Command line parse error: " << exception.error()
194 <<
" for argument " << exception.argId() << std::endl;
static std::string getString()
bool exit()
De-initialize the Equalizer fabric namespace.