Changeset 286 for trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
- Timestamp:
- 09/16/05 19:24:10 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r271 r286 144 144 */ 145 145 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; 147 151 protected: 148 149 /** Adds or discards polygons according to storePolys.150 */151 void ProcessPolygons(PolygonContainer *polys, const bool storePolys);152 153 152 154 153 /// parent of this node … … 184 183 @param backPolys returns the polygons in the back of the split plane 185 184 @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); 190 198 191 199 friend ostream &operator<<(ostream &s, const BspInterior &A) … … 194 202 } 195 203 196 protected: 204 protected: 197 205 198 /** Discards or stores polygon in node.199 @param polys the polygons200 @param storePolys if the polygons should be stored or discarded201 */202 void ProcessPolygon(Polygon3 *poly, const bool storePolys);203 206 204 207 /// Splitting plane corresponding to this node … … 255 258 /// current depth 256 259 int mDepth; 260 /// the polygon that drove the split plane computation 261 Polygon3 *mSplitPoly; 257 262 /// if the node is an inside or outside node with respect to the parent plane 258 bool mIsInside;263 //bool mIsInside; 259 264 BspTraversalData() {} 260 265 261 BspTraversalData(BspNode *node, PolygonContainer *polys, const int depth, const bool inside):262 mNode(node), mPolygons(polys), mDepth(depth), m IsInside(inside) {}266 BspTraversalData(BspNode *node, PolygonContainer *polys, const int depth, Polygon3 *splitPoly): 267 mNode(node), mPolygons(polys), mDepth(depth), mSplitPoly(splitPoly) {} 263 268 }; 264 269 … … 345 350 @param tStack current traversal stack 346 351 @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 348 353 @returns new root of the subtree 349 354 */ 350 BspNode *Subdivide(BspTraversalStack &tStack, BspTraversalData &tData, ViewCell *viewCell= NULL);355 BspNode *Subdivide(BspTraversalStack &tStack, BspTraversalData &tData, ViewCellContainer *viewCells = NULL); 351 356 352 357 /** Selects a splitting plane. … … 358 363 (i.e., possibly more than one leaf). 359 364 */ 360 void InsertViewCell(ViewCell *viewCell);365 //void InsertViewCell(ViewCell *viewCell); 361 366 362 367 /** Subdivide leaf. … … 365 370 @param frontPolys the polygons of the front child node as a result from splitting 366 371 @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 plane372 @param splitPoly polygon that is coincident to the split plane, NULL if no such polygon 368 373 @returns the root of the subdivision 369 374 */ … … 371 376 PolygonContainer *polys, 372 377 PolygonContainer *frontPolys, 373 PolygonContainer *backPolys, bool &inside);378 PolygonContainer *backPolys, Polygon3 **splitPoly); 374 379 375 380 /** Filters polygons down the tree. … … 402 407 403 408 /** 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 404 411 @returns number of polygons 405 412 */ 406 int AddMesh2Polygons(Mesh *mesh, PolygonContainer &polys );413 int AddMesh2Polygons(Mesh *mesh, PolygonContainer &polys, Intersectable *parent = NULL); 407 414 408 415 /** A ray is cast possible intersecting the tree.
Note: See TracChangeset
for help on using the changeset viewer.