Changeset 2124 for GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.h
- Timestamp:
- 02/19/07 02:51:22 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.h
r2116 r2124 8 8 #include "AxisAlignedBox3.h" 9 9 #include "Ray.h" 10 //#include "ObjectPvs.h"11 //#include "Viewcell.h"12 //#include "VssRay.h"13 //#include "IntersectableWrapper.h"14 10 15 11 … … 25 21 class TraversalTree; 26 22 27 // TraversalTree *SceneTraversalTree;28 23 29 24 // -------------------------------------------------------------- … … 55 50 // max number of rays per node 56 51 int maxObjectRefs; 52 // max number of rays per node 53 int totalObjectRefs; 57 54 // number of dynamically added ray refs 58 55 int addedRayRefs; … … 83 80 minCostNodes = 0; 84 81 maxObjectRefs = 0; 82 totalObjectRefs = 0; 85 83 addedRayRefs = removedRayRefs = 0; 86 84 } … … 121 119 } 122 120 123 /** Parent of the node - the parent is a little overhead for maintanance of the tree, 124 but allows various optimizations of tree traversal algorithms 121 /** Parent of the node - the parent is a little overhead for 122 maintanance of the tree, but allows various optimizations 123 of tree traversal algorithms 125 124 */ 126 125 TraversalInterior *mParent; … … 217 216 218 217 // pointers to view cells contained in this node 219 ObjectContainer mObjects;218 ViewCellContainer mViewCells; 220 219 221 220 short mDepth; … … 237 236 float mPriority; 238 237 239 TraversalData() {}238 TraversalData(): mNode(NULL), mPriority(0), mDepth(0) {} 240 239 241 240 TraversalData(TraversalNode *n, const float p): 242 mNode(n), mPriority(p) 241 mNode(n), mPriority(p), mDepth(0) 243 242 {} 244 243 245 244 TraversalData(TraversalNode *n, 246 const AxisAlignedBox3 &b, 247 const int d): 248 mNode(n), mBox(b), mDepth(d) {} 245 const AxisAlignedBox3 &b, 246 const int d): 247 mNode(n), mBox(b), mDepth(d) 248 {} 249 249 250 250 … … 255 255 256 256 return 257 leafa->m Objects.size() * mBox.SurfaceArea()257 leafa->mViewCells.size() * mBox.SurfaceArea() 258 258 < 259 leafb->m Objects.size() * b.mBox.SurfaceArea();259 leafb->mViewCells.size() * b.mBox.SurfaceArea(); 260 260 } 261 261 262 262 263 264 263 // comparator for the 264 struct less_priority: public 265 265 binary_function<const TraversalData, const TraversalData, bool> 266 { 267 bool operator()(const TraversalData a, const TraversalData b) 266 268 { 267 bool operator()(const TraversalData a, const TraversalData b) 268 { 269 return a.mPriority < b.mPriority; 270 } 271 }; 269 return a.mPriority < b.mPriority; 270 } 271 }; 272 272 }; 273 273 … … 292 292 const bool useMailboxing); 293 293 294 virtual bool Construct( );294 virtual bool Construct(const ViewCellContainer &viewCells); 295 295 296 296 /** Check whether subdivision criteria are met for the given subtree. 297 297 If not subdivide the leafs of the subtree. The criteria are specified in 298 298 the environment as well as the subdivision method. By default surface area 299 299 heuristics is used. 300 300 … … 372 372 {} 373 373 374 bool operator<(const SortableEntry &b) const374 /*bool operator<(const SortableEntry &b) const 375 375 { 376 // view cells usually adjacent 377 if (EpsilonEqual(value, b.value, 0.001)) 378 return (type == BOX_MAX); 379 376 380 return value < b.value; 377 } 381 }*/ 378 382 }; 379 383 380 384 inline static bool iltS(SortableEntry *a, SortableEntry *b) 381 385 { 386 // view cells usually adjacent 387 //if (EpsilonEqual(a->value, b->value)) 388 // return false; 389 // return (a->type == SortableEntry::BOX_MAX); 390 382 391 return a->value < b->value; 383 392 } … … 409 418 float &position); 410 419 420 int FindViewCellIntersections(const Vector3 &lStart, 421 const Vector3 &lEnd, 422 const ViewCellContainer &viewCells, 423 ViewCellContainer &hitViewCells, 424 const bool useMailboxing); 411 425 412 426 ////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.