source: GTP/trunk/App/Demos/Vis/CHC_revisited/OcclusionQuery.h @ 2753

Revision 2753, 1.2 KB checked in by mattausch, 17 years ago (diff)
Line 
1#ifndef _OcclusionQuery_H__
2#define _OcclusionQuery_H__
3
4#include <vector>
5#include "common.h"
6
7
8namespace CHCDemo
9{
10
11class BvhNode;
12
13/** This class is an implementation for single node queries and multiqueries.
14        @remark the class encapsulates hardware occlusion query calls.
15*/
16class OcclusionQuery
17{
18public:
19       
20        OcclusionQuery();
21
22        virtual ~OcclusionQuery();
23
24        virtual bool ResultAvailable() const;
25       
26        virtual unsigned int GetQueryResult() const;
27       
28        virtual void BeginQuery();
29       
30        virtual void EndQuery();
31       
32        unsigned int GetQueryId() const;
33        /** Returns the first added node.
34        */
35        inline BvhNode *GetFrontNode() const { return mNodes[0]; }
36        /** Reset the contents of this query.
37        */
38        inline void Reset() { mNodes.clear(); }
39        /** Adds a node to the query.
40        */
41        inline void AddNode(BvhNode *node) { mNodes.push_back(node); }
42
43
44protected:
45
46        OcclusionQuery(unsigned int id);
47       
48       
49        ////////////
50        //-- members
51
52        float mPFail;
53        /// all nodes that are tested with the same query
54        BvhNodeContainer mNodes;
55        // the query associated with this test
56        unsigned int mQueryId;
57        /// type of the query
58        bool mIsVisibleQuery;
59};
60
61} // namespace
62#endif // OcclusionQuery_H
Note: See TracBrowser for help on using the repository browser.