Changeset 587 for trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
- Timestamp:
- 02/04/06 12:46:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r575 r587 19 19 class Ray; 20 20 class ViewCellsStatistics; 21 class ViewCellsManager; 22 23 21 24 22 25 class BspNodeGeometry … … 374 377 /// rays piercing this node 375 378 BoundedRayContainer *mRays; 376 /// areaof current node377 float m Area;379 /// probability of current node 380 float mProbability; 378 381 /// geometry of node as induced by planes 379 382 BspNodeGeometry *mGeometry; … … 397 400 mRays(NULL), 398 401 mPvs(0), 399 m Area(0.0),402 mProbability(0.0), 400 403 mGeometry(NULL) 401 404 {} … … 407 410 BoundedRayContainer *rays, 408 411 int pvs, 409 float area,412 float p, 410 413 BspNodeGeometry *cell): 411 414 mNode(node), … … 415 418 mRays(rays), 416 419 mPvs(pvs), 417 m Area(area),420 mProbability(p), 418 421 mGeometry(cell) 419 422 {} 423 424 425 float GetCost() const 426 { 427 #if 0 428 return mPvs * mProbability; 429 #endif 430 #if 1 431 return mProbability; 432 #endif 433 #if 0 434 return (float)mPvs; 435 #endif 436 #if 0 437 return (float)mRays->size(); 438 #endif 439 } 440 441 friend bool operator<(const BspTraversalData &a, const BspTraversalData &b) 442 { 443 return a.GetCost() < b.GetCost(); 444 } 420 445 }; 421 446 422 typedef std::stack<BspTraversalData> BspTraversalStack; 423 447 //typedef std::stack<BspTraversalData> BspTraversalStack; 448 typedef std::priority_queue<BspTraversalData> BspTraversalStack; 449 424 450 /** Default constructor reading the environment file and 425 451 creating an empty tree. … … 451 477 452 478 void Construct(const ObjectContainer &objects, 453 const RayContainer &sampleRays); 479 const RayContainer &sampleRays, 480 AxisAlignedBox3 *forcedBoundingBox); 454 481 455 482 /** Constructs the tree from a given set of rays. … … 458 485 created in the leafs and stored in the conatainer 459 486 */ 460 void Construct(const RayContainer &sampleRays); 487 void Construct(const RayContainer &sampleRays, 488 AxisAlignedBox3 *forcedBoundingBox); 461 489 462 490 /** Returns list of BSP leaves. … … 513 541 /** Construct geometry of view cell. 514 542 */ 515 void ConstructGeometry(BspViewCell *vc, BspNodeGeometry &geom) const; 543 void ConstructGeometry(ViewCell *vc, BspNodeGeometry &geom) const; 544 545 546 /** Sets pointer to view cells manager. 547 */ 548 void SetViewCellsManager(ViewCellsManager *vcm); 516 549 517 550 /** Returns random leaf of BSP tree. … … 533 566 float GetEpsilon() const; 534 567 568 int CollectMergeCandidates(const vector<BspLeaf *> leaves, 569 vector<MergeCandidate> &candidates); 570 571 int CollectMergeCandidates(const VssRayContainer &rays, 572 vector<MergeCandidate> &candidates); 535 573 protected: 536 574 … … 608 646 const BoundedRayContainer &rays, 609 647 const int pvs, 610 const float area,648 const float probability, 611 649 const BspNodeGeometry &cell) const; 612 650 … … 681 719 int AddToPolygonSoup(const ObjectContainer &objects, 682 720 PolygonContainer &polys, 683 int maxObjects = 0); 721 int maxObjects = 0, 722 bool addToBbox = true); 684 723 685 724 /** Extracts the meshes of the view cells and and adds them to polygons. … … 809 848 int &sampleContributions, 810 849 int &contributingSamples); 850 851 852 811 853 812 854 /// Pointer to the root of the tree. … … 847 889 int mTermMaxDepth; 848 890 /// mininum area 849 float mTermMin Area;891 float mTermMinProbability; 850 892 /// mininum PVS 851 893 int mTermMinPvs; … … 893 935 bool mUseAreaForPvs; 894 936 937 int mMaxViewCells; 938 895 939 /// epsilon where two points are still considered equal 896 940 float mEpsilon; 941 942 ViewCellsManager *mViewCellsManager; 943 897 944 898 945 private:
Note: See TracChangeset
for help on using the changeset viewer.