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

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

fixed bug when canceling login
fixed visibility queries using occlusion 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 visibility information.
12*/
13class VisibilityInfo
14{
15public:
16        VisibilityInfo(const int visiblePixels, const int projectedPixels);
17
18        int GetVisiblePixels() const;
19        int GetProjectedPixels() const;
20
21        void SetVisiblePixels(int vis);
22        void SetProjectedPixels(int vis);
23       
24        /** Computes ratio of visible to projected pixels. */
25        float ComputeRelativeVisibility();
26
27        /** Adds visibility to current visibility information.
28        */
29        void AddVisibility(const VisibilityInfo &info);
30
31
32protected:
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*/
40class NodeInfo: public VisibilityInfo
41{
42public:
43    NodeInfo(HierarchyNode *node, const int visiblePixels, const int projectedPixels);
44
45        void SetNode(HierarchyNode *node);
46        HierarchyNode *GetNode() const;
47        //bool operator<(const NodeInfo& rhs) const {return mNode < rhs.mNode;}
48
49protected:
50
51    /** Pointer to the hierarchy nnode.
52        */
53    HierarchyNode *mNode;
54};
55 
56/** Class storing the visibility information of a mesh.
57*/
58class MeshInfo: public VisibilityInfo
59{
60public:
61        MeshInfo(Mesh *mesh, const int visiblePixels, const int projectedPixels);
62
63        Mesh *GetMesh() const;
64        void SetMesh(Mesh *mesh);
65
66        //bool operator<(const MeshInfo& rhs) const {return mMesh < rhs.mMesh;}
67        //bool operator==(const MeshInfo& rhs) const {return mMesh == rhs.mMesh;}
68       
69protected:
70
71    /** Pointer to the mesh.
72        */
73    Mesh *mMesh;
74};
75 
76//TODO: this define shall be replaced by template typedef
77#define InfoContainer std::vector
78//#define InfoContainer std::set
79};
80
81
82#endif
Note: See TracBrowser for help on using the repository browser.