- Timestamp:
- 11/29/06 22:43:51 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1827 r1830 2541 2541 SplitQueue tempQueue; 2542 2542 tempQueue.Push(firstCandidate); 2543 2543 2544 while (!tempQueue.Empty()) 2544 2545 { … … 2549 2550 dynamic_cast<BvhSubdivisionCandidate *>(candidate); 2550 2551 2551 const bool globalCriteriaMet = GlobalTerminationCriteriaMet(bsc->mParentData);2552 2553 2552 if (!InitialTerminationCriteriaMet(bsc->mParentData)) 2554 2553 { 2554 const bool globalCriteriaMet = GlobalTerminationCriteriaMet(bsc->mParentData); 2555 2555 2556 BvhNode *node = Subdivide(tempQueue, bsc, globalCriteriaMet); 2556 2557 … … 2560 2561 else // initial preprocessing finished for this candidate 2561 2562 { 2562 // add to "real" traversal queue2563 // add to candidate container 2563 2564 candidateContainer.push_back(bsc); 2564 2565 } … … 2575 2576 ObjectContainer::const_iterator oit, oit_end = objects->end(); 2576 2577 2577 /*for (oit = objects->begin(); oit != objects->end(); ++ oit)2578 {2579 cout << (*oit)->GetBox().SurfaceArea() << " ";2580 }*/2581 2582 2578 float maxAreaDiff = -1.0f; 2583 2579 2584 2580 ObjectContainer::const_iterator backObjectsStart = objects->begin(); 2585 int dummy = 0; 2586 for (oit = objects->begin(); oit != (objects->end() - 1); ++ oit , ++ dummy)2581 2582 for (oit = objects->begin(); oit != (objects->end() - 1); ++ oit) 2587 2583 { 2588 2584 Intersectable *objS = *oit; … … 2595 2591 { 2596 2592 maxAreaDiff = areaDiff; 2597 //cout << "maxAreaDiff : " << maxAreaDiff << " " << dummy << " " << objects->size() - dummy << endl;2598 2593 backObjectsStart = oit + 1; 2599 2594 } … … 2612 2607 } 2613 2608 2614 cout << "front: " << (int)frontObjects.size() << " back " << (int)backObjects.size() << " " << backObjects.front()->GetBox().SurfaceArea() - frontObjects.back()->GetBox().SurfaceArea() << endl; 2609 cout << "front: " << (int)frontObjects.size() << " back: " << (int)backObjects.size() << " " 2610 << backObjects.front()->GetBox().SurfaceArea() - frontObjects.back()->GetBox().SurfaceArea() << endl; 2615 2611 } 2616 2612 … … 2621 2617 const float areaLarge = largeObj->GetBox().SurfaceArea(); 2622 2618 2623 return area Small/ (areaLarge - areaSmall + Limits::Small);2619 return areaLarge / (areaLarge - areaSmall + Limits::Small); 2624 2620 } 2625 2621 … … 2627 2623 bool BvHierarchy::InitialTerminationCriteriaMet(const BvhTraversalData &tData) const 2628 2624 { 2629 return (0 2625 const bool terminationCriteriaMet = 2626 (0 2630 2627 || ((int)tData.mNode->mObjects.size() < mInitialMinObjects) 2631 2628 || (tData.mNode->mObjects.back()->GetBox().SurfaceArea() < mInitialMinArea) 2632 2629 || (AreaRatio(tData.mNode->mObjects.front(), tData.mNode->mObjects.back()) > mInitialMaxAreaRatio) 2633 2630 ); 2631 2632 cout << "criteria met: " << terminationCriteriaMet << " " << (int)tData.mNode->mObjects.size() << " " << mInitialMinObjects << endl 2633 << AreaRatio(tData.mNode->mObjects.front(), tData.mNode->mObjects.back()) << " " << mInitialMaxAreaRatio << endl 2634 << tData.mNode->mObjects.back()->GetBox().SurfaceArea() << " " << mInitialMinArea << endl; 2635 2636 return terminationCriteriaMet; 2634 2637 } 2635 2638 -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1789 r1830 274 274 275 275 276 float HierarchyManager::EvalFullMem() const 277 { 278 // question: should I also add the mem usage of the hierarchies? 279 const float objectSpaceMem = 16;//GetObjectSpaceMemUsage(); 280 const float viewSpaceMem = 16;//mVspTree->GetMemUsage(); 281 // HACK: the same value is used for view and object space 282 return mHierarchyStats.mMemory + mHierarchyStats.Leaves() * objectSpaceMem; 283 } 284 285 276 286 void HierarchyManager::EvalSubdivisionStats() 277 287 { 278 // question: should I also add the mem usage of the hierarchies? 279 const float objectSpaceMem = GetObjectSpaceMemUsage(); 280 const float viewSpaceMem = mVspTree->GetMemUsage(); 281 288 282 289 HierarchySubdivisionStats stats; 283 290 … … 286 293 stats.mEntriesInPvs = mHierarchyStats.mPvsEntries; 287 294 stats.mMemoryCost = mHierarchyStats.mMemory / float(1024 * 1024); 288 stats.mFullMemory = mHierarchyStats.mMemory / float(1024 * 1024) 289 + objectSpaceMem + viewSpaceMem; 295 stats.mFullMemory = EvalFullMem() / float(1024 * 1024); 290 296 stats.mViewSpaceSplits = mVspTree->mVspStats.Leaves(); 291 297 stats.mObjectSpaceSplits = GetObjectSpaceSubdivisionLeaves(); … … 322 328 (0 323 329 || (mHierarchyStats.Leaves() >= mTermMaxLeaves) 324 || (mHierarchyStats.mMemory >= mTermMaxMemory) 330 //|| (mHierarchyStats.mMemory >= mTermMaxMemory) 331 || (EvalFullMem() >= mTermMaxMemory) 325 332 || candidate->GlobalTerminationCriteriaMet() 326 333 //|| (mHierarchyStats.mRenderCostDecrease < mMinRenderCostDecrease) … … 335 342 Debug << "cost misses: " << mHierarchyStats.mGlobalCostMisses << " " << mTermGlobalCostMissTolerance << endl; 336 343 Debug << "memory: " << mHierarchyStats.mMemory << " " << mTermMaxMemory << endl; 344 Debug << "full memory: " << EvalFullMem() << " " << mTermMaxMemory << endl; 337 345 } 338 346 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1787 r1830 528 528 void GetPvsEfficiently(ViewCell *vc, ObjectPvs &pvs) const; 529 529 530 float EvalFullMem() const; 531 530 532 protected: 531 533 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1826 r1830 122 122 { 123 123 mStrategies.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION); 124 mStrategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 124 //mStrategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 125 mStrategies.push_back(SamplingStrategy::REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION); 125 126 mStrategies.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION); 126 127 } … … 5664 5665 Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl"); 5665 5666 5666 //Vector3 scale(0.9f, 0.9f, 0.9f);5667 Vector3 scale(1.0f, 1.0f, 1.0f);5667 Vector3 scale(0.9f, 0.9f, 0.9f); 5668 //Vector3 scale(1.0f, 1.0f, 1.0f); 5668 5669 5669 5670 if (exporter) … … 6214 6215 { 6215 6216 evalStrats.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION); 6216 evalStrats.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 6217 //evalStrats.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION); 6218 evalStrats.push_back(SamplingStrategy::REVERSE_VIEWSPACE_BORDER_BASED_DISTRIBUTION); 6217 6219 evalStrats.push_back(SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION); 6218 6220
Note: See TracChangeset
for help on using the changeset viewer.