Changeset 264 for trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
- Timestamp:
- 09/12/05 18:24:44 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r263 r264 107 107 public: 108 108 BspNode(); 109 virtual ~BspNode(); 109 110 BspNode(BspInterior *parent); 110 111 … … 126 127 void SetParent(BspInterior *parent); 127 128 129 /** Returns pointer to polygons. 130 */ 128 131 PolygonContainer *GetPolygons(); 129 132 130 /** Adds polygons to node.131 */132 void AddPolygons(PolygonContainer *polys);133 134 133 protected: 134 135 /** Adds or discards polygons according to storePolys. 136 */ 137 void ProcessPolygons(PolygonContainer *polys, const bool storePolys); 138 135 139 136 140 /// parent of this node 137 141 BspInterior *mParent; 138 142 139 PolygonContainer mPolygons; 143 /// store polygons created during BSP splits 144 PolygonContainer *mPolygons; 140 145 }; 141 146 … … 165 170 @param backPolys returns the polygons in the back of the split plane 166 171 @param splits number of splits 167 */ 168 void SplitPolygons(PolygonContainer *polys, PolygonContainer *frontPolys, 172 @returns true if one or more polygons are inside of the split plane 173 */ 174 bool SplitPolygons(PolygonContainer *polys, PolygonContainer *frontPolys, 169 175 PolygonContainer *backPolys, int &splits, bool storePolys = false); 170 176 … … 181 187 @param storePolys if the polygons should be stored or discarded 182 188 */ 183 void ProcessPolygon(Polygon3 *poly, bool storePolys);189 void ProcessPolygon(Polygon3 *poly, const bool storePolys); 184 190 185 191 /// Splitting plane corresponding to this node … … 201 207 BspLeaf(ViewCell *viewCell); 202 208 BspLeaf(BspInterior *parent); 209 BspLeaf(BspInterior *parent, ViewCell *viewCell); 203 210 204 211 /** @return true since it is an interior node … … 231 238 /// the current node 232 239 BspNode *mNode; 233 /// parent of current node234 BspInterior *mParent;235 240 /// polygonal data for splitting 236 241 PolygonContainer *mPolygons; 237 242 /// current depth 238 243 int mDepth; 239 244 /// if the node is an inside or outside node with respect to the parent plane 245 bool mIsInside; 240 246 BspTraversalData() {} 241 247 242 BspTraversalData(BspNode *node, BspInterior *parent, PolygonContainer *polys, const int depth):243 mNode(node), mP arent(parent), mPolygons(polys), mDepth(depth) {}248 BspTraversalData(BspNode *node, PolygonContainer *polys, const int depth, const bool inside): 249 mNode(node), mPolygons(polys), mDepth(depth), mIsInside(inside) {} 244 250 }; 245 251 … … 341 347 /** Subdivide leaf. 342 348 @param leaf the leaf to be subdivided 343 @param parent the parent node of this leaf344 349 @param polys the input polygons 345 @param depth the current tree depth346 350 @param frontPolys the polygons of the front child node as a result from splitting 347 351 @param backPolys the polygons of the back child node as a result from splitting 348 */349 BspNode *SubdivideNode(BspLeaf *leaf,350 BspInterior *parent,351 PolygonContainer *polys,352 const int depth,353 PolygonContainer *frontPolys,354 PolygonContainer *backPolys);352 @param if the polygons are outside or inside with respect to the interior node plane 353 @returns the root of the subdivision 354 */ 355 BspInterior *SubdivideNode(BspLeaf *leaf, 356 PolygonContainer *polys, 357 PolygonContainer *frontPolys, 358 PolygonContainer *backPolys, bool &inside); 355 359 356 360 /** Filters polygons down the tree.
Note: See TracChangeset
for help on using the changeset viewer.