Ignore:
Timestamp:
05/02/06 18:08:04 (18 years ago)
Author:
mattausch
Message:

added parameter for fetching active view cell with getviewcell method in ViewCellsManager?

File:
1 edited

Legend:

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

    r870 r879  
    37473747 
    37483748 
    3749 ViewCell *VspBspTree::GetViewCell(const Vector3 &point) 
    3750 { 
    3751   if (mRoot == NULL) 
    3752         return NULL; 
     3749ViewCell *VspBspTree::GetViewCell(const Vector3 &point, const bool active) 
     3750{ 
     3751        if (mRoot == NULL) 
     3752                return NULL; 
     3753 
     3754        stack<BspNode *> nodeStack; 
     3755        nodeStack.push(mRoot); 
    37533756   
    3754   stack<BspNode *> nodeStack; 
    3755   nodeStack.push(mRoot); 
     3757        ViewCell *viewcell = NULL; 
    37563758   
    3757   ViewCell *viewcell = NULL; 
     3759        while (!nodeStack.empty())   
     3760        { 
     3761                BspNode *node = nodeStack.top(); 
     3762                nodeStack.pop(); 
     3763         
     3764                if (node->IsLeaf())  
     3765                { 
     3766                        viewcell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     3767                        break; 
     3768                }  
     3769                else     
     3770                {        
     3771                        BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3772         
     3773                        // random decision 
     3774                        if (interior->GetPlane().Side(point) < 0) 
     3775                                nodeStack.push(interior->GetBack()); 
     3776                        else 
     3777                                nodeStack.push(interior->GetFront()); 
     3778                } 
     3779        } 
    37583780   
    3759   while (!nodeStack.empty())  { 
    3760         BspNode *node = nodeStack.top(); 
    3761         nodeStack.pop(); 
    3762          
    3763         if (node->IsLeaf()) { 
    3764           viewcell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
    3765           break; 
    3766         } else { 
    3767            
    3768           BspInterior *interior = dynamic_cast<BspInterior *>(node); 
    3769                  
    3770           // random decision 
    3771           if (interior->GetPlane().Side(point) < 0) 
    3772                 nodeStack.push(interior->GetBack()); 
    3773           else 
    3774                 nodeStack.push(interior->GetFront()); 
    3775         } 
    3776   } 
    3777    
    3778   return viewcell; 
     3781        if (active) 
     3782                return mViewCellsTree->GetActiveViewCell(viewcell); 
     3783        else 
     3784                return viewcell; 
    37793785} 
    37803786 
Note: See TracChangeset for help on using the changeset viewer.