Changeset 879


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?

Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj

    r863 r879  
    333333                        </File> 
    334334                        <File 
     335                                RelativePath="..\src\RenderSampler.cpp"> 
     336                        </File> 
     337                        <File 
     338                                RelativePath="..\src\RenderSampler.h"> 
     339                        </File> 
     340                        <File 
    335341                                RelativePath="..\src\RenderSimulator.cpp"> 
    336342                        </File> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r878 r879  
    26862686 
    26872687 
    2688 ViewCell *BspViewCellsManager::GetViewCell(const Vector3 &point) const 
     2688ViewCell *BspViewCellsManager::GetViewCell(const Vector3 &point, const bool active) const 
    26892689{ 
    26902690        if (!mBspTree) 
     
    46484648 
    46494649 
    4650 ViewCell *VspBspViewCellsManager::GetViewCell(const Vector3 &point) const 
     4650ViewCell *VspBspViewCellsManager::GetViewCell(const Vector3 &point, const bool active) const 
    46514651{ 
    46524652        if (!mVspBspTree) 
     
    46564656          return NULL; 
    46574657 
    4658         return mVspBspTree->GetViewCell(point); 
     4658        return mVspBspTree->GetViewCell(point, active); 
    46594659} 
    46604660 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r871 r879  
    236236   
    237237        /** Get a viewcell containing the specified point  
    238         */ 
    239         virtual ViewCell *GetViewCell(const Vector3 &point) const = 0; 
     238                @param active if the active or elementary view cell should be returned. 
     239        */ 
     240        virtual ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const = 0; 
    240241   
    241242        virtual void PrintPvsStatistics(ostream &s); 
     
    667668         
    668669 
    669         /** Get a viewcell containing the specified point */ 
    670         ViewCell *GetViewCell(const Vector3 &point) const; 
     670        /** Get a viewcell containing the specified point  
     671        */ 
     672        ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 
    671673 
    672674        void CreateMesh(ViewCell *vc); 
     
    749751        */ 
    750752        //  virtual void PrintStatistics(ostream &s) const; 
    751         ViewCell *GetViewCell(const Vector3 &point) const { return NULL; } 
     753        ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const { return NULL; } 
    752754 
    753755        float GetProbability(ViewCell *viewCell); 
     
    817819                                                ViewCellContainer &viewcells); 
    818820 
    819         ViewCell *GetViewCell(const Vector3 &point) const { return NULL; } 
     821        ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const { return NULL; } 
    820822 
    821823        float GetProbability(ViewCell *viewCell); 
     
    881883        float GetProbability(ViewCell *viewCell); 
    882884         
    883         ViewCell *GetViewCell(const Vector3 &point) const; 
     885        ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 
    884886 
    885887        bool GetViewPoint(Vector3 &viewPoint) const; 
  • 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 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h

    r870 r879  
    306306 
    307307        /** Returns view cell the current point is located in. 
    308         */ 
    309         ViewCell *GetViewCell(const Vector3 &point); 
     308                @param point the current view point 
     309                @param active if currently active view cells should be returned or 
     310                elementary view cell 
     311        */ 
     312        ViewCell *GetViewCell(const Vector3 &point, const bool active = false); 
    310313 
    311314 
Note: See TracChangeset for help on using the changeset viewer.