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

Revision 65, 3.8 KB checked in by bittner, 19 years ago (diff)

Merged headers and sources for dummy modules. Added GtpVisibilityPreprocessor?

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  /** Get the root of the scene hierarchy.
44      @return the hierarchy root
45  */
46  HierarchyNode *GetSceneRoot() const {
47    return mSceneRoot;
48  }
49        /** Sets the scene root and initialises this scene traverser for a traversal.
50                @param root current scene root
51                @remark initialises some parameters, and also the statistics.
52        */
53        void InitFrame(HierarchyNode *root);
54       
55        /** Returns current frame id.
56                @returns frame id
57        */
58        int GetFrameId();
59        /** Returns the current distance queue.
60                @returns current distance queue
61        */
62        DistanceQueue *GetQueue();
63        /** Returns true if node 1 has greater distance to the view
64                plane than node 2.
65                @param node1 the first node to be compared
66                @param node2 the second node to be compared
67        */                     
68        virtual bool HasGreaterDistance(HierarchyNode *node1, HierarchyNode *node2) = 0;
69        /** Checks if the node is visible from the current view frustum.
70                @param node the current node
71                @param intersects returns true if the current node intersects the near plane
72        */
73        virtual bool CheckFrustumVisible(HierarchyNode *node, bool &intersects) = 0;
74        /** Returns next available occlusion query or creates new one.
75                @return the next occlusion query
76        */
77        virtual OcclusionQuery *GetNextOcclusionQuery() = 0;
78        /** Returns true if there is renderable geometry attached to this node
79                @param node the current node
80                @returns if the node has renderable geometry
81        */
82    virtual bool HasGeometry(HierarchyNode *node) = 0;
83        /** Sets the visible flag for this node.
84                @param node the current node
85                @param visible the visible flag
86        */
87        virtual void SetNodeVisible(HierarchyNode *node, const bool visible) = 0;
88        /** Returns true if node has the visible flag set. See set
89        */
90        virtual bool IsNodeVisible(HierarchyNode *node) = 0;
91        /** Sets the last visited frame id for this node.
92                @param node the current node
93                @param frameId the current frame id
94        */
95        virtual void SetLastVisited(HierarchyNode *node, const int frameId) = 0;
96        /** Returns frame id when this node was last visited by the traverser. See set
97        */
98        virtual int LastVisited(HierarchyNode *node) = 0;
99
100protected:
101       
102        unsigned int mFrameId;
103
104        int mCurrentTestIdx;
105       
106        //--- statistics
107        unsigned int mNumSceneNodes;
108        unsigned int mNumTraversedNodes;
109        unsigned int mNumRenderedGeometry;
110        unsigned int mNumRenderedNodes;
111
112        DistanceQueue *mDistanceQueue;
113        HierarchyNode *mSceneRoot;
114        //HierarchyNode *mCurrentNode;
115};
116} // namespace GtpVisibility
117#endif // GtpVisisibilityHierarchyInterface_H
Note: See TracBrowser for help on using the repository browser.