Changeset 2094 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
- Timestamp:
- 02/05/07 16:45:46 (17 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.