[59] | 1 | #ifndef _CullingManager_H__
|
---|
| 2 | #define _CullingManager_H__
|
---|
| 3 |
|
---|
| 4 | #include "HierarchyInterface.h"
|
---|
| 5 |
|
---|
| 6 | namespace GtpVisibility {
|
---|
| 7 |
|
---|
| 8 | /** This abstract class implements an interface for a specific culling
|
---|
| 9 | algorithm. The algorithm is either used to render a scene or to make a visibility query.
|
---|
| 10 | */
|
---|
| 11 | class CullingManager
|
---|
| 12 | {
|
---|
| 13 | public:
|
---|
[74] | 14 | /** Default constructor.
|
---|
| 15 | @remark an appropriate hierarchy interface must be provided for the algorithms to
|
---|
| 16 | work on specific hierarchy
|
---|
[59] | 17 | */
|
---|
[74] | 18 | CullingManager();
|
---|
[59] | 19 | /** Renders the scene using a specific occlusion culling algorithm, e.g., coherent
|
---|
| 20 | hierarchical culling or stop and wait.
|
---|
| 21 | */
|
---|
| 22 | virtual void RenderScene() = 0;
|
---|
| 23 | /** Sets the hierarchy interface.
|
---|
| 24 | @param hierarchyInterface
|
---|
| 25 | @remark the hierarchy interface encapsulates the hierarchy we are working on
|
---|
| 26 | */
|
---|
| 27 | void SetHierarchyInterface(HierarchyInterface *hierarchyInterface);
|
---|
[74] | 28 | /** Sets the threshold for the visibiliy culling algorithm.
|
---|
| 29 | @param visibilityThreshold number of visible pixels where an object
|
---|
| 30 | is still considered invisible.
|
---|
| 31 | */
|
---|
| 32 | void SetVisibilityThreshold(unsigned int visibilityThreshold);
|
---|
[59] | 33 |
|
---|
[74] | 34 | /** Returns number of frustum culled nodes.
|
---|
| 35 | */
|
---|
| 36 | unsigned int GetNumFrustumCulledNodes();
|
---|
| 37 | /** Returns number of occlusion query culled nodes.
|
---|
| 38 | */
|
---|
| 39 | unsigned int GetNumQueryCulledNodes();
|
---|
| 40 |
|
---|
[59] | 41 | protected:
|
---|
| 42 |
|
---|
| 43 | unsigned int mNumQueryCulledNodes;
|
---|
| 44 | unsigned int mNumFrustumCulledNodes;
|
---|
[74] | 45 | unsigned int mVisibilityThreshold;
|
---|
[59] | 46 |
|
---|
| 47 | HierarchyInterface *mHierarchyInterface;
|
---|
| 48 | };
|
---|
| 49 | } // namespace GtpVisibility
|
---|
| 50 | #endif // CullingManager |
---|