Ignore:
Timestamp:
05/03/06 09:40:01 (18 years ago)
Author:
mattausch
Message:

changing concept of active view cells

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h

    r880 r881  
    2222class MergeCandidate; 
    2323class ViewCellsManager; 
     24class ViewCellLeaf; 
    2425 
    2526/** Statistics for a view cell partition. 
     
    217218 
    218219 
    219         /** Sets this view cell to be an active view cell. 
    220         */ 
    221         void SetActive(); 
    222         /** Returns if this view cell is active. 
    223         */ 
    224         bool IsActive() const; 
    225  
    226220 
    227221        // last mail id -> warning not thread safe! 
     
    230224        static int sReservedMailboxes; 
    231225 
    232         static int sLastUpdated; 
    233226         
    234227protected: 
     
    244237        bool mValid; 
    245238 
    246         int mLastUpdated; 
    247         bool mIsActive; 
    248         /** color used for consistent visualization */ 
     239        /// color used for consistent visualization 
    249240        RgbColor mColor; 
    250241 
     
    252243        /// pvs size, used for lazy pvs computation 
    253244        int mPvsSize; 
     245        /// if the given pvs size is the real pvs size 
    254246        bool mPvsSizeValid; 
    255247 
     
    287279}; 
    288280 
     281 
    289282/** 
    290         View cell belonging to a hierarchy. 
     283        Leaf of the view cell. 
    291284*/ 
    292 template<typename T> 
    293285class ViewCellLeaf: public ViewCell 
    294286{ 
    295287public: 
    296  
    297         ViewCellLeaf<T>(): mLeaf(NULL) { SetActive(); } 
    298         ViewCellLeaf<T>(Mesh *mesh): 
    299         ViewCell(mesh), mLeaf(NULL) { SetActive(); } 
    300          
     288        ViewCellLeaf()  {  mActiveViewCell = this; } 
     289        ViewCellLeaf(Mesh *mesh): 
     290        ViewCell(mesh) { mActiveViewCell = this; } 
    301291 
    302292        bool IsLeaf() const 
     
    304294                return true; 
    305295        } 
     296 
     297        /** Returns if this view cell is active. 
     298        */ 
     299        ViewCell *GetActiveViewCell() const  
     300        { return mActiveViewCell; } 
     301 
     302        /** Sets this view cell to be an active view cell. 
     303        */ 
     304        void SetActiveViewCell(ViewCell *vc) 
     305        { mActiveViewCell = vc;} 
     306 
     307         
     308        /// points to the currently active view cell. 
     309        ViewCell *mActiveViewCell; 
     310}; 
     311 
     312/** 
     313        Leaf of the view cell hierarchy corresponding to a leaf in a spatial hierarchy. 
     314*/ 
     315template<typename T> 
     316class HierarchyLeafViewCell: public ViewCellLeaf 
     317{ 
     318public: 
     319 
     320        HierarchyLeafViewCell<T>(): ViewCellLeaf() {  } 
     321        HierarchyLeafViewCell<T>(Mesh *mesh): 
     322        ViewCellLeaf(mesh) {  } 
     323                 
     324 
     325        bool IsLeaf() const 
     326        { 
     327                return true; 
     328        } 
     329 
    306330 
    307331        /// Leaf of some hierarchy which is part of this view cell. 
     
    310334 
    311335 
    312 typedef ViewCellLeaf<BspLeaf *> BspViewCell; 
    313 typedef ViewCellLeaf<KdLeaf *> KdViewCell; 
    314 typedef ViewCellLeaf<VspKdLeaf *> VspKdViewCell; 
     336typedef HierarchyLeafViewCell<BspLeaf *> BspViewCell; 
     337typedef HierarchyLeafViewCell<KdLeaf *> KdViewCell; 
     338typedef HierarchyLeafViewCell<VspKdLeaf *> VspKdViewCell; 
    315339 
    316340 
     
    399423        /** Returns active view cell that is in the path of this view cell. 
    400424        */ 
    401         ViewCell *GetActiveViewCell(ViewCell *vc) const; 
     425        ViewCell *GetActiveViewCell(ViewCellLeaf *vc) const; 
    402426 
    403427        /** Sets the leaves to be the currently active view cells. 
Note: See TracChangeset for help on using the changeset viewer.