29 #include "localInitData.h"
30 #include "frameData.h"
39 #include <tclap/CmdLine.h>
43 LocalInitData::LocalInitData()
44 : _maxFrames( 0xffffffffu )
45 , _isResident( false )
49 const LocalInitData& LocalInitData::operator = (
const LocalInitData& from )
51 _maxFrames = from._maxFrames;
52 _isResident = from._isResident;
55 setFilename( from.getFilename( ));
56 setWindowSystem( from.getWindowSystem( ));
57 setPrecision( from.getPrecision( ));
58 setBrightness( from.getBrightness( ));
59 setAlpha( from.getAlpha( ));
63 void LocalInitData::parseArguments(
const int argc,
char** argv )
67 std::string wsHelp =
"Window System API ( one of: ";
79 std::string desc = EVolve::getHelp();
82 TCLAP::ValueArg<std::string> modelArg(
"m",
"model",
83 "raw model file name",
84 false,
"Bucky32x32x32.raw",
86 TCLAP::SwitchArg residentArg(
"r",
"resident",
87 "Keep client resident (see resident node documentation on website)",
89 TCLAP::ValueArg<uint32_t> framesArg(
"n",
"numFrames",
90 "Maximum number of rendered frames",
91 false, 0xffffffffu,
"unsigned",
93 TCLAP::ValueArg<uint32_t> precisionArg(
"p",
"precision",
94 "Rendering precision (default 2, bigger is better and slower)",
97 TCLAP::ValueArg<float> brightnessArg(
"b",
"brightness",
98 "brightness factor",
false, 1.0f,
100 TCLAP::ValueArg<float> alphaArg(
"a",
"alpha",
"alpha attenuation",
101 false, 1.0f,
"float", command );
102 TCLAP::SwitchArg orthoArg(
"o",
"ortho",
103 "use orthographic projection",
105 TCLAP::ValueArg<std::string> wsArg(
"w",
"windowSystem", wsHelp,
106 false,
"auto",
"string", command );
107 TCLAP::UnlabeledMultiArg< std::string >
108 ignoreArgs(
"ignore",
"Ignored unlabeled arguments",
false,
"any",
111 #ifdef TCPLAP_HAS_IGNOREUNMATCHED
112 command.ignoreUnmatched(
true );
114 command.parse( argc, argv );
116 if( modelArg.isSet( ))
117 setFilename( modelArg.getValue( ));
120 std::string windowSystem = wsArg.getValue();
121 transform( windowSystem.begin(), windowSystem.end(),
122 windowSystem.begin(), (int(*)(int))std::toupper );
124 setWindowSystem( windowSystem );
127 if( framesArg.isSet( ))
128 _maxFrames = framesArg.getValue();
129 if( precisionArg.isSet( ))
130 setPrecision( precisionArg.getValue( ));
131 if( brightnessArg.isSet( ))
132 setBrightness( brightnessArg.getValue( ));
133 if( alphaArg.isSet( ))
134 setAlpha( alphaArg.getValue( ));
135 if( residentArg.isSet( ))
137 if( orthoArg.isSet( ))
140 catch(
const TCLAP::ArgException& exception )
142 LBERROR <<
"Command line parse error: " << exception.error()
143 <<
" for argument " << exception.argId() << std::endl;
static std::string getString()
bool exit()
De-initialize the Equalizer fabric namespace.