Changeset 1357 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
- Timestamp:
- 09/13/06 17:15:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r1345 r1357 35 35 class VspTree; 36 36 class ViewCellsContainer; 37 //class BvhSubdivisionCandidate;38 37 39 38 … … 149 148 /** The bounding box specifies the node extent. 150 149 */ 150 inline 151 151 AxisAlignedBox3 GetBoundingBox() const 152 152 { return mBoundingBox; } 153 153 154 154 155 inline 155 156 void SetBoundingBox(const AxisAlignedBox3 &boundingBox) 156 157 { mBoundingBox = boundingBox; } … … 298 299 mMaxCostMisses(0), 299 300 mAxis(0) 300 //mObjectsStart(0),301 //mObjectsEnd(0)302 {}301 { 302 mSortedObjects[0] = mSortedObjects[1] = mSortedObjects[2] = NULL; 303 } 303 304 304 305 BvhTraversalData(BvhLeaf *node, … … 312 313 mMaxCostMisses(0), 313 314 mAxis(0) 314 //mObjectsStart(0) 315 //mObjectsEnd(0) 316 {} 317 318 /// deletes contents and sets them to NULL 315 { 316 mSortedObjects[0] = mSortedObjects[1] = mSortedObjects[2] = NULL; 317 } 318 319 /** Deletes contents and sets them to NULL. 320 */ 319 321 void Clear() 320 322 { 321 323 DEL_PTR(mNode); 324 /*DEL_PTR(mSortedObjects[0]); 325 DEL_PTR(mSortedObjects[1]); 326 DEL_PTR(mSortedObjects[2]);*/ 322 327 } 323 328 … … 334 339 /// current axis 335 340 int mAxis; 336 /// start of objects 337 SortableEntryContainer::const_iterator mObjectsStart; 338 /// end of objects 339 SortableEntryContainer::const_iterator mObjectsEnd; 341 /// the sorted objects for the three dimensions 342 ObjectContainer *mSortedObjects[3]; 340 343 }; 341 344 342 /** Candidate for a view space split. 345 346 /** Candidate for a object space split. 343 347 */ 344 348 class BvhSubdivisionCandidate: public SubdivisionCandidate … … 618 622 619 623 620 /** Sortssplit candidates for cost heuristics using axis aligned splits.624 /** Prepare split candidates for cost heuristics using axis aligned splits. 621 625 @param node the current node 622 626 @param axis the current split axis 623 627 */ 624 static void SortSubdivisionCandidates( 625 const ObjectContainer &objects, 626 vector<SortableEntry> **subdivisionCandidates, 628 void PrepareLocalSubdivisionCandidates( 629 const BvhTraversalData &tData, 627 630 const int axis); 628 631 629 /** Computes best cost for axis aligned planes. 632 static void CreateLocalSubdivisionCandidates( 633 const ObjectContainer &objects, 634 SortableEntryContainer **subdivisionCandidates, 635 const bool sort, 636 const int axis); 637 638 /** Computes object partition with the best cost according to the heurisics. 639 @param tData the traversal data 640 @param axis the split axis 641 @param objectsFront the objects in the front child bv 642 @param objectsBack the objects in the back child bv 643 @param backObjectsStart the iterator marking the position where the back objects begin 644 645 @returns relative cost (relative to parent cost) 630 646 */ 631 647 float EvalLocalCostHeuristics( … … 633 649 const int axis, 634 650 ObjectContainer &objectsFront, 635 ObjectContainer &objects FBack);651 ObjectContainer &objectsBack); 636 652 637 653 /** Evaluates the contribution to the front and back volume … … 708 724 float EvalViewCellsVolume(const ObjectContainer &objects) const; 709 725 726 void CreateInitialSortedObjectList(BvhTraversalData &tData); 727 728 void AssignSortedObjects( 729 const BvhSubdivisionCandidate &sc, 730 BvhTraversalData &frontData, 731 BvhTraversalData &backData); 732 710 733 711 734 protected: … … 735 758 736 759 737 //-- local termination 760 //////////////////////////////// 761 //-- local termination criteria 738 762 739 763 /// maximal possible depth … … 751 775 752 776 753 //-- global criteria 777 //////////////////////////////////// 778 //-- global termination criteria 754 779 755 780 float mTermMinGlobalCostRatio; … … 765 790 766 791 792 //////////////////////////////////////// 767 793 //-- split heuristics based parameters 768 794 … … 772 798 /// if only driving axis should be used for split 773 799 bool mOnlyDrivingAxis; 774 775 800 /// current time stamp (used for keeping split history) 776 801 int mTimeStamp; 777 802 // if rays should be stored in leaves 778 803 bool mStoreRays; 779 780 /// epsilon for geometric comparisons 781 float mEpsilon; 782 783 /// subdivision stats output file 804 // subdivision stats output file 784 805 ofstream mSubdivisionStats; 785 806 /// keeps track of cost during subdivision … … 789 810 /// number of currenly generated view cells 790 811 int mCreatedLeaves; 791 792 812 /// represents min and max band for sweep 793 813 float mSplitBorder; 794 795 814 /// weight between render cost decrease and node render cost 796 815 float mRenderCostDecreaseWeight; 797 798 816 /// stores the kd node intersectables used for pvs 799 817 BvhIntersectableMap mBvhIntersectables; 800 818 819 bool mUseGlobalSorting; 801 820 }; 802 821
Note: See TracChangeset
for help on using the changeset viewer.