Changeset 882 for GTP/trunk/Lib
- Timestamp:
- 05/03/06 10:28:20 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp
r863 r882 34 34 35 35 // pvs penalty can be different from pvs size 36 inline float EvalPvsPenalty(const int pvs,37 const int lower,38 const int upper)36 inline static float EvalPvsPenalty(const int pvs, 37 const int lower, 38 const int upper) 39 39 { 40 40 // clamp to minmax values … … 2646 2646 if (!onlyValid || node->TreeValid()) 2647 2647 { 2648 ViewCell *leafVc = dynamic_cast<BspLeaf *>(node)->GetViewCell();2648 ViewCellLeaf *leafVc = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 2649 2649 2650 2650 ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leafVc); -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r878 r882 629 629 int KdTree::CastLineSegment(const Vector3 &origin, 630 630 const Vector3 &termination, 631 vector<ViewCell *>&viewcells)631 ViewCellContainer &viewcells) 632 632 { 633 633 int hits = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r881 r882 30 30 int ViewCell::sMailId = 21843194198; 31 31 int ViewCell::sReservedMailboxes = 1; 32 int ViewCell::sLastUpdated = 0; 32 33 33 34 34 //int upperPvsLimit = 120; … … 39 39 40 40 // pvs penalty can be different from pvs size 41 inline static float EvalPvsPenalty(const int pvs, const int lower, const int upper) 41 inline static float EvalPvsPenalty(const int pvs, 42 const int lower, 43 const int upper) 42 44 { 43 45 // clamp to minmax values -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r873 r882 178 178 179 179 180 BspLeaf::BspLeaf(ViewCell *viewCell):180 BspLeaf::BspLeaf(ViewCellLeaf *viewCell): 181 181 mViewCell(viewCell) 182 182 { … … 190 190 191 191 192 BspLeaf::BspLeaf(BspInterior *parent, ViewCell *viewCell):192 BspLeaf::BspLeaf(BspInterior *parent, ViewCellLeaf *viewCell): 193 193 BspNode(parent), mViewCell(viewCell), mPvs(NULL) 194 194 { 195 195 } 196 196 197 ViewCell *BspLeaf::GetViewCell() const197 ViewCellLeaf *BspLeaf::GetViewCell() const 198 198 { 199 199 return mViewCell; 200 200 } 201 201 202 void BspLeaf::SetViewCell(ViewCell *viewCell)202 void BspLeaf::SetViewCell(ViewCellLeaf *viewCell) 203 203 { 204 204 mViewCell = viewCell; … … 482 482 483 483 484 void BspTree::InsertViewCell(ViewCell *viewCell)484 void BspTree::InsertViewCell(ViewCellLeaf *viewCell) 485 485 { 486 486 PolygonContainer *polys = new PolygonContainer(); … … 540 540 541 541 // extract view cells associated with the split polygons 542 ViewCell *frontViewCell = GetOrCreateOutOfBoundsCell();543 ViewCell *backViewCell = GetOrCreateOutOfBoundsCell();542 ViewCellLeaf *frontViewCell = GetOrCreateOutOfBoundsCell(); 543 ViewCellLeaf *backViewCell = GetOrCreateOutOfBoundsCell(); 544 544 545 545 BspTraversalData frontData(interior->GetFront(), … … 1097 1097 if (DotProd((*it)->GetNormal(), splitPlane.mNormal) > 0) 1098 1098 { 1099 backData.mViewCell = dynamic_cast<ViewCell *>((*it)->mParent);1099 backData.mViewCell = dynamic_cast<ViewCellLeaf *>((*it)->mParent); 1100 1100 foundBack = true; 1101 1101 } 1102 1102 else 1103 1103 { 1104 frontData.mViewCell = dynamic_cast<ViewCell *>((*it)->mParent);1104 frontData.mViewCell = dynamic_cast<ViewCellLeaf *>((*it)->mParent); 1105 1105 foundFront = true; 1106 1106 } … … 2082 2082 int BspTree::CastLineSegment(const Vector3 &origin, 2083 2083 const Vector3 &termination, 2084 vector<ViewCell *>&viewcells)2084 ViewCellContainer &viewcells) 2085 2085 { 2086 2086 int hits = 0; … … 2197 2197 if (node->IsLeaf()) 2198 2198 { 2199 ViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->mViewCell;2199 ViewCellLeaf *viewCell = dynamic_cast<BspLeaf *>(node)->mViewCell; 2200 2200 2201 2201 if (!viewCell->Mailed()) … … 2629 2629 BoundedRayContainer::const_iterator it, it_end = rays.end(); 2630 2630 2631 ViewCell *vc = leaf->GetViewCell();2631 ViewCellLeaf *vc = leaf->GetViewCell(); 2632 2632 2633 2633 // add contributions from samples to the PVS … … 3273 3273 nodeStack.push(mRoot); 3274 3274 3275 ViewCell *viewcell = NULL;3275 ViewCellLeaf *viewcell = NULL; 3276 3276 3277 3277 while (!nodeStack.empty()) { -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
r881 r882 12 12 namespace GtpVisibilityPreprocessor { 13 13 14 class ViewCell ;14 class ViewCellLeaf; 15 15 //class BspViewCell; 16 16 class Plane3; … … 23 23 class ViewCellsManager; 24 24 class ViewCellsTree; 25 class ViewCell; 25 26 class ViewCellLeaf; 26 27 … … 374 375 public: 375 376 BspLeaf(); 376 BspLeaf(ViewCell *viewCell);377 BspLeaf(ViewCellLeaf *viewCell); 377 378 BspLeaf(BspInterior *parent); 378 BspLeaf(BspInterior *parent, ViewCell *viewCell);379 BspLeaf(BspInterior *parent, ViewCellLeaf *viewCell); 379 380 380 381 ~BspLeaf(); … … 386 387 /** Returns pointer of view cell. 387 388 */ 388 ViewCell *GetViewCell() const;389 ViewCellLeaf *GetViewCell() const; 389 390 390 391 /** Sets pointer to view cell. 391 392 */ 392 void SetViewCell(ViewCell *viewCell);393 void SetViewCell(ViewCellLeaf *viewCell); 393 394 394 395 /// Rays piercing this leaf. … … 404 405 405 406 /// if NULL this does not correspond to feasible viewcell 406 ViewCell *mViewCell;407 ViewCellLeaf *mViewCell; 407 408 }; 408 409 … … 426 427 int mDepth; 427 428 /// the view cell associated with this subdivsion 428 ViewCell *mViewCell;429 ViewCellLeaf *mViewCell; 429 430 /// rays piercing this node 430 431 BoundedRayContainer *mRays; … … 459 460 PolygonContainer *polys, 460 461 const int depth, 461 ViewCell *viewCell,462 ViewCellLeaf *viewCell, 462 463 BoundedRayContainer *rays, 463 464 int pvs, … … 598 599 /** Construct geometry of view cell. 599 600 */ 600 void ConstructGeometry(ViewCell *vc, BspNodeGeometry &geom) const;601 void ConstructGeometry(ViewCell* vc, BspNodeGeometry &geom) const; 601 602 602 603 … … 721 722 (i.e., possibly more than one leaf). 722 723 */ 723 void InsertViewCell(ViewCell *viewCell);724 void InsertViewCell(ViewCellLeaf *viewCell); 724 725 /** Inserts polygons down the tree. The polygons are filtered until a leaf is reached, 725 726 then further subdivided. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r881 r882 1872 1872 void ViewCellsManager::SetViewCellsActive() 1873 1873 { 1874 ++ ViewCell::sLastUpdated;1875 1874 // collect leaf view cells and set the pointers to the currently 1875 // active view cells 1876 1876 ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 1877 1877 for (it = mViewCells.begin(); it != it_end; ++ it) -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r879 r882 34 34 35 35 // pvs penalty can be different from pvs size 36 inline float EvalPvsPenalty(const int pvs,37 const int lower,38 const int upper)36 inline static float EvalPvsPenalty(const int pvs, 37 const int lower, 38 const int upper) 39 39 { 40 40 // clamp to minmax values … … 269 269 270 270 int VspBspTree::AddToPolygonSoup(const ViewCellContainer &viewCells, 271 272 271 PolygonContainer &polys, 272 int maxObjects) 273 273 { 274 274 int limit = (maxObjects > 0) ? … … 1147 1147 RayInfoContainer::const_iterator it, it_end = rays.end(); 1148 1148 1149 ViewCell *vc = leaf->GetViewCell();1149 ViewCellLeaf *vc = leaf->GetViewCell(); 1150 1150 1151 1151 // add contributions from samples to the PVS … … 2589 2589 if (!onlyValid || node->TreeValid()) 2590 2590 { 2591 ViewCell *leafVc = dynamic_cast<BspLeaf *>(node)->GetViewCell();2591 ViewCellLeaf *leafVc = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 2592 2592 2593 2593 ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leafVc); … … 3260 3260 int VspBspTree::CastLineSegment(const Vector3 &origin, 3261 3261 const Vector3 &termination, 3262 vector<ViewCell *>&viewcells)3262 ViewCellContainer &viewcells) 3263 3263 { 3264 3264 int hits = 0; … … 3755 3755 nodeStack.push(mRoot); 3756 3756 3757 ViewCell *viewcell = NULL;3757 ViewCellLeaf *viewcell = NULL; 3758 3758 3759 3759 while (!nodeStack.empty()) -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r879 r882 13 13 namespace GtpVisibilityPreprocessor { 14 14 15 class ViewCell ;15 class ViewCellLeaf; 16 16 //class BspViewCell; 17 17 class Plane3; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp
r863 r882 2069 2069 int VspKdTree::CastLineSegment(const Vector3 &origin, 2070 2070 const Vector3 &termination, 2071 vector<ViewCell *>&viewcells)2071 ViewCellContainer &viewcells) 2072 2072 { 2073 2073 int hits = 0;
Note: See TracChangeset
for help on using the changeset viewer.