source: trunk/VUT/GtpVisibility/src/HierarchyInterface.cpp @ 86

Revision 86, 2.1 KB checked in by mattausch, 20 years ago (diff)
Line 
1#include "HierarchyInterface.h"
2
3#include <windows.h>
4
5namespace GtpVisibility {
6
7//-----------------------------------------------------------------------
8HierarchyInterface::HierarchyInterface():
9mFrameId(0), mNumTraversedNodes(0), mNumRenderedNodes(0),
10mSceneRoot(0), mPreviousNode(0), mCurrentTestIdx(0), mUseOptimization(true)
11{       
12        mDistanceQueue = new DistanceQueue(GreaterDistance<HierarchyNode *>(this));
13}
14//-----------------------------------------------------------------------
15HierarchyInterface::~HierarchyInterface()
16{               
17        delete mDistanceQueue;
18}
19//-----------------------------------------------------------------------
20void HierarchyInterface::SetSceneRoot(HierarchyNode *root)
21{
22        mSceneRoot = root;
23}
24//-----------------------------------------------------------------------
25void HierarchyInterface::InitFrame(HierarchyNode *root)
26{
27        mFrameId ++;
28        mCurrentTestIdx = 0;
29        mNumTraversedNodes = 0;
30        mNumRenderedNodes = 0;
31
32        SetSceneRoot(root);
33        mDistanceQueue->push(mSceneRoot);
34}
35//-----------------------------------------------------------------------
36unsigned int HierarchyInterface::GetFrameId() const
37{
38        return mFrameId;
39}
40//-----------------------------------------------------------------------
41DistanceQueue *HierarchyInterface::GetQueue()
42{
43        return mDistanceQueue;
44}
45//-----------------------------------------------------------------------
46bool HierarchyInterface::CheckFrustumVisible(HierarchyNode *node)
47{
48        bool intersects = false;
49        return CheckFrustumVisible(node, intersects);
50}
51//-----------------------------------------------------------------------
52HierarchyNode *HierarchyInterface::GetSceneRoot() const
53{
54        return mSceneRoot;
55}
56//-----------------------------------------------------------------------
57unsigned int HierarchyInterface::GetNumTraversedNodes()
58{
59        return mNumTraversedNodes;
60}
61//-----------------------------------------------------------------------
62unsigned int HierarchyInterface::GetNumRenderedNodes()
63{
64        return mNumRenderedNodes;
65}
66
67void HierarchyInterface::SetUseOptimization(bool useOptimization)
68{
69        mUseOptimization = useOptimization;
70}
71
72} // namespace GtpVisibility
Note: See TracBrowser for help on using the repository browser.