Changeset 263 for trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
- Timestamp:
- 09/12/05 02:07:02 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r262 r263 72 72 73 73 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; } 76 76 77 77 void Reset() … … 128 128 PolygonContainer *GetPolygons(); 129 129 130 /** Adds polygons to node. 131 */ 132 void AddPolygons(PolygonContainer *polys); 133 130 134 protected: 131 135 … … 143 147 /** Standard contructor taking split plane as argument. 144 148 */ 145 BspInterior( Plane3plane);149 BspInterior(const Plane3 &plane); 146 150 /** @return false since it is an interior node 147 151 */ … … 173 177 protected: 174 178 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 175 185 /// Splitting plane corresponding to this node 176 186 Plane3 mPlane; … … 188 198 189 199 public: 190 BspLeaf(ViewCell *viewCell = NULL); 200 BspLeaf(); 201 BspLeaf(ViewCell *viewCell); 202 BspLeaf(BspInterior *parent); 191 203 192 204 /** @return true since it is an interior node … … 201 213 202 214 protected: 203 204 /** Helper function used to add remaining polygons to leaf.205 */206 void AddPolygons(PolygonContainer *polys);207 215 208 216 /// polygonal representation of this viewcell … … 239 247 240 248 /// BSP tree construction type 241 enum {VIEW CELLS, SCENE_GEOMETRY, RAYS};249 enum {VIEW_CELLS, SCENE_GEOMETRY, RAYS}; 242 250 243 251 /** Default constructor creating an empty tree. … … 305 313 void Construct(PolygonContainer *polys); 306 314 307 /** Evaluates plane classification with respect to the plane's308 contribution for a balanced tree.309 */310 static inline int EvalForBalancedTree(const int classficiation);311 /** Evaluates plane classification with respect to the plane's312 contribution for a minimum number splits in the tree.313 */314 static inline int EvalForLeastSplits(const int classification);315 316 315 /** Evaluates the contribution of the candidate split plane. 317 316 */ … … 331 330 332 331 /** Selects a splitting plane. 333 @param poly gons the polygon dataon which the split decition is based334 */ 335 Plane3 SelectPlane(PolygonContainer *poly gons) const;332 @param polys the polygon list on which the split decition is based 333 */ 334 Plane3 SelectPlane(PolygonContainer *polys) const; 336 335 337 336 /** Filters next viewcell down the tree and inserts it into the appropriate leaves … … 391 390 int CastRay(Ray &ray); 392 391 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 398 393 399 394 /// Pointer to the root of the tree … … 433 428 /// number of candidates evaluated for the next split plane 434 429 static int sMaxCandidates; 430 /// BSP tree construction method 431 static int sConstructionMethod; 432 433 private: 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]; 435 442 }; 436 443
Note: See TracChangeset
for help on using the changeset viewer.