source: trunk/VUT/GtpVisibility/src/VisibilityManager.cpp @ 74

Revision 74, 2.3 KB checked in by mattausch, 20 years ago (diff)

added support for release mode

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):
11mVisibilityThreshold(0)
12{
13        mVisibilityEnvironment = visEnvironment;
14       
15        mCullingManagerType = VisibilityEnvironment::STOP_AND_WAIT_CULLING;
16        mCullingManager = new StopAndWaitCullingManager();
17
18        mQueryManager = new DummyQueryManager(0);
19        mPreprocessingManager = new DummyPreprocessingManager(0);
20}
21//-----------------------------------------------------------------------
22VisibilityManager::~VisibilityManager()
23{
24        delete mCullingManager;
25}
26//-----------------------------------------------------------------------
27void VisibilityManager::SetCullingManager(
28        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_CULLING:
38                        mCullingManager = new StopAndWaitCullingManager();
39                        break;
40
41                case VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING:
42                        mCullingManager = new CoherentHierarchicalCullingManager();
43                        break;
44
45                case VisibilityEnvironment::FRUSTUM_CULLING:
46                        mCullingManager = new FrustumCullingManager();
47                        break;
48                default:
49                        mCullingManager = new StopAndWaitCullingManager();
50                        break;
51                }
52        }
53}
54//-----------------------------------------------------------------------
55void VisibilityManager::SetVisibilityCullingThreshold(unsigned int visibilityThreshold)
56{
57        mVisibilityThreshold = visibilityThreshold;
58        mCullingManager->SetVisibilityThreshold(mVisibilityThreshold);
59}
60//-----------------------------------------------------------------------
61CullingManager *VisibilityManager::GetCullingManager()
62{
63        return mCullingManager;
64}
65//-----------------------------------------------------------------------
66void VisibilityManager::ApplyVisibilityCulling()
67{
68        mCullingManager->RenderScene();
69}
70//-----------------------------------------------------------------------
71} // namespace GtpVisibility
Note: See TracBrowser for help on using the repository browser.