source: branches/VUT/DummyModules/GtpVisibility/src/VisibilityManager.cpp @ 65

Revision 65, 1.7 KB checked in by bittner, 20 years ago (diff)

Merged headers and sources for dummy modules. Added GtpVisibilityPreprocessor?

Line 
1#include "VisibilityManager.h"
2#include "StopAndWaitCullingManager.h"
3#include "CoherentHierarchicalCullingManager.h"
4#include "FrustumCullingManager.h"
5#include "DummyPreprocessingManager.h"
6#include "DummyQueryManager.h"
7
8namespace GtpVisibility {
9
10VisibilityManager::VisibilityManager(VisibilityEnvironment *visEnvironment)
11{
12        mVisibilityEnvironment = visEnvironment;
13        //mVisibilityManagerType = VisibilityEnvironment::STOP_AND_WAIT;
14        //mVisibilityManager = new StopAndWaitCullingManager(NULL);
15        mCullingManagerType = VisibilityEnvironment::FRUSTUM_CULLING;
16        mCullingManager = new FrustumCullingManager(0);
17
18        mQueryManager = new DummyQueryManager(0);
19        mPreprocessingManager = new DummyPreprocessingManager(0);
20
21}
22
23VisibilityManager::~VisibilityManager()
24{
25        delete mCullingManager;
26}
27
28void VisibilityManager::SetCullingManager(VisibilityEnvironment::CullingManagerType ocmType)
29{
30        if (mCullingManagerType != ocmType)
31        {
32                mCullingManagerType = ocmType;
33                delete mCullingManager;
34
35                switch (ocmType)
36                {
37                case VisibilityEnvironment::STOP_AND_WAIT:
38                        mCullingManager = new StopAndWaitCullingManager(NULL);
39                        break;
40
41                case VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING:
42                        mCullingManager = new CoherentHierarchicalCullingManager(NULL);
43                        break;
44
45                case VisibilityEnvironment::FRUSTUM_CULLING:
46                        mCullingManager = new FrustumCullingManager(NULL);
47                        break;
48                default:
49                        mCullingManager = new StopAndWaitCullingManager(NULL);
50                        break;
51                }
52        }
53}
54
55CullingManager *VisibilityManager::GetCullingManager()
56{
57        return mCullingManager;
58}
59
60void VisibilityManager::ApplyVisibilityCulling()
61{
62        mCullingManager->RenderScene();
63}
64
65} // namespace GtpVisibility
Note: See TracBrowser for help on using the repository browser.