Ignore:
Timestamp:
02/26/07 23:47:04 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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} 
Note: See TracChangeset for help on using the changeset viewer.