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

Revision 141, 1.8 KB checked in by mattausch, 19 years ago (diff)

fixed visibility queries using occlusion queries
fixed visualization

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 float v): mNode(node), mVisibility(v) {}
17
18        float GetVisibility() const {return mVisibility;}
19        void SetVisibility(float vis) { mVisibility = vis;}
20        bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;}
21        //bool operator>(const NodeInfo& rhs) const {return mNode > rhs.mNode;}
22        //bool operator==(const NodeInfo& rhs) const {return mNode == rhs.mNode;}
23
24protected:
25
26    /** pointer to the scene node */
27    HierarchyNode *mNode;
28    /** node visibility can either be a number of visible pixels or relative
29        number of visible pixels (if the hardware queries will provide the
30        total number of ratsterized pixels */
31    float mVisibility;
32};
33 
34/** Class storing the visibility information of a mesh.
35*/
36class MeshInfo
37{
38public:
39        MeshInfo(Mesh *mesh, const float v): mMesh(mesh), mVisibility(v) {}
40
41        float GetVisibility() const {return mVisibility;}
42        void SetVisibility(float vis) { mVisibility = vis;}
43
44        bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;}
45        //bool operator>(const MeshInfo& rhs) const {return mMesh > rhs.mMesh;}
46        //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;}
47       
48protected:
49
50    /** Pointer to the mesh.
51        */
52    Mesh *mMesh;
53    /** Node visibility can either be a number of visible pixels or relative
54        number of visible pixels (if the hardware queries will provide the
55        total number of ratsterized pixels.
56        */
57    float mVisibility;
58};
59 
60//TODO: this define shall be replaced by template typedef
61//#define InfoContainer std::vector
62#define InfoContainer std::set
63};
64
65
66#endif
Note: See TracBrowser for help on using the repository browser.