Changeset 1421 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
- Timestamp:
- 09/20/06 18:32:10 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1420 r1421 34 34 35 35 36 HierarchyManager::HierarchyManager(VspTree *vspTree, 37 const int objectSpaceSubdivisionType): 36 HierarchyManager::HierarchyManager(const int objectSpaceSubdivisionType): 38 37 mObjectSpaceSubdivisionType(objectSpaceSubdivisionType), 39 mVspTree(vspTree),40 38 mOspTree(NULL), 41 39 mBvHierarchy(NULL) … … 57 55 58 56 // hierarchy manager links view space partition and object space partition 57 mVspTree = new VspTree(); 59 58 mVspTree->mHierarchyManager = this; 60 59 … … 63 62 64 63 65 HierarchyManager::HierarchyManager( VspTree *vspTree,KdTree *kdTree):64 HierarchyManager::HierarchyManager(KdTree *kdTree): 66 65 mObjectSpaceSubdivisionType(KD_BASED_OBJ_SUBDIV), 67 mVspTree(vspTree),68 66 mBvHierarchy(NULL) 69 67 { … … 71 69 mOspTree->mVspTree = mVspTree; 72 70 71 mVspTree = new VspTree(); 73 72 mVspTree->mHierarchyManager = this; 74 73 … … 120 119 { 121 120 DEL_PTR(mOspTree); 122 //DEL_PTR(mVspTree);121 DEL_PTR(mVspTree); 123 122 DEL_PTR(mBvHierarchy); 124 123 } … … 232 231 bool HierarchyManager::GlobalTerminationCriteriaMet(SubdivisionCandidate *candidate) const 233 232 { 234 return (0 233 const bool terminationCriteriaMet = 234 (0 235 235 || (mHierarchyStats.Leaves() >= mTermMaxLeaves) 236 //|| (mGlobalCostMisses >= mTermGlobalCostMissTolerance)237 || candidate->GlobalTerminationCriteriaMet()236 || (mGlobalCostMisses >= mTermGlobalCostMissTolerance) 237 ||(candidate->GlobalTerminationCriteriaMet()) 238 238 ); 239 240 if (0 && terminationCriteriaMet) 241 { 242 Debug << "hierarchy global termination criteria met:" << endl; 243 Debug << "leaves: " << mHierarchyStats.Leaves() << " " << mTermMaxLeaves << endl; 244 Debug << "cost misses: " << mGlobalCostMisses << " " << mTermGlobalCostMissTolerance << endl; 245 } 246 return terminationCriteriaMet; 239 247 } 240 248 … … 306 314 mVspTree->PrepareConstruction(sampleRays, *viewSpaceRays); 307 315 316 mTotalCost = mVspTree->mTotalCost; 317 Debug << "\nreseting cost, new total cost: " << mTotalCost << endl; 318 308 319 mTQueue.Push(vsc); 309 320 } … … 328 339 329 340 { 330 cout << "starting bv hierarchy construction ... " << endl; 341 const long startTime = GetTime(); 342 343 cout << "preparing bv hierarchy construction ... " << endl; 331 344 mBvHierarchy->CreateRoot(objects); 332 345 … … 339 352 340 353 mTQueue.Push(sc); 354 cout << "finished bv hierarchy preparation in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 341 355 } 342 356 … … 357 371 358 372 mTotalCost = mOspTree->mTotalCost; 359 Debug << " reseting cost, new total cost: " << mTotalCost << endl;373 Debug << "\nreseting cost, new total cost: " << mTotalCost << endl; 360 374 361 375 mTQueue.Push(osc); … … 739 753 740 754 741 void HierarchyManager::PrintHierarchyStatistics(o fstream &stream) const755 void HierarchyManager::PrintHierarchyStatistics(ostream &stream) const 742 756 { 743 757 stream << mHierarchyStats << endl; 744 745 758 stream << "\nview space:" << endl << endl; 746 759 stream << mVspTree->GetStatistics() << endl;
Note: See TracChangeset
for help on using the changeset viewer.