Changeset 1006 for GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
- Timestamp:
- 06/09/06 01:26:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r1004 r1006 158 158 struct VspBspSplitCandidate 159 159 { 160 /// the current node160 /// the current split plane 161 161 Plane3 mSplitPlane; 162 162 /// split axis of this plane (0, 1, 2, or 3 if non-axis-aligned) … … 467 467 @param plane returns the split plane 468 468 @param leaf the leaf to be split 469 @param polys the polygon list on which the split decition is based 470 @param rays ray container on which selection may be based 469 @param data the traversal data holding the polygons and rays which the split decision is based 470 @param frontData the front node traversal data (which may be updated to avoid repcomputations 471 @param backData the front node traversal data (which may be updated to avoid repcomputations 472 @param splitAxis 0 - 2 if axis aligned split, 3 if polygon-aligned split 473 471 474 @note the polygons can be reordered in the process 475 472 476 @returns true if the cost of the split is under maxCostRatio 473 477 … … 567 571 float &position); 568 572 569 /** Selects an axis aligned split plane.570 @Returns true if split is valied571 */572 bool SelectAxisAlignedPlane(Plane3 &plane, const PolygonContainer &polys) const;573 574 573 /** Subdivides the rays into front and back rays according to the split plane. 575 574 … … 649 648 int &contributingSamples); 650 649 651 652 653 654 655 650 656 651 /** Take 3 ray endpoints, where two are minimum and one a maximum … … 701 696 /** Returns estimated memory usage of tree. 702 697 */ 698 float GetMemUsage() const; 703 699 //float GetMemUsage(const VspBspTraversalQueue &tstack) const; 704 float GetMemUsage() const; 705 706 707 700 701 702 703 /////////////////////////////////////////////////////////// 704 protected: 705 708 706 /// Pointer to the root of the tree 709 707 BspNode *mRoot; 710 708 709 /// the pointer to the view cells manager 710 ViewCellsManager *mViewCellsManager; 711 712 /// View cell corresponding to the space outside the valid view space 713 BspViewCell *mOutOfBoundsCell; 714 715 /// the bsp tree statistics 711 716 BspTreeStatistics mBspStats; 712 717 713 /// Strategies for choosing next split plane. 714 enum {NO_STRATEGY = 0, 715 RANDOM_POLYGON = 1, 716 AXIS_ALIGNED = 2, 717 LEAST_RAY_SPLITS = 256, 718 BALANCED_RAYS = 512, 719 PVS = 1024 720 }; 718 /// sorted split candidates used for sweep-heuristics 719 vector<SortableEntry> *mSplitCandidates; 721 720 722 721 /// box around the whole view domain 723 722 AxisAlignedBox3 mBox; 724 723 725 bool mUseCostHeuristics; 724 725 //-- termination critera 726 726 727 727 /// minimal number of rays before subdivision termination … … 737 737 /// minimal accumulated ray length 738 738 float mTermMinAccRayLength; 739 740 //HACK 741 int mTermMinPolygons; 739 /// maximal acceptable cost ratio 740 float mTermMaxCostRatio; 741 /// tolerance value indicating how often the max cost ratio can be failed 742 int mTermMissTolerance; 743 744 745 //-- termination criteria for 746 //-- hybrid stategy where only axis aligned split are used until 747 //-- a certain point and then also polygon aligned split are taken 748 749 /// minimal number of rays where axis aligned split is taken 750 int mTermMinRaysForAxisAligned; 751 /// max ray contribution 752 float mTermMaxRayContriForAxisAligned; 753 /// weight for heuristics evaluation 754 float mAxisAlignedCtDivCi; 755 /// spezifies the split border of the axis aligned split 756 float mAxisAlignedSplitBorder; 757 758 759 //-- global terminatino criteria 742 760 743 761 float mTermMinGlobalCostRatio; 744 762 int mTermGlobalCostMissTolerance; 745 746 763 int mGlobalCostMisses; 747 764 748 bool mUseSplitCostQueue; 749 //-- termination criteria for axis aligned split 750 751 /// minimal number of rays for axis aligned split 752 int mTermMinRaysForAxisAligned; 753 // max ray contribution 754 float mTermMaxRayContriForAxisAligned; 755 756 /// strategy to get the best split plane 757 int mSplitPlaneStrategy; 765 /// maximal number of view cells 766 int mMaxViewCells; 767 /// maximal tree memory 768 float mMaxMemory; 769 /// the tree is out of memory 770 bool mOutOfMemory; 771 772 758 773 /// number of candidates evaluated for the next split plane 759 774 int mMaxPolyCandidates; 760 775 /// number of candidates for split planes evaluated using the rays 761 776 int mMaxRayCandidates; 777 778 779 780 //-- axis aligned split criteria 781 782 /// if only driving axis should be used for choosing the axis-aligned split 783 bool mOnlyDrivingAxis; 784 /// if heuristics should be used to place the split plane of an axis-aligned split 785 bool mUseCostHeuristics; 786 /// if driving axis should taken if max cost is exceeded for 787 /// all evaluated axis aligned split plane candidates 788 bool mUseDrivingAxisIfMaxCostViolated; 789 /// minimal relative position where the split axis can be placed 790 float mMinBand; 791 /// maximal relative position where the split axis can be placed 792 float mMaxBand; 762 793 /// balancing factor for PVS criterium 763 794 float mCtDivCi; 764 765 bool mUseDrivingAxisForMaxCost; 766 //-- axis aligned split criteria 767 float mAxisAlignedCtDivCi; 768 /// spezifies the split border of the axis aligned split 769 float mAxisAlignedSplitBorder; 770 771 /// maximal acceptable cost ratio 772 float mTermMaxCostRatio; 773 /// tolerance value indicating how often the max cost ratio can be failed 774 int mTermMissTolerance; 795 /// if random split axis should be used 796 bool mUseRandomAxis; 797 /// if vsp bsp tree should simulate octree 798 bool mCirculatingAxis; 799 800 801 802 /// priority queue strategy 803 enum {BREATH_FIRST, DEPTH_FIRST, COST_BASED}; 804 /// if we should use breath first priority for the splits 805 int mNodePriorityQueueType; 806 /// if split cost queue should be used to compute next best split 807 bool mUseSplitCostQueue; 808 809 810 811 /// Strategies for choosing next split plane. 812 enum {NO_STRATEGY = 0, 813 RANDOM_POLYGON = 1, 814 AXIS_ALIGNED = 2, 815 LEAST_RAY_SPLITS = 256, 816 BALANCED_RAYS = 512, 817 PVS = 1024 818 }; 819 820 /// strategy to get the best split plane 821 int mSplitPlaneStrategy; 775 822 776 823 //-- factors guiding the split plane heuristics 824 777 825 float mLeastRaySplitsFactor; 778 826 float mBalancedRaysFactor; 779 827 float mPvsFactor; 828 780 829 781 830 /// if area or volume should be used for PVS heuristics … … 787 836 /// normalizes different bsp split plane criteria 788 837 float mCostNormalizer; 789 /// maximal number of view cells790 int mMaxViewCells;791 792 ofstream mSubdivisionStats;793 794 838 // if rays should be stored in leaves 795 839 bool mStoreRays; 796 797 /// if only driving axis should be used for split 798 bool mOnlyDrivingAxis; 799 800 ViewCellsManager *mViewCellsManager; 801 802 vector<SortableEntry> *mSplitCandidates; 803 804 840 /// render cost weight between expected value and variance 805 841 float mRenderCostWeight; 806 /// View cell corresponding to the space outside the valid view space 807 BspViewCell *mOutOfBoundsCell; 808 809 /// maximal tree memory 810 float mMaxMemory; 811 /// the tree is out of memory 812 bool mOutOfMemory; 813 842 843 844 //-- subdivision statistics 845 846 /// subdivision stats output file 847 ofstream mSubdivisionStats; 814 848 float mTotalCost; 815 849 int mTotalPvsSize; 816 850 817 float mMinBand; 818 float mMaxBand; 819 820 //int mSplits; 821 /// subdivision stats output file 822 ofstream mSubdivsionStats; 823 /// if random split axis should be used 824 bool mUseRandomAxis; 851 825 852 /// use polygon split whenever there are polys left 826 853 bool mUsePolygonSplitIfAvailable; … … 829 856 /// number of currenly generated view cells 830 857 int mCreatedViewCells; 831 /// if vsp bsp tree should simulate octree 832 bool mCirculatingAxis; 833 834 /// if we should use breath first priority for the splits 835 int mNodePriorityQueueType; 836 837 bool mEmptyViewCellsMergeAllowed; 838 839 // priority queue strategy 840 enum {BREATH_FIRST, DEPTH_FIRST, COST_BASED}; 858 859 841 860 private: 842 861
Note: See TracChangeset
for help on using the changeset viewer.