source: trunk/VUT/GtpVisibility/include/VisibilityInfo.h @ 143

Revision 143, 2.0 KB checked in by mattausch, 20 years ago (diff)

updated visibility queries

Line 
1#ifndef _VisibilityInfo_H__
2#define _VisibilityInfo_H__
3
4#include <vector>
5
6#include "VisibilityMesh.h"
7#include "HierarchyInterface.h"
8
9namespace GtpVisibility {
10 
11/** Class storing the visibility information of a scene node.
12*/
13class NodeInfo
14{
15public:
16    NodeInfo(HierarchyNode *node, const int projectedPixels, const int visiblePixels):
17        mNode(node)//, mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels)
18        {}
19
20        int GetVisiblePixels() const {return mVisiblePixels;}
21        int GetProjectedPixels() const {return mProjectedPixels;}
22
23        void SetVisiblePixels(int vis) {mVisiblePixels = vis;}
24        void SetProjectedPixels(int vis) {mProjectedPixels = vis;}
25
26        void SetNode(HierarchyNode *node) {mNode = node;}
27        HierarchyNode *GetNode() const {return mNode;}
28
29        //bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;}
30
31protected:
32
33    /** pointer to the scene node */
34    HierarchyNode *mNode;
35   
36    int mVisiblePixels;
37        int mProjectedPixels;
38};
39 
40/** Class storing the visibility information of a mesh.
41*/
42class MeshInfo
43{
44public:
45        MeshInfo(Mesh *mesh,  const int projectedPixels, const int visiblePixels):
46        mMesh(mesh), mProjectedPixels(projectedPixels), mVisiblePixels(visiblePixels)
47        {}
48
49        int GetVisiblePixels() const {return mVisiblePixels;}
50        int GetProjectedPixels() const {return mProjectedPixels;}
51
52        void SetVisiblePixels(float vis) { mVisiblePixels = vis;}
53        void SetProjectedPixels(float vis) { mProjectedPixels = vis;}
54
55        Mesh *GetMesh() const {return mMesh;}
56        void SetMesh(Mesh *mesh) {mMesh = mesh;}
57
58        bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;}
59        //bool operator>(const MeshInfo& rhs) const {return mMesh > rhs.mMesh;}
60        //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;}
61       
62protected:
63
64    /** Pointer to the mesh.
65        */
66    Mesh *mMesh;
67 
68    int mVisiblePixels;
69        int mProjectedPixels;
70};
71 
72//TODO: this define shall be replaced by template typedef
73#define InfoContainer std::vector
74//#define InfoContainer std::set
75};
76
77
78#endif
Note: See TracBrowser for help on using the repository browser.