Ignore:
Timestamp:
09/26/05 02:00:42 (19 years ago)
Author:
mattausch
Message:

added bsp split plane criteria

File:
1 edited

Legend:

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

    r296 r297  
    162162class BspInterior : public BspNode  
    163163{ 
     164        friend BspTree; 
    164165public: 
    165166        /** Standard contructor taking split plane as argument. 
     
    275276 
    276277        /** Default constructor creating an empty tree. 
     278                @param viewCell view cell corresponding to unbounded space 
    277279        */  
    278         BspTree(); 
     280        BspTree(ViewCell *viewCell); 
    279281 
    280282        ~BspTree(); 
     
    427429        inline int GetNextCandidateIdx(const int max) const; 
    428430 
     431        /** Helper function which extracts a view cell on the front and the back 
     432                of the split plane. 
     433                @param backViewCell returns view cell on the back of the split plane 
     434                @param frontViewCell returns a view cell on the front of the split plane 
     435                @param coincident container of polygons coincident to the split plane 
     436                @param splitPlane the split plane which decides about back and front 
     437                @param extractFront if a front view cell is extracted 
     438                @param extractBack if a back view cell is extracted 
     439        */ 
     440        void ExtractViewCells(ViewCell **backViewCell,  
     441                                                  ViewCell **frontViewCell, 
     442                                                  const PolygonContainer &coincident, 
     443                                                  const Plane3 splitPlane,  
     444                                                  const bool extractFront,  
     445                                                  const bool extractBack) const; 
     446         
    429447        /// Pointer to the root of the tree 
    430448        BspNode *mRoot; 
     
    436454 
    437455        /// Strategies for choosing next split plane. 
    438         enum {NEXT_POLYGON = 0,  
    439                   LEAST_SPLITS = 2,  
    440                   BALANCED_TREE = 4,  
    441                   VERTICAL_AXIS = 8,  
    442                   AXIS_ALIGNED = 16}; 
     456        enum {NO_STRATEGY = 0, 
     457                  NEXT_POLYGON = 1,  
     458                  AXIS_ALIGNED = 2, 
     459                  LEAST_SPLITS = 4,  
     460                  BALANCED_POLYS = 8, 
     461                  BALANCED_VIEW_CELLS = 16, 
     462                  LARGEST_POLY_AREA = 32, 
     463                  VERTICAL_AXIS = 64 
     464                }; 
    443465 
    444466        /// box around the whole view domain 
     
    448470        bool mStorePolys; 
    449471 
    450         /// vertical axis of scene 
    451         Vector3 mVerticalAxis; 
     472        /// view cell corresponding to unbounded space 
     473        ViewCell *mViewCell; 
    452474 
    453475public: 
     
    465487        /// BSP tree construction method 
    466488        static int sConstructionMethod; 
    467  
     489        /// maximal number of polygons where we do axis aligned splits 
     490        static int sTermMaxPolysForAxisAligned; 
     491 
     492        // factors to guid the split plane heuristics 
    468493        static float sLeastSplitsFactor; 
    469         static float sBalancedTreeFactor; 
    470         static float sVerticalFactor; 
    471  
     494        static float sBalancedPolysFactor; 
     495        static float sBalancedViewCellsFactor; 
     496        static float sVerticalSplitsFactor; 
     497         
    472498private: 
    473499        /** Evaluates split plane classification with respect to the plane's  
     
    478504                contribution for a minimum number splits in the tree. 
    479505        */ 
    480         static float sBalancedTreeTable[4]; 
     506        static float sBalancedPolysTable[4]; 
    481507}; 
    482508 
Note: See TracChangeset for help on using the changeset viewer.