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

Revision 59, 1.5 KB checked in by mattausch, 20 years ago (diff)

completely changed file structure plus software design

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