Ignore:
Timestamp:
02/05/07 16:45:46 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r2093 r2094  
    2222#include "BvHierarchy.h" 
    2323#include "ViewCell.h" 
     24#include "TraversalTree.h" 
    2425 
    2526 
     
    2829 
    2930#define USE_FIXEDPOINT_T 0 
    30  
    3131#define STUPID_METHOD 0 
    3232 
     
    4141mObjectSpaceSubdivisionType(objectSpaceSubdivisionType), 
    4242mOspTree(NULL),  
    43 mBvHierarchy(NULL) 
     43mBvHierarchy(NULL), 
     44mTraversalTree(NULL) 
    4445{ 
    4546        switch(mObjectSpaceSubdivisionType) 
     
    396397                mBvHierarchy->SetUniqueNodeIds(); 
    397398        } 
     399 
     400        if (0) CreateTraversalTree(); 
    398401} 
    399402 
     
    24832486void HierarchyManager::CreateTraversalTree() 
    24842487{ 
    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 
     2507int 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.