source: trunk/VUT/GtpVisibility/include/HierarchyInterface.h @ 59

Revision 59, 3.6 KB checked in by mattausch, 19 years ago (diff)

completely changed file structure plus software design

Line 
1#ifndef _GtpVisibilityHierarchyInterface_H__
2#define _GtpVisibilityHierarchyInterface_H__
3
4#include "DistanceQueue.h"
5
6namespace GtpVisibility {
7
8/**     Class which implements a hierarchy interface for a scene hierarchy.
9*/
10class HierarchyInterface
11{
12public:
13        /** Default constructor.
14        */
15        HierarchyInterface();
16        virtual ~HierarchyInterface();
17        /** Returns true if current node is leaf of the hierarchy.
18                @param node hierarchy node
19                @returns true if node is leaf
20        */
21    virtual bool IsLeaf(HierarchyNode *node) = 0;
22        /** Traverses the given node.
23                @param node the hierarchy node
24        */
25        virtual void TraverseNode(HierarchyNode *node) = 0;
26        /** Renders current scene node .
27                @param node current scene node to be rendered
28        */
29        virtual void RenderNode(HierarchyNode *node) = 0;
30        /** Pulls up the visibility from the current node recursively to the parent nodes.
31                @param node the current node
32        */
33        virtual void PullUpVisibility(HierarchyNode *node) = 0;
34        /** Issue a occlusion query for this node.
35                @param node the current hierarchy node
36                @returns occlusion query for this node
37        */
38        virtual OcclusionQuery *IssueOcclusionQuery(HierarchyNode *node) = 0;
39        /** Sets the root of the scene hierarchy.
40                @param root the hierarchy root
41        */
42        void SetSceneRoot(HierarchyNode *root);
43        /** Sets the scene root and initialises this scene traverser for a traversal.
44                @param root current scene root
45                @remark initialises some parameters, and also the statistics.
46        */
47        void InitFrame(HierarchyNode *root);
48       
49        /** Returns current frame id.
50                @returns frame id
51        */
52        int GetFrameId();
53        /** Returns the current distance queue.
54                @returns current distance queue
55        */
56        DistanceQueue *GetQueue();
57        /** Returns true if node 1 has greater distance to the view
58                plane than node 2.
59                @param node1 the first node to be compared
60                @param node2 the second node to be compared
61        */                     
62        virtual bool HasGreaterDistance(HierarchyNode *node1, HierarchyNode *node2) = 0;
63        /** Checks if the node is visible from the current view frustum.
64                @param node the current node
65                @param intersects returns true if the current node intersects the near plane
66        */
67        virtual bool CheckFrustumVisible(HierarchyNode *node, bool &intersects) = 0;
68        /** Returns next available occlusion query or creates new one.
69                @return the next occlusion query
70        */
71        virtual OcclusionQuery *GetNextOcclusionQuery() = 0;
72        /** Returns true if there is renderable geometry attached to this node
73                @param node the current node
74                @returns if the node has renderable geometry
75        */
76    virtual bool HasGeometry(HierarchyNode *node) = 0;
77        /** Sets the visible flag for this node.
78                @param node the current node
79                @param visible the visible flag
80        */
81        virtual void SetNodeVisible(HierarchyNode *node, const bool visible) = 0;
82        /** Returns true if node has the visible flag set. See set
83        */
84        virtual bool IsNodeVisible(HierarchyNode *node) = 0;
85        /** Sets the last visited frame id for this node.
86                @param node the current node
87                @param frameId the current frame id
88        */
89        virtual void SetLastVisited(HierarchyNode *node, const int frameId) = 0;
90        /** Returns frame id when this node was last visited by the traverser. See set
91        */
92        virtual int LastVisited(HierarchyNode *node) = 0;
93
94protected:
95       
96        unsigned int mFrameId;
97
98        int mCurrentTestIdx;
99       
100        //--- statistics
101        unsigned int mNumSceneNodes;
102        unsigned int mNumTraversedNodes;
103        unsigned int mNumRenderedGeometry;
104        unsigned int mNumRenderedNodes;
105
106        DistanceQueue *mDistanceQueue;
107        HierarchyNode *mSceneRoot;
108        //HierarchyNode *mCurrentNode;
109};
110} // namespace GtpVisibility
111#endif // GtpVisisibilityHierarchyInterface_H
Note: See TracBrowser for help on using the repository browser.