Ignore:
Timestamp:
06/21/06 09:44:39 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r1012 r1027  
    278278 
    279279        /** Determines whether this node is a root 
    280         @return true if root 
    281         */ 
    282         virtual bool IsRoot() const; 
     280                @return true if root 
     281        */ 
     282        virtual bool IsRoot() const 
     283        { 
     284                return mParent == NULL; 
     285        } 
    283286 
    284287        /** Returns parent node. 
    285288        */ 
    286         BspInterior *GetParent(); 
     289        inline BspInterior *GetParent() 
     290        {  
     291                return mParent;  
     292        } 
    287293 
    288294        /** Sets parent node. 
    289295        */ 
    290         void SetParent(BspInterior *parent); 
     296        inline void BspNode::SetParent(BspInterior *parent) 
     297        { 
     298                mParent = parent; 
     299        } 
     300 
    291301 
    292302        /** Returns true if this node is a sibling of node n. 
     
    334344        BspInterior(const Plane3 &plane); 
    335345        ~BspInterior(); 
     346 
    336347        /** @return false since it is an interior node  
    337348        */ 
    338         bool IsLeaf() const; 
    339  
    340         BspNode *GetBack(); 
    341         BspNode *GetFront(); 
    342  
     349        bool IsLeaf() const 
     350        {  
     351                return false;  
     352        } 
     353        BspNode *GetBack()  
     354        { 
     355                return mBack; 
     356        } 
     357 
     358        BspNode *GetFront()  
     359        { 
     360                return mFront; 
     361        } 
     362         
    343363        /** Returns split plane. 
    344364        */ 
    345         Plane3 GetPlane() const; 
     365        Plane3 BspInterior::GetPlane() const 
     366        { 
     367                return mPlane; 
     368        } 
    346369 
    347370        /** Replace front or back child with new child. 
    348371        */ 
    349         void ReplaceChildLink(BspNode *oldChild, BspNode *newChild); 
     372        inline void ReplaceChildLink(BspNode *oldChild, BspNode *newChild) 
     373        { 
     374                if (mBack == oldChild) 
     375                        mBack = newChild; 
     376                else 
     377                        mFront = newChild; 
     378        } 
     379 
    350380        /** Replace front and back child. 
    351381        */ 
     
    383413        ~BspLeaf(); 
    384414 
     415        /** Returns pointer of view cell. 
     416        */ 
     417        inline ViewCellLeaf *GetViewCell() const 
     418        { 
     419                return mViewCell; 
     420        } 
     421 
     422        /** Sets pointer to view cell. 
     423        */ 
     424        inline void SetViewCell(ViewCellLeaf *viewCell) 
     425        { 
     426                mViewCell = viewCell; 
     427        } 
     428 
    385429        /** @return true since it is an interior node  
    386430        */ 
    387         bool IsLeaf() const; 
    388          
    389         /** Returns pointer of view cell. 
    390         */ 
    391         ViewCellLeaf *GetViewCell() const; 
    392  
    393         /** Sets pointer to view cell. 
    394         */ 
    395         void SetViewCell(ViewCellLeaf *viewCell); 
     431        bool BspLeaf::IsLeaf() const  
     432        {  
     433                return true;  
     434        } 
     435         
    396436 
    397437        /// Rays piercing this leaf. 
     
    403443        /// Probability that the view point lies in this leaf 
    404444        float mProbability; 
     445 
    405446 
    406447protected: 
Note: See TracChangeset for help on using the changeset viewer.