29 #include "localInitData.h"
30 #include "frameData.h"
32 #pragma warning( disable: 4275 )
33 #include <boost/program_options.hpp>
34 #pragma warning( default: 4275 )
42 namespace po = boost::program_options;
46 LocalInitData::LocalInitData()
48 , _maxFrames( 0xffffffffu )
50 , _isResident( false )
52 _filenames.push_back( lunchbox::getExecutablePath() +
53 "/../share/Equalizer/data" );
56 const LocalInitData& LocalInitData::operator = (
const LocalInitData& from )
58 _maxFrames = from._maxFrames;
60 _isResident = from._isResident;
61 _filenames = from._filenames;
62 _pathFilename = from._pathFilename;
64 setWindowSystem( from.getWindowSystem( ));
65 setRenderMode( from.getRenderMode( ));
68 if( from.useInvertedFaces( ))
69 enableInvertedFaces();
70 if( !from.showLogo( ))
78 void LocalInitData::parseArguments(
const int argc,
char** argv )
80 std::string wsHelp =
"Window System API ( one of: ";
90 #ifdef EQUALIZER_USE_QT4
95 bool showHelp(
false );
96 std::vector<std::string> userDefinedModelPath;
97 bool userDefinedBlackWhiteMode(
false );
98 std::string userDefinedWindowSystem(
"");
99 std::string userDefinedRenderMode(
"");
100 bool userDefinedUseGLSL(
false );
101 bool userDefinedInvertFaces(
false );
102 bool userDefinedDisableLogo(
false );
103 bool userDefinedDisableROI(
false );
105 const std::string& desc = EqPly::getHelp();
106 po::options_description options( desc +
" Version " +
108 options.add_options()
109 (
"help,h", po::bool_switch(&showHelp)->default_value(
false ),
110 "produce help message" )
112 po::value<std::vector<std::string> >( &userDefinedModelPath ),
113 "ply model file names or directories" )
115 po::bool_switch(&userDefinedBlackWhiteMode)->default_value(
false ),
116 "Don't use colors from ply file" )
117 (
"resident,r", po::bool_switch(&_isResident)->default_value(
false ),
118 "Keep client resident (see resident mode documentation on website)" )
120 po::value<uint32_t>(&_maxFrames)->default_value(0xffffffffu),
121 "Maximum number of rendered frames")
122 (
"windowSystem,w", po::value<std::string>( &userDefinedWindowSystem ),
124 (
"renderMode,c", po::value<std::string>( &userDefinedRenderMode ),
125 "Rendering Mode (immediate|displayList|VBO)" )
127 po::bool_switch(&userDefinedUseGLSL)->default_value(
false ),
128 "Enable GLSL shaders" )
130 , po::bool_switch(&userDefinedInvertFaces)->default_value(
false ),
131 "Invert faces (valid during binary file creation)" )
132 (
"cameraPath,a", po::value<std::string>(&_pathFilename),
133 "File containing camera path animation" )
135 po::bool_switch(&userDefinedDisableLogo)->default_value(
false ),
136 "Disable overlay logo" )
138 po::bool_switch(&userDefinedDisableROI)->default_value(
false ),
139 "Disable region of interest (ROI)" );
141 po::variables_map variableMap;
146 po::store( po::command_line_parser( argc, argv ).options(
147 options ).allow_unregistered().run(),
149 po::notify( variableMap );
151 catch( std::exception& exception )
153 LBERROR <<
"Error parsing command line: " << exception.what()
163 std::cout << options << std::endl;
168 if( variableMap.count(
"model") > 0 )
171 _filenames = userDefinedModelPath;
174 _color = !userDefinedBlackWhiteMode;
176 if( variableMap.count(
"windowSystem") > 0 )
177 setWindowSystem( userDefinedWindowSystem );
179 if( variableMap.count(
"renderMode") > 0 )
181 std::transform( userDefinedRenderMode.begin(),
182 userDefinedRenderMode.end(),
183 userDefinedRenderMode.begin(),
184 (int(*)(int))std::tolower );
186 if( userDefinedRenderMode ==
"immediate" )
187 setRenderMode( triply::RENDER_MODE_IMMEDIATE );
188 else if( userDefinedRenderMode ==
"displaylist" )
189 setRenderMode( triply::RENDER_MODE_DISPLAY_LIST );
190 else if( userDefinedRenderMode ==
"vbo" )
191 setRenderMode( triply::RENDER_MODE_BUFFER_OBJECT );
194 if( userDefinedUseGLSL )
197 if( userDefinedInvertFaces)
198 enableInvertedFaces();
200 if( userDefinedDisableLogo )
203 if( userDefinedDisableROI )
static std::string getString()
EQFABRIC_API bool exit()
De-initialize the Equalizer fabric namespace.
EQ_API bool exit()
De-initialize the Equalizer client library.