- Timestamp:
- 01/21/07 22:08:23 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2004 r2005 475 475 476 476 // assign the objects in sorted order 477 if ( !TEST_POWERPLANT &&mUseGlobalSorting)477 if (mUseGlobalSorting) 478 478 { 479 479 AssignSortedObjects(sc, frontData, backData); … … 2226 2226 // create bvh traversal data 2227 2227 BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 2228 cout << "here4" << endl; 2228 2229 2229 2230 // create sorted object lists for the first data 2230 if ( !TEST_POWERPLANT &&mUseGlobalSorting)2231 if (mUseGlobalSorting) 2231 2232 { 2232 2233 AssignInitialSortedObjectList(oData, objects); 2233 2234 } 2234 2235 2235 2236 cout << "here6" << endl; 2236 2237 /////////////////// 2237 2238 //-- add first candidate for object space partition … … 2294 2295 for (int i = 0; i < 3; ++ i) 2295 2296 { 2297 cout << "here2 " << endl; 2296 2298 SortableEntryContainer *sortedObjects = new SortableEntryContainer(); 2297 2299 … … 2314 2316 delete sortedObjects; 2315 2317 } 2316 2318 cout << "here102" << endl; 2317 2319 // last sorted list: by size 2318 2320 tData.mSortedObjects[3] = new ObjectContainer(); … … 2393 2395 BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 2394 2396 2395 if ( !TEST_POWERPLANT &&mUseGlobalSorting)2397 if (mUseGlobalSorting) 2396 2398 AssignInitialSortedObjectList(oData, objects); 2397 2399 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2003 r2005 202 202 return false; 203 203 204 if ( 1&& GVS_DEBUG)204 if (0 && GVS_DEBUG) 205 205 mVssRays.push_back(new VssRay(*vssRay)); 206 206 … … 650 650 } 651 651 652 //exporter->ExportRays(vcRays, RgbColor(1, 0, 0));653 //exporter->ExportRays(vcRays2, RgbColor(0, 1, 0));652 exporter->ExportRays(vcRays, RgbColor(1, 0, 0)); 653 exporter->ExportRays(vcRays2, RgbColor(0, 1, 0)); 654 654 exporter->ExportRays(vcRays3, RgbColor(1, 1, 1)); 655 655 } … … 1065 1065 } 1066 1066 1067 cout << "here4 " << mKdTree->GetBox() << endl; 1068 cout << "here5 " << mViewCellsManager->GetViewSpaceBox() << endl; 1067 1069 mGvsStats.Stop(); 1068 1070 mGvsStats.Print(mGvsStatsStream); -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2004 r2005 253 253 } 254 254 255 #define POWERPLANT_HACK 1 255 256 256 257 bool Preprocessor::LoadBinaryObj(const string filename, … … 279 280 samplesIn.read(reinterpret_cast<char *>(&numTriangles), sizeof(int)); 280 281 root->mGeometry.reserve(numTriangles); 281 cout << "reserved " << numTriangles << " triangles " << endl; 282 //root->mGeometry.reserve(13000000); 283 284 cout << "using " << numTriangles * (sizeof(TriangleIntersectable) + sizeof(TriangleIntersectable *)) / (1024 * 1024) << " MBs" << endl; 285 286 //vector<Triangle3> dummy; 287 //cout << "using " << numTriangles * sizeof(Triangle3) / (1024 * 1024) << " MBs" << endl; 288 //dummy.reserve(numTriangles); 282 cout << "loading " << numTriangles << " triangles (" 283 << numTriangles * (sizeof(TriangleIntersectable) + sizeof(TriangleIntersectable *)) / (1024 * 1024) << " MB)" << endl; 289 284 290 285 int i = 0; … … 296 291 samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 1), sizeof(Vector3)); 297 292 samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 2), sizeof(Vector3)); 298 293 299 294 // end of file reached 300 295 if (samplesIn.eof()) … … 303 298 TriangleIntersectable *obj = new TriangleIntersectable(tri); 304 299 root->mGeometry.push_back(obj); 305 //dummy.push_back(tri);300 306 301 i ++; 307 302 308 if (i % 500000 == 0)309 cout << "idx: " << i << endl;303 if (i % 500000 == 499999) 304 cout<<"\r"<<i<<"/"<<numTriangles<<"\r"; 310 305 } 311 306 -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2000 r2005 211 211 GenerateDebugInformation="FALSE" 212 212 SubSystem="1" 213 LargeAddressAware="2" 213 214 OptimizeReferences="2" 214 215 EnableCOMDATFolding="2" -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r1999 r2005 95 95 , mHierarchyManager(NULL) 96 96 , nViewCells(0) 97 , nObjects(0) 97 98 { 98 99 std::stable_sort(mObjects->begin(), mObjects->end(), ilt); … … 206 207 // go one up in the tree 207 208 if (mCurrentBspNode->GetParent()) 208 { Debug<< "]";209 { //cout << "]"; 209 210 mCurrentBspNode = mCurrentBspNode->GetParent(); 210 211 } … … 216 217 // go one up in the tree 217 218 if (mCurrentBvhNode->GetParent()) 218 { Debug<< "]";219 { //cout << "]"; 219 220 mCurrentBvhNode = mCurrentBvhNode->GetParent(); 220 221 } … … 226 227 // go one up in the tree 227 228 if (mCurrentOspNode->mParent) 228 { Debug << "]"; 229 { 230 //cout << "]"; 229 231 mCurrentOspNode = mCurrentOspNode->mParent; 230 232 } … … 236 238 // go one up in the tree 237 239 if (mCurrentVspNode->GetParent()) 238 { Debug << "]"; 240 { 241 //cout << "]"; 239 242 mCurrentVspNode = mCurrentVspNode->GetParent(); 240 243 } … … 246 249 // go one up in the tree 247 250 if (mCurrentViewCell->GetParent()) 248 { Debug << "]"; 251 { 252 //cout << "]"; 249 253 mCurrentViewCell = mCurrentViewCell->GetParent(); 250 254 } … … 289 293 if (element == "Interior") 290 294 { 291 Debug<< "[";295 //cout << "["; 292 296 StartBspInterior(attributes); 293 297 } … … 295 299 if (element == "Leaf") 296 300 { 297 Debug<< "l";301 //cout << "l"; 298 302 StartBspLeaf(attributes); 299 303 } … … 306 310 if (element == "Interior") 307 311 { 308 Debug<< "[";312 //cout << "["; 309 313 StartVspInterior(attributes); 310 314 } 311 315 if (element == "Leaf") 312 316 { 313 Debug<< "l";317 //cout << "l"; 314 318 StartVspLeaf(attributes); 315 319 } … … 322 326 if (element == "Interior") 323 327 { 324 Debug<< "[";328 //cout << "["; 325 329 StartOspInterior(attributes); 326 330 } … … 328 332 if (element == "Leaf") 329 333 { 330 Debug<< "l";334 //cout << "l"; 331 335 StartOspLeaf(attributes); 332 336 } … … 339 343 if (element == "Interior") 340 344 { 341 Debug<< "[";345 //cout << "["; 342 346 StartBvhInterior(attributes); 343 347 } … … 345 349 if (element == "Leaf") 346 350 { 347 Debug<< "l";351 //cout << "l"; 348 352 StartBvhLeaf(attributes); 349 353 } … … 392 396 AttributeList& attributes) 393 397 { 394 if (((nViewCells ++) % 1000) == 0)395 Debug << "\n " << nViewCells << " view cells parsed" << endl;396 398 // interiors + leaves interpreted view cells else 397 399 if (element == "Interior") 398 400 { 399 Debug<< "[";401 //cout << "["; 400 402 StartViewCell(attributes, false); 401 403 } … … 403 405 if (element == "Leaf") 404 406 { 405 Debug<< "l";407 //cout << "l"; 406 408 StartViewCell(attributes, true); 407 409 } … … 417 419 if (element == "ViewCells") 418 420 { 419 Debug<< "\nparsing view cells" << endl;421 cout << "\nparsing view cells" << endl; 420 422 421 423 mCurrentState = PARSE_VIEWCELLS; … … 428 430 if (element == "ViewSpaceHierarchy") 429 431 { 430 Debug<< "\nparsing view space hierarchy" << endl;432 cout << "\nparsing view space hierarchy" << endl; 431 433 mCurrentState = PARSE_VIEWSPACE_HIERARCHY; 432 434 StartViewSpaceHierarchy(attributes); … … 436 438 if (element == "ObjectSpaceHierarchy") 437 439 { 438 Debug<< "\nparsing object space hierarchy" << endl;440 cout << "\nparsing object space hierarchy" << endl; 439 441 mCurrentState = PARSE_OBJECTSPACE_HIERARCHY; 440 442 StartObjectSpaceHierarchy(attributes); … … 444 446 if (element == "BoundingBox") 445 447 { 446 // Debug<< "b";448 // cout << "b"; 447 449 StartBoundingBox(attributes); 448 450 } … … 452 454 { 453 455 case PARSE_VIEWSPACE_HIERARCHY: 456 if ((++ nViewCells % 1000) == 0) 457 cout<<"\r"<<nViewCells<<" view cells parsed\r"; 458 454 459 StartViewSpaceHierarchyElement(element, attributes); 455 460 break; 456 461 case PARSE_OBJECTSPACE_HIERARCHY: 462 if ((++ nObjects % 1000) == 0) 463 cout<<"\r"<< nObjects <<" objects parsed\r"; 464 457 465 StartObjectSpaceHierarchyElement(element, attributes); 458 466 break; … … 703 711 else 704 712 { 705 Debug<< "error: view cell does not exist" << endl;713 cerr << "error: view cell does not exist" << endl; 706 714 } 707 715 } … … 882 890 ViewCellContainer::iterator vit, vit_end = mViewCells.end(); 883 891 884 Debug << "exchanging boxes" << endl;885 892 int i = 0; 886 893 // remove view cells and exchange them with the … … 888 895 for (vit = mViewCells.begin(); vit != vit_end; ++ vit, ++ i) 889 896 { 890 if ((i % 1000) == 0)891 Debug << "\n exchanged " << i << " boxes" << endl;897 //if ((i % 1000) == 0) 898 // Debug << "\n exchanged " << i << " boxes" << endl; 892 899 ViewCell *vc = (*vit); 893 900 … … 916 923 (*vit) = bspVc; 917 924 } 918 Debug << "finished" << endl;925 cout << "finished creating view space hierarchy" << endl; 919 926 } 920 927 else if (mViewSpaceHierarchyType == VSP) … … 1279 1286 else 1280 1287 { 1281 Debug<< "error: object with id " << objId << " does not exist" << endl;1288 cerr << "error: object with id " << objId << " does not exist" << endl; 1282 1289 } 1283 1290 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r1999 r2005 120 120 int mObjectSpaceHierarchyType; 121 121 int nViewCells; 122 int nObjects; 122 123 //////////////////////////////// 123 124
Note: See TracChangeset
for help on using the changeset viewer.