#ifndef _CullingManager_H__ #define _CullingManager_H__ #include "HierarchyInterface.h" namespace GtpVisibility { /** This abstract class implements an interface for a specific culling algorithm. The algorithm is either used to render a scene or to make a visibility query. */ class CullingManager { public: /** Default constructor. @remark an appropriate hierarchy interface must be provided for the algorithms to work on specific hierarchy */ CullingManager(); /** Renders the scene using a specific occlusion culling algorithm, e.g., coherent hierarchical culling or stop and wait. */ virtual void RenderScene() = 0; /** Sets the hierarchy interface. @param hierarchyInterface @remark the hierarchy interface encapsulates the hierarchy we are working on */ void SetHierarchyInterface(HierarchyInterface *hierarchyInterface); /** Sets the threshold for the visibiliy culling algorithm. @param visibilityThreshold number of visible pixels where an object is still considered invisible. */ void SetVisibilityThreshold(unsigned int visibilityThreshold); /** Returns number of frustum culled nodes. */ unsigned int GetNumFrustumCulledNodes(); /** Returns number of occlusion query culled nodes. */ unsigned int GetNumQueryCulledNodes(); /** Returns number of issued occlusion queries. */ unsigned int GetNumQueriesIssued(); /** basic initializations on beginning of each frame, e.g., resets statistics. */ void InitFrame(bool visualizeCulledNodes); /** Some visualization of culled nodes are shown, depending on the type of hierarchy. @param visualizeCulledNodes if true, culled nodes are visualized */ void SetVisualizeCulledNodes(bool visualizeCulledNodes); protected: unsigned int mNumQueryCulledNodes; unsigned int mNumFrustumCulledNodes; unsigned int mVisibilityThreshold; unsigned int mNumQueriesIssued; HierarchyInterface *mHierarchyInterface; bool mVisualizeCulledNodes; }; } // namespace GtpVisibility #endif // CullingManager