Ignore:
Timestamp:
09/12/05 02:07:02 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r262 r263  
    7272 
    7373  int Nodes() const {return nodes;} 
    74   int Interior() const { return nodes/2; } 
    75   int Leaves() const { return (nodes/2) + 1; } 
     74  int Interior() const { return nodes / 2; } 
     75  int Leaves() const { return (nodes / 2) + 1; } 
    7676 
    7777  void Reset()  
     
    128128        PolygonContainer *GetPolygons(); 
    129129 
     130        /** Adds polygons to node. 
     131        */ 
     132        void AddPolygons(PolygonContainer *polys); 
     133 
    130134protected: 
    131135 
     
    143147        /** Standard contructor taking split plane as argument. 
    144148        */ 
    145         BspInterior(Plane3 plane); 
     149        BspInterior(const Plane3 &plane); 
    146150        /** @return false since it is an interior node  
    147151        */ 
     
    173177protected: 
    174178         
     179        /** Discards or stores polygon in node. 
     180                @param polys the polygons 
     181                @param storePolys if the polygons should be stored or discarded 
     182        */ 
     183        void ProcessPolygon(Polygon3 *poly, bool storePolys); 
     184 
    175185        /// Splitting plane corresponding to this node 
    176186        Plane3 mPlane; 
     
    188198 
    189199public: 
    190         BspLeaf(ViewCell *viewCell = NULL); 
     200        BspLeaf(); 
     201        BspLeaf(ViewCell *viewCell); 
     202        BspLeaf(BspInterior *parent); 
    191203 
    192204        /** @return true since it is an interior node  
     
    201213 
    202214protected: 
    203  
    204         /** Helper function used to add remaining polygons to leaf. 
    205         */ 
    206         void AddPolygons(PolygonContainer *polys); 
    207215 
    208216        /// polygonal representation of this viewcell 
     
    239247 
    240248        /// BSP tree construction type 
    241         enum {VIEWCELLS, SCENE_GEOMETRY, RAYS}; 
     249        enum {VIEW_CELLS, SCENE_GEOMETRY, RAYS}; 
    242250 
    243251        /** Default constructor creating an empty tree. 
     
    305313        void Construct(PolygonContainer *polys); 
    306314 
    307         /** Evaluates plane classification with respect to the plane's  
    308                 contribution for a balanced tree. 
    309         */ 
    310         static inline int EvalForBalancedTree(const int classficiation); 
    311         /** Evaluates plane classification with respect to the plane's  
    312                 contribution for a minimum number splits in the tree. 
    313         */ 
    314         static inline int EvalForLeastSplits(const int classification); 
    315  
    316315        /** Evaluates the contribution of the candidate split plane. 
    317316        */ 
     
    331330 
    332331        /** Selects a splitting plane.  
    333                 @param polygons the polygon data on which the split decition is based 
    334         */ 
    335         Plane3 SelectPlane(PolygonContainer *polygons) const; 
     332                @param polys the polygon list on which the split decition is based 
     333        */ 
     334        Plane3 SelectPlane(PolygonContainer *polys) const; 
    336335 
    337336        /** Filters next viewcell down the tree and inserts it into the appropriate leaves 
     
    391390        int CastRay(Ray &ray); 
    392391 
    393         /** Discards or stores polygons in leaf and deletes the container. 
    394                 @param polys the polygons 
    395                 @param leaf the leaf where polygons are stored 
    396         */ 
    397         bool ProcessPolygons(PolygonContainer *polys, BspLeaf *node); 
     392 
    398393 
    399394        /// Pointer to the root of the tree 
     
    433428        /// number of candidates evaluated for the next split plane 
    434429        static int sMaxCandidates; 
     430        /// BSP tree construction method 
     431        static int sConstructionMethod; 
     432 
     433private: 
     434        /** Evaluates split plane classification with respect to the plane's  
     435                contribution for a balanced tree. 
     436        */ 
     437        static int sLeastSplitsTable[4]; 
     438        /** Evaluates split plane classification with respect to the plane's  
     439                contribution for a minimum number splits in the tree. 
     440        */ 
     441        static int sBalancedTreeTable[4]; 
    435442}; 
    436443 
Note: See TracChangeset for help on using the changeset viewer.