source: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/VisibilityManager.h @ 2455

Revision 2455, 3.4 KB checked in by mattausch, 17 years ago (diff)
Line 
1#ifndef _VisibilityManager_H__
2#define _VisibilityManager_H__
3
4#include "CullingManager.h"
5#include "VisibilityEnvironment.h"
6
7
8/** This namespace includes all classes which are created by the VUT (Vienna University
9        of Technology for the Visibility module of the GTP (GameTools Project) (www.gametools.org),
10        and are not directly derived from an Ogre class.
11*/
12namespace GtpVisibility {
13
14  class QueryManager;
15  class PreprocessingManager;
16 
17/** This class manages all forms of visibility. It is the main
18        class of our visibility module and manages online occlusion culling,
19        offline culling, and visibility queries.
20*/
21class VisibilityManager
22{
23public:
24        /** Constructor taking the visibility environment object as parameter
25                @param visEnvironment the visibility environment
26        */
27        VisibilityManager(VisibilityEnvironment *visEnvironment);
28       
29        ~VisibilityManager();
30        /** Sets the current online occlusion culling manager, e.g.,
31                the stop and wait algorithm or coherent hierarchical culling.
32                @param ocmType the online occlusion culling manager type
33        */
34        void SetCullingManager(VisibilityEnvironment::CullingManagerType ocmType);
35        /** Returns the current online occlusion culling manager.
36        */
37        CullingManager *GetCullingManager();
38        /** Returns the current online occlusion culling manager type. See set
39        */
40        VisibilityEnvironment::CullingManagerType GetCullingManagerType();
41
42        /** Applies the online visibility culling algorithm on a scene.
43                @remark the algorithm depends on the current culling manager.
44        */
45        void ApplyVisibilityCulling();
46
47        /** Sets the threshold for the visibiliy culling algorithm.
48                @param threshold number of visible pixels where an object
49                is still considered invisible.
50                @remark automatically sets the threshold of the current and of
51                new culling managers to this value.
52        */
53        void SetVisibilityCullingThreshold(unsigned int threshold);
54
55        /** Indicates for how long a frame is considered to be visible.
56                @param assumedVisibility estimation for how long visibility is assumed to be valid.
57                @remark this option is only valid for the coherent hierarchical culling algorithm
58        */
59        void SetAssumedVisibilityForChc(unsigned int assumedVisibility);
60        /** Random candidates per subtree for random update manager.
61                @note these options should rather be given by general parameter system using void *
62                and strings.
63        */
64        void SetRandomUpdateCandidatesForRuc(unsigned int randomCandidatesForRuc);
65        /** See get
66        */
67        unsigned int GetAssumedVisibilityForChc();
68        /* See get
69        */
70        unsigned int GetRandomUpdateCandidatesForRuc();
71        /** Sets pointer to a query manager.
72        */
73        void SetQueryManager(QueryManager *queryManager);
74        /** see set
75        */
76        QueryManager *GetQueryManager();
77
78        void SetTestGeometryForVisibleLeaves(bool testGeometryForLeaves);
79        bool GetTestGeometryForVisibleLeaves();
80
81        /** Returns the visibility environment.
82        */
83        VisibilityEnvironment *GetVisibilityEnvironment();
84
85
86protected:
87       
88        CullingManager *mCullingManager;
89        QueryManager *mQueryManager;
90
91        PreprocessingManager *mPreprocessingManager;
92        VisibilityEnvironment *mVisibilityEnvironment;
93        VisibilityEnvironment::CullingManagerType mCullingManagerType;
94
95        unsigned int mVisibilityThreshold;
96        unsigned int mAssumedVisibilityForChc;
97        unsigned int mRandomCandidatesForRuc;
98
99        bool mTestGeometryForVisibleLeaves;
100};
101
102} // namespace GtpVisibility
103
104#endif // VisibilityManager
Note: See TracBrowser for help on using the repository browser.