Ignore:
Timestamp:
09/16/05 19:24:10 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r271 r286  
    144144        */ 
    145145        PolygonContainer *GetPolygons(); 
    146 int mViewCellIdx; 
     146        /** Stores polygons in node or discards them according to storePolys. 
     147        */ 
     148        void ProcessPolygons(PolygonContainer *polys, const bool storePolys); 
     149 
     150//int mViewCellIdx; 
    147151protected: 
    148  
    149         /** Adds or discards polygons according to storePolys. 
    150         */ 
    151         void ProcessPolygons(PolygonContainer *polys, const bool storePolys); 
    152  
    153152 
    154153        /// parent of this node 
     
    184183                @param backPolys returns the polygons in the back of the split plane 
    185184                @param splits number of splits 
    186                 @returns true if one or more polygons are inside of the split plane 
    187         */ 
    188         bool SplitPolygons(PolygonContainer *polys, PolygonContainer *frontPolys,  
    189                                            PolygonContainer *backPolys, int &splits, bool storePolys = false); 
     185                @returns split polygon if there is a polygon coincident to the split plane, NULL otherwise 
     186        */ 
     187        Polygon3 *SplitPolygons(PolygonContainer *polys,  
     188                                                        PolygonContainer *frontPolys,  
     189                                                    PolygonContainer *backPolys,  
     190                                                        int &splits,  
     191                                                        bool storePolys = false); 
     192 
     193        /** Stores polygon in node or discards them according to storePolys. 
     194                @param polys the polygons 
     195                @param storePolys if the polygons should be stored or discarded 
     196        */ 
     197        void ProcessPolygon(Polygon3 *poly, const bool storePolys); 
    190198 
    191199        friend ostream &operator<<(ostream &s, const BspInterior &A) 
     
    194202        } 
    195203 
    196 protected: 
     204protected:       
    197205         
    198         /** Discards or stores polygon in node. 
    199                 @param polys the polygons 
    200                 @param storePolys if the polygons should be stored or discarded 
    201         */ 
    202         void ProcessPolygon(Polygon3 *poly, const bool storePolys); 
    203206 
    204207        /// Splitting plane corresponding to this node 
     
    255258                /// current depth 
    256259                int mDepth; 
     260                /// the polygon that drove the split plane computation 
     261                Polygon3 *mSplitPoly; 
    257262                /// if the node is an inside or outside node with respect to the parent plane 
    258                 bool mIsInside; 
     263                //bool mIsInside; 
    259264                BspTraversalData() {} 
    260265                 
    261                 BspTraversalData(BspNode *node, PolygonContainer *polys, const int depth, const bool inside):  
    262                 mNode(node), mPolygons(polys), mDepth(depth), mIsInside(inside) {} 
     266                BspTraversalData(BspNode *node, PolygonContainer *polys, const int depth, Polygon3 *splitPoly):  
     267                mNode(node), mPolygons(polys), mDepth(depth), mSplitPoly(splitPoly) {} 
    263268    }; 
    264269 
     
    345350            @param tStack current traversal stack 
    346351                @param tData traversal data also holding node to be subdivided 
    347                 @param viewCell the view cell that will be represented with this part of the Bsp tree. 
     352                @param viewCellContainer if not null, a new viewcell is created and stored in the container 
    348353                @returns new root of the subtree 
    349354        */ 
    350         BspNode *Subdivide(BspTraversalStack &tStack, BspTraversalData &tData, ViewCell *viewCell = NULL); 
     355        BspNode *Subdivide(BspTraversalStack &tStack, BspTraversalData &tData, ViewCellContainer *viewCells = NULL); 
    351356 
    352357        /** Selects a splitting plane.  
     
    358363                (i.e., possibly more than one leaf). 
    359364        */ 
    360         void InsertViewCell(ViewCell *viewCell); 
     365        //void InsertViewCell(ViewCell *viewCell); 
    361366         
    362367        /** Subdivide leaf. 
     
    365370                @param frontPolys the polygons of the front child node as a result from splitting 
    366371                @param backPolys the polygons of the back child node as a result from splitting 
    367                 @param if the polygons are outside or inside with respect to the interior node plane 
     372                @param splitPoly polygon that is coincident to the split plane, NULL if no such polygon 
    368373                @returns the root of the subdivision 
    369374        */ 
     
    371376                                                           PolygonContainer *polys,  
    372377                                                           PolygonContainer *frontPolys,  
    373                                                            PolygonContainer *backPolys, bool &inside); 
     378                                                           PolygonContainer *backPolys, Polygon3 **splitPoly); 
    374379 
    375380        /** Filters polygons down the tree. 
     
    402407 
    403408        /** Extract polygons of this mesh and add to polygon container. 
     409                @param mesh the mesh that drives the polygon construction 
     410                @param parent the parent intersectable this polygon is constructed from 
    404411                @returns number of polygons 
    405412        */ 
    406         int AddMesh2Polygons(Mesh *mesh, PolygonContainer &polys); 
     413        int AddMesh2Polygons(Mesh *mesh, PolygonContainer &polys, Intersectable *parent = NULL); 
    407414 
    408415        /** A ray is cast possible intersecting the tree. 
Note: See TracChangeset for help on using the changeset viewer.