Changeset 2170


Ignore:
Timestamp:
02/26/07 23:47:04 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r2168 r2170  
    742742        } 
    743743 
    744         InitItemBufferPass(); // create material for item buffer pass 
     744        // create material for item buffer pass 
     745        InitItemBufferPass(); 
    745746 
    746747        // save ambient light to reset later 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r2130 r2170  
    24922492void HierarchyManager::CreateTraversalTree() 
    24932493{ 
     2494        int mind, maxd; 
     2495        mVspTree->EvalMinMaxDepth(mind, maxd); 
     2496 
     2497        cout << "old tree balance: " << mind << " " << maxd << endl; 
    24942498        mTraversalTree = new TraversalTree; 
    24952499 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2168 r2170  
    69896989 
    69906990                // hack: just show final view cells 
    6991                 int pass = (int)mViewCells.size(); 
     6991                const int pass = (int)mViewCells.size(); 
     6992 
    69926993                //for (int pass = histoStepSize; pass <= numLeaves; pass += histoStepSize) 
    69936994                if (1) 
     
    70177018        ViewCellsManager::FinalizeViewCells(createMesh); 
    70187019 
    7019         if (1) 
    7020         {        
    7021                 if (mHierarchyManager->mUseTraversalTree) 
    7022                 { 
    7023                         // create a traversal tree for optimal view cell casting 
    7024                         mHierarchyManager->CreateTraversalTree(); 
    7025                 } 
    7026         } 
    7027 } 
    7028  
    7029  
    7030 } 
     7020        if (mHierarchyManager->mUseTraversalTree) 
     7021        { 
     7022                // create a traversal tree for optimal view cell casting 
     7023                mHierarchyManager->CreateTraversalTree(); 
     7024        } 
     7025} 
     7026 
     7027 
     7028} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r2124 r2170  
    34643464 
    34653465 
    3466 } 
     3466void VspTree::EvalMinMaxDepth(int &minDepth, int &maxDepth) 
     3467{ 
     3468        stack<pair<VspNode *, int> > nodeStack; 
     3469        nodeStack.push(pair<VspNode *, int>(mRoot, 0)); 
     3470 
     3471        minDepth = 999999; 
     3472        maxDepth = 0; 
     3473 
     3474        while (!nodeStack.empty()) 
     3475        { 
     3476                VspNode *node = nodeStack.top().first; 
     3477                const int depth = nodeStack.top().second; 
     3478 
     3479                nodeStack.pop(); 
     3480                 
     3481                if (node->IsLeaf()) 
     3482                { 
     3483                        // test if this leaf is in valid view space 
     3484                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
     3485 
     3486                        if (depth < minDepth) 
     3487                                minDepth = depth; 
     3488 
     3489                        if (depth > maxDepth) 
     3490                                maxDepth = depth; 
     3491                } 
     3492                else 
     3493                { 
     3494                        VspInterior *interior = static_cast<VspInterior *>(node); 
     3495 
     3496                        nodeStack.push(pair<VspNode *, int>(interior->GetBack(), depth + 1)); 
     3497                        nodeStack.push(pair<VspNode *, int>(interior->GetFront(), depth + 1)); 
     3498                } 
     3499        } 
     3500} 
     3501 
     3502 
     3503} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h

    r2124 r2170  
    922922        float PrepareHeuristics(KdLeaf *leaf); 
    923923 
    924          
     924        void EvalMinMaxDepth(int &minDepth, int &maxDepth); 
     925 
    925926        ///////////////////////////////////////////////////////////////////////////// 
    926927 
Note: See TracChangeset for help on using the changeset viewer.