Changeset 1099 for GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
- Timestamp:
- 07/07/06 16:14:33 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
r1097 r1099 10 10 #include "RayInfo.h" 11 11 #include "gzstream.h" 12 #include " mixkit/MxHeap.h"12 #include "FlexibleHeap.h" 13 13 14 14 … … 48 48 /** Candidate for a view space / object space split. 49 49 */ 50 class SplitCandidate: public MxHeapable50 class SplitCandidate: public Heapable 51 51 { 52 52 public: … … 62 62 63 63 /// priority of this split 64 float mPriority; 65 66 /// pointers used for building up heap 67 SplitCandidate *mParent; 68 SplitCandidate *mLeft; 69 SplitCandidate *mRight; 70 71 SplitCandidate(): mPriority(0) 64 //float mPriority; 65 66 SplitCandidate() 72 67 {}; 73 68 … … 75 70 {} 76 71 72 virtual void EvalPriority() = 0; 77 73 virtual int Type() const = 0; 78 79 /** Returns cost of the traversal data.80 */81 float GetPriority() const82 {83 return mPriority;84 }85 86 /*friend bool operator<(const SplitCandidate &a, const SplitCandidate &b)87 {88 return a.GetPriority() < b.GetPriority();89 }*/90 74 }; 91 75 … … 462 446 463 447 448 #if 0 464 449 typedef std::priority_queue<SplitCandidate *, 465 450 std::vector<SplitCandidate *>, 466 451 GtPriority<std::vector<SplitCandidate *>::value_type> > SplitQueue; 467 468 #if TODO469 /** candidate for a view space split470 */471 class OspSplitCandidate: public SplitCandidate472 {473 /// parent data474 OspTraversalData mParentData;475 476 VspOspSplitCandidate(): mRenderCost(0)477 {};478 479 int Type() const { return OSP_CANDIDATE; }480 481 VspOspSplitCandidate(const AxisAlignedPlane &plane, const VspOspTraversalData &tData):482 mSplitPlane(plane), mParentData(tData), mRenderCost(0)483 {}484 };485 452 #endif 453 454 typedef FlexibleHeap<SplitCandidate *> SplitQueue; 486 455 487 456 /** View Space Partitioning tree. … … 588 557 { 589 558 public: 559 static VspTree* sVspTree; 590 560 /// parent data 591 561 VspTraversalData mParentData; 592 562 593 VspSplitCandidate( )563 VspSplitCandidate(const VspTraversalData &tData): mParentData(tData) 594 564 {}; 595 565 596 566 int Type() const { return VIEW_SPACE; } 567 568 void EvalPriority() 569 { 570 sVspTree->EvalSplitCandidate(*this); 571 } 597 572 598 573 VspSplitCandidate(const AxisAlignedPlane &plane, const VspTraversalData &tData): … … 796 771 /** Evaluates candidate for splitting. 797 772 */ 798 void EvalSplitCandidate(Vsp TraversalData &tData, VspSplitCandidate &splitData);773 void EvalSplitCandidate(VspSplitCandidate &splitData); 799 774 800 775 /** Evaluates render cost decrease of next split. … … 1206 1181 { 1207 1182 public: 1183 static OspTree* sOspTree; 1184 1208 1185 /// parent data 1209 1186 OspTraversalData mParentData; 1210 1187 1211 OspSplitCandidate( )1188 OspSplitCandidate(const OspTraversalData &tData): mParentData(tData) 1212 1189 {}; 1213 1190 1214 1191 int Type() const { return VIEW_SPACE; } 1192 1193 void EvalPriority() 1194 { 1195 sOspTree->EvalSplitCandidate(*this); 1196 } 1215 1197 1216 1198 OspSplitCandidate(const AxisAlignedPlane &plane, const OspTraversalData &tData): … … 1376 1358 /** Evaluates candidate for splitting. 1377 1359 */ 1378 void EvalSplitCandidate(Osp TraversalData &tData, OspSplitCandidate &splitData);1360 void EvalSplitCandidate(OspSplitCandidate &splitData); 1379 1361 1380 1362 /** Computes priority of the traversal data and stores it in tData. … … 1706 1688 SplitCandidate *NextSplitCandidate(); 1707 1689 1708 void RepairQueue( );1690 void RepairQueue(const vector<SplitCandidate *> &dirtyList); 1709 1691 1710 1692 AxisAlignedBox3 mBoundingBox;
Note: See TracChangeset
for help on using the changeset viewer.