Changeset 2094 for GTP/trunk/Lib
- Timestamp:
- 02/05/07 16:45:46 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r2093 r2094 22 22 #include "BvHierarchy.h" 23 23 #include "ViewCell.h" 24 #include "TraversalTree.h" 24 25 25 26 … … 28 29 29 30 #define USE_FIXEDPOINT_T 0 30 31 31 #define STUPID_METHOD 0 32 32 … … 41 41 mObjectSpaceSubdivisionType(objectSpaceSubdivisionType), 42 42 mOspTree(NULL), 43 mBvHierarchy(NULL) 43 mBvHierarchy(NULL), 44 mTraversalTree(NULL) 44 45 { 45 46 switch(mObjectSpaceSubdivisionType) … … 396 397 mBvHierarchy->SetUniqueNodeIds(); 397 398 } 399 400 if (0) CreateTraversalTree(); 398 401 } 399 402 … … 2483 2486 void HierarchyManager::CreateTraversalTree() 2484 2487 { 2485 } 2486 2487 2488 } 2488 mTraversalTree = new TraversalTree; 2489 2490 ViewCellContainer viewCells; 2491 2492 // add mesh instances of the scene graph to the root of the tree 2493 TraversalLeaf *root = (TraversalLeaf *)mTraversalTree->GetRoot(); 2494 2495 //mVspTree->CollectViewCells(root->mViewCells, false); 2496 2497 const long startTime = GetTime(); 2498 cout << "building traversal tree ... " << endl; 2499 2500 mTraversalTree->Construct(); 2501 2502 cout << "finished kd tree construction in " << TimeDiff(startTime, GetTime()) * 1e-3 2503 << " secs " << endl; 2504 } 2505 2506 2507 int HierarchyManager::CastLineSegment(const Vector3 &origin, 2508 const Vector3 &termination, 2509 ViewCellContainer &viewcells, 2510 const bool useMailboxing) 2511 { 2512 if (!mTraversalTree) 2513 return mVspTree->CastLineSegment(origin,termination, viewcells, useMailboxing); 2514 else 2515 return mTraversalTree->CastLineSegment(origin,termination, viewcells, useMailboxing); 2516 } 2517 2518 2519 } -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r2073 r2094 42 42 class Exporter; 43 43 class ViewCellsParseHandlers; 44 class TraversalTree; 45 44 46 45 47 … … 305 307 306 308 309 /** Casts line segment into the view cells tree. 310 @param origin the origin of the line segment 311 @param termination the end point of the line segment 312 @returns view cells intersecting the line segment. 313 */ 314 int CastLineSegment(const Vector3 &origin, 315 const Vector3 &termination, 316 ViewCellContainer &viewcells, 317 const bool useMailboxing = true); 318 307 319 protected: 308 320 … … 351 363 */ 352 364 void RunConstruction(const bool repairQueue); 353 365 366 354 367 //////////////////////////////////////////////// 355 368 … … 651 664 bool mConsiderMemory; 652 665 666 TraversalTree *mTraversalTree; 667 653 668 int mMaxRepairs; 654 669 -
GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp
r2093 r2094 152 152 153 153 mBox.Initialize(); 154 154 155 ObjectContainer::const_iterator mi; 155 156 for ( mi = leaf->mObjects.begin(); mi != leaf->mObjects.end(); ++ mi) 156 157 { 157 // cout<<(*mi)->GetBox()<<endl;158 158 mBox.Include((*mi)->GetBox()); 159 159 } -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2093 r2094 1063 1063 { 1064 1064 // create the meshes and compute volumes 1065 vm->FinalizeViewCells(false); 1066 // vm->mViewCellsTree->AssignRandomColors(); 1067 } 1068 1069 if (0) 1070 { 1071 cout << "=============== " << vm->GetViewCellById(5318)->GetPvs().GetSize() << "========" << endl; 1065 const bool createMeshes = true; 1066 //const bool createMeshes = false; 1067 1068 vm->FinalizeViewCells(createMeshes); 1072 1069 } 1073 1070 … … 2778 2775 if (lastVssRay == NULL || 2779 2776 !(ray.mOrigin == lastVssRay->mTermination) || 2780 !(ray.mTermination == lastVssRay->mOrigin)) { 2781 viewCells.clear(); 2782 // traverse the view space subdivision 2783 CastLineSegment(origin, termination, viewCells); 2784 lastVssRay = &ray; 2777 !(ray.mTermination == lastVssRay->mOrigin)) 2778 { 2779 viewCells.clear(); 2780 2781 // traverse the view space subdivision 2782 CastLineSegment(origin, termination, viewCells); 2783 lastVssRay = &ray; 2785 2784 } 2786 2785 … … 6556 6555 ViewCellContainer &viewcells) 6557 6556 { 6558 return mHierarchyManager-> 6559 GetVspTree()->CastLineSegment(origin, termination, viewcells); 6557 return mHierarchyManager->CastLineSegment(origin, termination, viewcells); 6560 6558 } 6561 6559
Note: See TracChangeset
for help on using the changeset viewer.