- Timestamp:
- 05/02/06 18:08:04 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj
r863 r879 333 333 </File> 334 334 <File 335 RelativePath="..\src\RenderSampler.cpp"> 336 </File> 337 <File 338 RelativePath="..\src\RenderSampler.h"> 339 </File> 340 <File 335 341 RelativePath="..\src\RenderSimulator.cpp"> 336 342 </File> -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r878 r879 2686 2686 2687 2687 2688 ViewCell *BspViewCellsManager::GetViewCell(const Vector3 &point ) const2688 ViewCell *BspViewCellsManager::GetViewCell(const Vector3 &point, const bool active) const 2689 2689 { 2690 2690 if (!mBspTree) … … 4648 4648 4649 4649 4650 ViewCell *VspBspViewCellsManager::GetViewCell(const Vector3 &point ) const4650 ViewCell *VspBspViewCellsManager::GetViewCell(const Vector3 &point, const bool active) const 4651 4651 { 4652 4652 if (!mVspBspTree) … … 4656 4656 return NULL; 4657 4657 4658 return mVspBspTree->GetViewCell(point );4658 return mVspBspTree->GetViewCell(point, active); 4659 4659 } 4660 4660 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r871 r879 236 236 237 237 /** Get a viewcell containing the specified point 238 */ 239 virtual ViewCell *GetViewCell(const Vector3 &point) const = 0; 238 @param active if the active or elementary view cell should be returned. 239 */ 240 virtual ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const = 0; 240 241 241 242 virtual void PrintPvsStatistics(ostream &s); … … 667 668 668 669 669 /** Get a viewcell containing the specified point */ 670 ViewCell *GetViewCell(const Vector3 &point) const; 670 /** Get a viewcell containing the specified point 671 */ 672 ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 671 673 672 674 void CreateMesh(ViewCell *vc); … … 749 751 */ 750 752 // virtual void PrintStatistics(ostream &s) const; 751 ViewCell *GetViewCell(const Vector3 &point ) const { return NULL; }753 ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const { return NULL; } 752 754 753 755 float GetProbability(ViewCell *viewCell); … … 817 819 ViewCellContainer &viewcells); 818 820 819 ViewCell *GetViewCell(const Vector3 &point ) const { return NULL; }821 ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const { return NULL; } 820 822 821 823 float GetProbability(ViewCell *viewCell); … … 881 883 float GetProbability(ViewCell *viewCell); 882 884 883 ViewCell *GetViewCell(const Vector3 &point ) const;885 ViewCell *GetViewCell(const Vector3 &point, const bool active = false) const; 884 886 885 887 bool GetViewPoint(Vector3 &viewPoint) const; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r870 r879 3747 3747 3748 3748 3749 ViewCell *VspBspTree::GetViewCell(const Vector3 &point) 3750 { 3751 if (mRoot == NULL) 3752 return NULL; 3749 ViewCell *VspBspTree::GetViewCell(const Vector3 &point, const bool active) 3750 { 3751 if (mRoot == NULL) 3752 return NULL; 3753 3754 stack<BspNode *> nodeStack; 3755 nodeStack.push(mRoot); 3753 3756 3754 stack<BspNode *> nodeStack; 3755 nodeStack.push(mRoot); 3757 ViewCell *viewcell = NULL; 3756 3758 3757 ViewCell *viewcell = NULL; 3759 while (!nodeStack.empty()) 3760 { 3761 BspNode *node = nodeStack.top(); 3762 nodeStack.pop(); 3763 3764 if (node->IsLeaf()) 3765 { 3766 viewcell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 3767 break; 3768 } 3769 else 3770 { 3771 BspInterior *interior = dynamic_cast<BspInterior *>(node); 3772 3773 // random decision 3774 if (interior->GetPlane().Side(point) < 0) 3775 nodeStack.push(interior->GetBack()); 3776 else 3777 nodeStack.push(interior->GetFront()); 3778 } 3779 } 3758 3780 3759 while (!nodeStack.empty()) { 3760 BspNode *node = nodeStack.top(); 3761 nodeStack.pop(); 3762 3763 if (node->IsLeaf()) { 3764 viewcell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 3765 break; 3766 } else { 3767 3768 BspInterior *interior = dynamic_cast<BspInterior *>(node); 3769 3770 // random decision 3771 if (interior->GetPlane().Side(point) < 0) 3772 nodeStack.push(interior->GetBack()); 3773 else 3774 nodeStack.push(interior->GetFront()); 3775 } 3776 } 3777 3778 return viewcell; 3781 if (active) 3782 return mViewCellsTree->GetActiveViewCell(viewcell); 3783 else 3784 return viewcell; 3779 3785 } 3780 3786 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r870 r879 306 306 307 307 /** Returns view cell the current point is located in. 308 */ 309 ViewCell *GetViewCell(const Vector3 &point); 308 @param point the current view point 309 @param active if currently active view cells should be returned or 310 elementary view cell 311 */ 312 ViewCell *GetViewCell(const Vector3 &point, const bool active = false); 310 313 311 314
Note: See TracChangeset
for help on using the changeset viewer.