Changeset 145 for trunk/VUT/GtpVisibility
- Timestamp:
- 06/22/05 10:05:06 (20 years ago)
- Location:
- trunk/VUT/GtpVisibility
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/VisibilityInfo.h
r144 r145 9 9 namespace GtpVisibility { 10 10 11 /** Class storing the visibility information of a scene node.11 /** Class storing visibility information. 12 12 */ 13 class NodeInfo13 class VisibilityInfo 14 14 { 15 15 public: 16 NodeInfo(HierarchyNode *node, const int projectedPixels, const int visiblePixels): 17 mNode(node)//, mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels) 18 {} 16 VisibilityInfo(const int visiblePixels, const int projectedPixels); 19 17 20 int GetVisiblePixels() const {return mVisiblePixels;}21 int GetProjectedPixels() const {return mProjectedPixels;}18 int GetVisiblePixels() const; 19 int GetProjectedPixels() const; 22 20 23 void SetVisiblePixels(int vis) {mVisiblePixels = vis;} 24 void SetProjectedPixels(int vis) {mProjectedPixels = vis;} 21 void SetVisiblePixels(int vis); 22 void SetProjectedPixels(int vis); 23 24 /** Computes ratio of visible to projected pixels. */ 25 float ComputeRelativeVisibility(); 25 26 26 void SetNode(HierarchyNode *node) {mNode = node;} 27 HierarchyNode *GetNode() const {return mNode;} 27 /** Adds visibility to current visibility information. 28 */ 29 void AddVisibility(const VisibilityInfo &info); 28 30 29 float ComputeRelativeVisibility() { float result = mVisiblePixels; if (mProjectedPixels) result /= (float)mProjectedPixels; return result;} 31 32 protected: 33 /** number of visible pixels. */ 34 int mVisiblePixels; 35 /** number of projected pixels */ 36 int mProjectedPixels; 37 }; 38 /** Class storing the visibility information of a hierarchy node. 39 */ 40 class NodeInfo: public VisibilityInfo 41 { 42 public: 43 NodeInfo(HierarchyNode *node, const int visiblePixels, const int projectedPixels); 44 45 void SetNode(HierarchyNode *node); 46 HierarchyNode *GetNode() const; 30 47 //bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;} 31 48 32 49 protected: 33 50 34 /** pointer to the scene node */ 51 /** Pointer to the hierarchy nnode. 52 */ 35 53 HierarchyNode *mNode; 36 37 int mVisiblePixels;38 int mProjectedPixels;39 54 }; 40 55 41 56 /** Class storing the visibility information of a mesh. 42 57 */ 43 class MeshInfo 58 class MeshInfo: public VisibilityInfo 44 59 { 45 60 public: 46 MeshInfo(Mesh *mesh, const int projectedPixels, const int visiblePixels): 47 mMesh(mesh), mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels) 48 {} 61 MeshInfo(Mesh *mesh, const int visiblePixels, const int projectedPixels); 49 62 50 int GetVisiblePixels() const {return mVisiblePixels;}51 int GetProjectedPixels() const {return mProjectedPixels;}63 Mesh *GetMesh() const; 64 void SetMesh(Mesh *mesh); 52 65 53 void SetVisiblePixels(float vis) { mVisiblePixels = vis;} 54 void SetProjectedPixels(float vis) { mProjectedPixels = vis;} 55 56 Mesh *GetMesh() const {return mMesh;} 57 void SetMesh(Mesh *mesh) {mMesh = mesh;} 58 59 bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;} 60 //bool operator>(const MeshInfo& rhs) const {return mMesh > rhs.mMesh;} 66 //bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;} 61 67 //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;} 62 68 … … 66 72 */ 67 73 Mesh *mMesh; 68 69 int mVisiblePixels;70 int mProjectedPixels;71 74 }; 72 75
Note: See TracChangeset
for help on using the changeset viewer.