Changeset 2676 for GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
- Timestamp:
- 05/08/08 19:08:48 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2667 r2676 131 131 main(int argc, char **argv) 132 132 { 133 #if 0 134 // Test code by VH 135 TestRTcamera(argc, argv); 136 //TestRTfromFile(argc, argv); 137 //TestRTfromFilePackets(argc, argv); 138 //TestRT_4_fromFile(argc, argv); 139 return 0; 133 int returnCode = 0; 134 135 #ifdef _CRT_SET 136 137 //Now just call this function at the start of your program and if you're 138 //compiling in debug mode (F5), any leaks will be displayed in the Output 139 //window when the program shuts down. If you're not in debug mode this will 140 //be ignored. Use it as you will! 141 //note: from GDNet Direct [3.8.04 - 3.14.04] void detectMemoryLeaks() { 142 143 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); 144 _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE); 145 _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR); 140 146 #endif 141 cout<<"hello world"<<endl; 142 143 int returnCode = 0; 144 145 //Now just call this function at the start of your program and if you're 146 //compiling in debug mode (F5), any leaks will be displayed in the Output 147 //window when the program shuts down. If you're not in debug mode this will 148 //be ignored. Use it as you will! 149 //note: from GDNet Direct [3.8.04 - 3.14.04] void detectMemoryLeaks() { 150 151 //#define _CRT_SET 152 153 #ifdef _CRT_SET 154 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); 155 _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE); 156 _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR); 157 #endif 158 159 InitTiming(); 160 Debug.open("debug.log"); 161 162 Environment::GetSingleton()->Parse(argc, argv, USE_EXE_PATH); 163 MeshKdTree::ParseEnvironment(); 164 165 char buff[128]; 166 Environment::GetSingleton()->GetStringValue("Preprocessor.type", buff); 167 string preprocessorType(buff); 168 169 if (!(preprocessor = PreprocessorFactory::CreatePreprocessor(preprocessorType))) 147 148 InitTiming(); 149 Debug.open("debug.log"); 150 151 Environment::GetSingleton()->Parse(argc, argv, USE_EXE_PATH); 152 MeshKdTree::ParseEnvironment(); 153 154 char buff[128]; 155 Environment::GetSingleton()->GetStringValue("Preprocessor.type", buff); 156 string preprocessorType(buff); 157 158 if (!(preprocessor = PreprocessorFactory::CreatePreprocessor(preprocessorType))) 170 159 { 171 160 Environment::DelSingleton(); … … 174 163 } 175 164 176 165 177 166 Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 178 167 string filename(buff); 179 168 180 169 const string externKdTree = ReplaceSuffix(filename, ".obj", ".kdf"); 181 170 const string internKdTree = GetInternFilename(filename, preprocessor->mLoadMeshes ? 182 171 ".kdm" : ".kdt"); 183 172 184 173 if (preprocessor->InitRayCast(externKdTree, internKdTree)) … … 193 182 } 194 183 195 196 //Debug << "using pvs type " << PVS_TYPE << endl;197 198 184 ///////////// 199 185 //-- load scene … … 205 191 exit(1); 206 192 } 207 193 208 194 209 195 //////////// … … 220 206 exit(1); 221 207 } 222 208 223 209 // export objects as obj 224 210 if (preprocessor->mExportObj) … … 231 217 else 232 218 { 233 219 234 220 const string objname = GetInternFilename(filename, ".obj"); 235 221 … … 237 223 bool success = preprocessor->ExportObj(objname, preprocessor->mObjects); 238 224 239 240 225 if (success) 241 226 cout << "finished exporting obj" << endl; … … 267 252 bool importRandomViewCells; 268 253 Environment::GetSingleton()->GetBoolValue("ViewCells.importRandomViewCells", 269 254 importRandomViewCells); 270 255 271 256 if (importRandomViewCells) … … 279 264 bool useHwGlobalLines; 280 265 Environment::GetSingleton()->GetBoolValue("Preprocessor.useHwGlobalLines", 281 266 useHwGlobalLines); 282 267 283 268 if (useHwGlobalLines) … … 286 271 // create a preprocessor thread (note: capsulates calls to boost fuctions!) 287 272 PreprocessorThread *pt = NULL; 288 273 289 274 //preprocessor->PrepareHwGlobalLines(); 290 275 //globalLinesRenderer->Run(); … … 306 291 QApplication *app = new QApplication(argc, NULL); 307 292 pt = new QtPreprocessorThread(preprocessor); 308 293 309 294 if (evalPixelError && (importRandomViewCells || frames)) 310 295 { … … 328 313 // $$matt 329 314 preprocessor->renderer = 330 331 332 333 334 315 new QtGlRendererBuffer(1024, 1024, 316 preprocessor->mSceneGraph, 317 preprocessor->mViewCellsManager, 318 preprocessor->mKdTree); 319 335 320 } 336 321 337 322 bool exportRandomViewCells; 338 323 Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells", 339 340 324 exportRandomViewCells); 325 341 326 if (exportRandomViewCells) 342 327 { … … 372 357 rendererWidget = 373 358 new QtGlRendererWidget(preprocessor->mSceneGraph, 374 375 359 preprocessor->mViewCellsManager, 360 preprocessor->mKdTree); 376 361 377 362 rendererWidget->Show(); … … 397 382 398 383 /*#if USE_THREADS 399 384 pt = new BoostPreprocessorThread(preprocessor); 400 385 #else 401 402 386 // use a dummy thread 387 pt = new DummyPreprocessorThread(preprocessor); 403 388 #endif 404 389 */
Note: See TracChangeset
for help on using the changeset viewer.