Changeset 316 for trunk/VUT/GtpVisibility
- Timestamp:
- 10/10/05 15:23:32 (19 years ago)
- Location:
- trunk/VUT/GtpVisibility
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/DistanceQueue.h
r87 r316 17 17 a greater distance has a lower priority in the queue. 18 18 */ 19 template <typename T> class G reaterDistance19 template <typename T> class GtDistance 20 20 { 21 21 public: 22 G reaterDistance(HierarchyInterface *hierarchyInterface): mHierarchyInterface(hierarchyInterface)22 GtDistance(HierarchyInterface *hierarchyInterface): mHierarchyInterface(hierarchyInterface) 23 23 {} 24 24 … … 34 34 /** A priority queue where closer hierarchy nodes are given a higher priority. 35 35 */ 36 typedef std::priority_queue<HierarchyNode *, std::vector<HierarchyNode *>, G reaterDistance<std::vector<HierarchyNode *>::value_type> > DistanceQueue;36 typedef std::priority_queue<HierarchyNode *, std::vector<HierarchyNode *>, GtDistance<std::vector<HierarchyNode *>::value_type> > DistanceQueue; 37 37 38 38 } // namespace GtpVisibility -
trunk/VUT/GtpVisibility/include/DummyPreprocessingManager.h
r65 r316 52 52 */ 53 53 virtual int AddViewCellPVS(const int cellID, 54 InfoContainer<NodeInfo>*visibleNodes,55 InfoContainer<MeshInfo> *visibleMeshes);54 NodeInfoContainer *visibleNodes, 55 MeshInfoContainer *visibleMeshes); 56 56 57 57 }; -
trunk/VUT/GtpVisibility/include/DummyQueryManager.h
r174 r316 23 23 virtual void 24 24 ComputeCameraVisibility(const Camera &camera, 25 InfoContainer<NodeInfo>*visibleNodes,26 InfoContainer<MeshInfo>*visibleGeometry,27 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,25 NodeInfoContainer *visibleNodes, 26 MeshInfoContainer *visibleGeometry, 27 PatchInfoContainer *visiblePatches, 28 28 bool relativeVisibility = false ); 29 29 … … 33 33 virtual void 34 34 ComputeFromPointVisibility(const Vector3 &point, 35 InfoContainer<NodeInfo>*visibleNodes,36 InfoContainer<MeshInfo>*visibleGeometry,37 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,35 NodeInfoContainer *visibleNodes, 36 MeshInfoContainer *visibleGeometry, 37 PatchInfoContainer *visiblePatches, 38 38 bool relativeVisibility = false 39 39 ); -
trunk/VUT/GtpVisibility/include/PreprocessingManager.h
r113 r316 82 82 virtual bool GetPVS(const Vector3 &point, 83 83 const float radius, 84 InfoContainer<NodeInfo>*visibleNodes,85 InfoContainer<MeshInfo> *visibleMeshes);84 NodeInfoContainer *visibleNodes, 85 MeshInfoContainer *visibleMeshes); 86 86 87 87 … … 125 125 */ 126 126 virtual int AddViewCellPVS(const int cellID, 127 InfoContainer<NodeInfo>*visibleNodes,128 InfoContainer<MeshInfo>*visibleMeshes ) = 0;127 NodeInfoContainer *visibleNodes, 128 MeshInfoContainer *visibleMeshes ) = 0; 129 129 130 130 HierarchyInterface *mSceneTraverser; -
trunk/VUT/GtpVisibility/include/QueryManager.h
r174 r316 49 49 virtual void 50 50 ComputeCameraVisibility(const Camera &camera, 51 InfoContainer<NodeInfo>*visibleNodes,52 InfoContainer<MeshInfo>*visibleGeometry,53 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,51 NodeInfoContainer *visibleNodes, 52 MeshInfoContainer *visibleGeometry, 53 PatchInfoContainer *visiblePatches, 54 54 bool relativeVisibility = false 55 55 ) = 0; … … 61 61 virtual void 62 62 ComputeFromPointVisibility(const Vector3 &point, 63 InfoContainer<NodeInfo>*visibleNodes,64 InfoContainer<MeshInfo>*visibleGeometry,65 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,63 NodeInfoContainer *visibleNodes, 64 MeshInfoContainer *visibleGeometry, 65 PatchInfoContainer *visiblePatches, 66 66 bool relativeVisibility = false 67 67 ) = 0; -
trunk/VUT/GtpVisibility/include/VisibilityInfo.h
r159 r316 8 8 9 9 namespace GtpVisibility { 10 10 11 11 /** Class storing visibility information. 12 12 */ 13 template<typename T> 13 14 class VisibilityInfo 14 15 { 15 16 public: 16 VisibilityInfo(const int visiblePixels, const int projectedPixels); 17 VisibilityInfo(T source, const int visiblePixels, const int projectedPixels); 18 19 /** set source of the info. 20 */ 21 void SetSource(T source); 22 /** get source of the info. 23 */ 24 T GetSource() const; 17 25 18 26 int GetVisiblePixels() const; … … 27 35 /** Adds visibility to current visibility information. 28 36 */ 29 void AddVisibility(const VisibilityInfo &info);37 void AddVisibility(const VisibilityInfo<T> &info); 30 38 /** Adds visibility to current visibility information. 31 39 */ 32 void AddVisibility(const int visiblePixels, const int vrojectedPixels);40 void AddVisibility(const int visiblePixels, const int projectedPixels); 33 41 34 42 protected: … … 39 47 */ 40 48 int mProjectedPixels; 41 };42 /** Class storing the visibility information of a hierarchy node.43 */44 class NodeInfo: public VisibilityInfo45 {46 public:47 NodeInfo(HierarchyNode *node, const int visiblePixels, const int projectedPixels);48 49 49 void SetNode(HierarchyNode *node); 50 HierarchyNode *GetNode() const; 51 //bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;} 52 53 protected: 54 55 /** Pointer to the hierarchy nnode. 56 */ 57 HierarchyNode *mNode; 58 }; 59 60 /** Class storing the visibility information of a mesh. 61 */ 62 class MeshInfo: public VisibilityInfo 63 { 64 public: 65 MeshInfo(Mesh *mesh, const int visiblePixels, const int projectedPixels); 66 67 Mesh *GetMesh() const; 68 void SetMesh(Mesh *mesh); 69 70 //bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;} 71 //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;} 72 73 protected: 74 75 /** Pointer to the mesh. 76 */ 77 Mesh *mMesh; 50 T mSource; 78 51 }; 79 52 80 /** Class storing the visibility information of a patch, i.e., parts of meshes having the same material 81 properties. 82 */ 83 class PatchInfo: public VisibilityInfo 53 //----------------------------------------------------------------------- 54 template <typename T> 55 T VisibilityInfo<T>::GetSource() const 84 56 { 85 public: 86 PatchInfo(Patch *Patch, const int visiblePixels, const int projectedPixels); 57 return mSource; 58 } 87 59 88 Patch *GetPatch() const; 89 void SetPatch(Patch *patch); 90 91 protected: 60 //----------------------------------------------------------------------- 61 template <typename T> 62 void VisibilityInfo<T>::SetSource(T source) 63 { 64 return mSource; 65 } 92 66 93 /** Pointer to the patch. 94 */ 95 Patch *mPatch; 67 //----------------------------------------------------------------------- 68 template <typename T> 69 VisibilityInfo<T>::VisibilityInfo(T source, const int visiblePixels, const int projectedPixels): 70 mSource(source), mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels) 71 { 72 } 73 74 //----------------------------------------------------------------------- 75 template <typename T> 76 int VisibilityInfo<T>::GetVisiblePixels() const 77 { 78 return mVisiblePixels; 79 } 80 //----------------------------------------------------------------------- 81 template <typename T> 82 int VisibilityInfo<T>::GetProjectedPixels() const 83 { 84 return mProjectedPixels; 85 } 86 //----------------------------------------------------------------------- 87 template <typename T> 88 void VisibilityInfo<T>::SetVisiblePixels(int vis) 89 { 90 mVisiblePixels = vis; 91 } 92 //----------------------------------------------------------------------- 93 template <typename T> 94 void VisibilityInfo<T>::SetProjectedPixels(int vis) 95 { 96 mProjectedPixels = vis; 97 } 98 //----------------------------------------------------------------------- 99 template <typename T> 100 float VisibilityInfo<T>::ComputeRelativeVisibility() 101 { 102 if (!mProjectedPixels) 103 return 0; 104 105 return (float)mVisiblePixels / (float)mProjectedPixels; 106 } 107 //----------------------------------------------------------------------- 108 template <typename T> 109 void VisibilityInfo<T>::AddVisibility(const VisibilityInfo<T> &info) 110 { 111 mVisiblePixels += info.GetVisiblePixels(); 112 mProjectedPixels += info.GetProjectedPixels(); 113 } 114 115 //----------------------------------------------------------------------- 116 template <typename T> 117 void VisibilityInfo<T>::AddVisibility(const int visiblePixels, const int projectedPixels) 118 { 119 mVisiblePixels += visiblePixels; 120 mProjectedPixels += projectedPixels; 121 } 122 123 typedef VisibilityInfo<Patch *> PatchInfo; 124 typedef VisibilityInfo<Mesh *> MeshInfo; 125 typedef VisibilityInfo<HierarchyNode *> NodeInfo; 126 127 128 template<class T> 129 struct InfoContainer 130 { 131 typedef std::vector<VisibilityInfo<T> > Type; 96 132 }; 97 133 98 //TODO: this define shall be replaced by template typedef 99 #define InfoContainer std::vector 100 //#define InfoContainer std::set 101 }; 134 typedef std::vector<PatchInfo> PatchInfoContainer; 135 typedef std::vector<MeshInfo> MeshInfoContainer; 136 typedef std::vector<NodeInfo> NodeInfoContainer; 102 137 138 } // namespace GtpVisibility 103 139 104 140 #endif -
trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj
r144 r316 112 112 </File> 113 113 <File 114 RelativePath="..\src\DummyQueryManager.cpp">115 </File>116 <File117 114 RelativePath="..\src\FrustumCullingManager.cpp"> 118 115 </File> … … 133 130 </File> 134 131 <File 135 RelativePath="..\src\VisibilityInfo.cpp">136 </File>137 <File138 132 RelativePath="..\src\VisibilityManager.cpp"> 139 133 </File> … … 151 145 <File 152 146 RelativePath="..\include\DistanceQueue.h"> 147 </File> 148 <File 149 RelativePath="..\include\DummyPreprocessingManager.h"> 153 150 </File> 154 151 <File -
trunk/VUT/GtpVisibility/src/DummyPreprocessingManager.cpp
r74 r316 40 40 */ 41 41 int DummyPreprocessingManager::AddViewCellPVS(const int cellID, 42 InfoContainer<NodeInfo>*visibleNodes,43 InfoContainer<MeshInfo>*visibleMeshes )42 NodeInfoContainer *visibleNodes, 43 MeshInfoContainer *visibleMeshes ) 44 44 { 45 45 // return the root of the hierarchyInterface regardless of the cellId -
trunk/VUT/GtpVisibility/src/DummyQueryManager.cpp
r159 r316 9 9 void 10 10 DummyQueryManager::ComputeCameraVisibility(const Camera &camera, 11 InfoContainer<NodeInfo>*visibleNodes,12 InfoContainer<MeshInfo>*visibleGeometry,13 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,11 NodeInfoContainer *visibleNodes, 12 MeshInfoContainer *visibleGeometry, 13 PatchInfoContainer *visiblePatches, 14 14 bool relativeVisibility) 15 15 { 16 visibleNodes-> push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0));16 visibleNodes->Type.push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0)); 17 17 18 18 // HierarchyInterface::MeshIterator *mi = … … 28 28 void 29 29 DummyQueryManager::ComputeFromPointVisibility(const Vector3 &point, 30 InfoContainer<NodeInfo>*visibleNodes,31 InfoContainer<MeshInfo>*visibleGeometry,32 InfoContainer<GtpVisibility::PatchInfo>*visiblePatches,30 NodeInfoContainer *visibleNodes, 31 MeshInfoContainer *visibleGeometry, 32 PatchInfoContainer *visiblePatches, 33 33 bool relativeVisibility) 34 34 { 35 visibleNodes-> push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0));35 visibleNodes->Type.push_back(NodeInfo(mHierarchyInterface->GetHierarchyRoot(), 0, 0)); 36 36 37 37 // HierarchyInterface::MeshIterator *mi = -
trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp
r174 r316 10 10 mSavedNode(NULL), mCurrentTestIdx(0), mTestGeometryForVisibleLeaves(false) 11 11 { 12 mDistanceQueue = new DistanceQueue(G reaterDistance<HierarchyNode *>(this));12 mDistanceQueue = new DistanceQueue(GtDistance<HierarchyNode *>(this)); 13 13 } 14 14 //----------------------------------------------------------------------- -
trunk/VUT/GtpVisibility/src/PreprocessingManager.cpp
r71 r316 13 13 bool PreprocessingManager::GetPVS(const Vector3 ¢er, 14 14 const float radius, 15 InfoContainer<NodeInfo>*visibleNodes,16 InfoContainer<MeshInfo>*visibleMeshes)15 NodeInfoContainer *visibleNodes, 16 MeshInfoContainer *visibleMeshes) 17 17 { 18 18 vector<int> viewCellIds;
Note: See TracChangeset
for help on using the changeset viewer.