Changeset 508 for trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h
- Timestamp:
- 01/08/06 05:56:40 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h
r503 r508 34 34 class VspBspTree 35 35 { 36 friend class ViewCellsParseHandlers; 37 36 38 public: 37 39 … … 180 182 BspNode *GetRoot() const; 181 183 182 /** Exports VspBsp tree to file.183 */184 bool Export(const string filename);185 186 184 /** Collects the leaf view cells of the tree 187 185 @param viewCells returns the view cells … … 279 277 bool ViewPointValid(const Vector3 &viewPoint) const; 280 278 281 /** Returns the view cell corresponding to 282 the space outside the valid view space. 283 */ 284 BspViewCell *GetOutOfBoundsCell() const; 285 286 /** Writes tree to disc. 287 */ 288 bool WriteVspBspTree(); 289 290 /** Loads tree from disc. 291 */ 292 bool LoadVspBspTree(); 279 /** Returns view cell corresponding to 280 the invalid view space. 281 */ 282 BspViewCell *GetOutOfBoundsCell(); 283 284 /** Writes tree to output stream 285 */ 286 bool Export(ofstream &stream); 293 287 294 288 protected: … … 321 315 }; 322 316 317 /** Returns view cell corresponding to 318 the invalid view space. If it does not exist, it is created. 319 */ 320 BspViewCell *GetOrCreateOutOfBoundsCell(); 321 323 322 /** Collapses the tree with respect to the view cell partition, 324 323 i.e. leaves having the same view cell are collapsed. … … 329 328 */ 330 329 BspNode *CollapseTree(BspNode *node, int &collapsed); 330 331 331 /** Shuffles the leaves, i.e., tests if exchanging 332 332 the leaves helps in improving the view cells. … … 367 367 bool SelectPlane(Plane3 &plane, 368 368 BspLeaf *leaf, 369 VspBspTraversalData &data); 369 VspBspTraversalData &data, 370 VspBspTraversalData &frontData, 371 VspBspTraversalData &backData); 370 372 371 373 /** Strategies where the effect of the split plane is tested … … 375 377 */ 376 378 float SplitPlaneCost(const Plane3 &candidatePlane, 377 const VspBspTraversalData &data) const; 378 379 const VspBspTraversalData &data, 380 BspNodeGeometry &geomFront, 381 BspNodeGeometry &geomBack, 382 float &areaFront, 383 float &areaBack) const; 379 384 380 385 /** Subdivide leaf. … … 397 402 PolygonContainer &coincident); 398 403 399 /** Selects the split plane in order to construct a tree with400 certain characteristics (e.g., balanced tree, least splits,401 2.5d aligned)402 @param bestPlane returns the split plane403 @param polygons container of polygons404 @param rays bundle of rays on which the split can be based405 406 @returns true if the overall cost is under maxCostRatio407 */408 bool SelectPlaneHeuristics(Plane3 &bestPlane,409 BspLeaf *leaf,410 VspBspTraversalData &data);411 412 404 /** Extracts the meshes of the objects and adds them to polygons. 413 405 Adds object aabb to the aabb of the tree. … … 441 433 const VspBspTraversalData &tData, 442 434 int &axis, 443 float &position, 444 int &raysBack, 445 int &raysFront, 446 int &pvsBack, 447 int &pvsFront); 435 BspNodeGeometry **frontGeom, 436 BspNodeGeometry **backGeom, 437 float &frontArea, 438 float &backArea); 448 439 449 440 /** Sorts split candidates for surface area heuristics for axis aligned splits. … … 506 497 507 498 */ 508 void AddObjToPvs(Intersectable *obj, const int cf, int &frontPvs, int &backPvs) const; 499 void AddObjToPvs(Intersectable *obj, 500 const int cf, 501 int &frontPvs, 502 int &backPvs, 503 int &totalPvs) const; 509 504 510 505 /** Computes PVS size induced by the rays. … … 591 586 void PropagateUpValidity(BspNode *node); 592 587 593 /** Creates or returns view cell corresponding to 594 the space outside the valid view space. 595 */ 596 BspViewCell *GetOrCreateOutOfBoundsCell(); 588 /** Writes the node to disk 589 @note: should be implemented as visitor 590 */ 591 void ExportNode(BspNode *node, ofstream &stream); 592 593 /** Returns memory usage of tree. 594 */ 595 float GetMemUsage() const; 597 596 598 597 /// Pointer to the root of the tree … … 621 620 /// mininum PVS 622 621 int mTermMinPvs; 623 624 /// minimal number of rays for axis aligned split625 int mTermMinRaysForAxisAligned;626 /// minimal number of objects for axis aligned split627 int mTermMinObjectsForAxisAligned;628 622 /// maximal contribution per ray 629 623 float mTermMaxRayContribution; 630 624 /// minimal accumulated ray length 631 625 float mTermMinAccRayLength; 626 627 //-- termination criteria for axis aligned split 628 629 /// minimal number of rays for axis aligned split 630 int mTermMinRaysForAxisAligned; 631 // max ray contribution 632 float mTermMaxRayContriForAxisAligned; 632 633 633 634 /// strategy to get the best split plane … … 684 685 685 686 MergeQueue mMergeQueue; 687 686 688 /// if rays should be used to collect merge candidates 687 689 bool mUseRaysForMerge; 690 688 691 /// maximal allowed pvs so that view cell is valid 689 692 int mMaxPvs; … … 695 698 bool mShowInvalidSpace; 696 699 700 int mCurrentViewCellsId; 701 702 /// maximal tree memory 703 float mMaxMemory; 704 705 bool mOutOfMemory; 697 706 private: 698 707
Note: See TracChangeset
for help on using the changeset viewer.