source: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeHierarchyInterface.h @ 2292

Revision 2292, 3.9 KB checked in by mattausch, 17 years ago (diff)
RevLine 
[1165]1/*
2-----------------------------------------------------------------------------
3This source file is part of the GameTools Project
4http://www.gametools.org
5
6Author: Martin Szydlowski
7-----------------------------------------------------------------------------
8*/
9
10#ifndef _OgreKdTreeHierarchyInterface_H_
11#define _OgreKdTreeHierarchyInterface_H_
12
[1170]13#include "OgrePlatformHierarchyInterface.h"
[1165]14
15namespace Ogre
16{
17
18class KdTreeSceneManager;
19
[1170]20class KdTreeHierarchyInterface : public PlatformHierarchyInterface
[1165]21{
22public:
23        KdTreeHierarchyInterface(KdTreeSceneManager *sm, RenderSystem *rsys);
[1170]24
[1165]25        virtual ~KdTreeHierarchyInterface() {};
26
[1170]27        /** Returns true if current node is leaf of the hierarchy.
28        @param node hierarchy node
29        @returns true if node is leaf
30        */
31        virtual bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
32        /** Traverses and renders the hierarchy from the given node.
33        @param node the hierarchy node
34        */
35        virtual void TraverseNode(GtpVisibility::HierarchyNode *node);
36        /** Renders the given hierarchy node.
37        @param node current hierarchy node to be rendered
38        */
39        virtual void RenderNode(GtpVisibility::HierarchyNode *node);
40        /** Pulls up the visibility from the current node recursively to the parent nodes.
41        @param node the current node
42        */
43        virtual void PullUpVisibility(GtpVisibility::HierarchyNode *node) const;
44
45        /** Returns distance of the node to the view plane.
46        @param node the hierarchy node
47        */                     
48        virtual float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
49        /** Returns pointer to bounding box of node.
50        @param node current hierarchy node
51        @returns bounding box of current node
52        */
53        virtual AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
54        /** Returns true if there is renderable geometry attached to this node
55        @param node the current node
56        @returns if the node has renderable geometry
57        */
58        virtual bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
59        /** Sets the visible flag for this node.
60        @param node the current node
61        @param visible the visible flag
62        */
[2258]63        virtual void SetNodeVisible(GtpVisibility::HierarchyNode *node,
64                                                                const bool visible) const;
[1170]65        /** Returns true if node has the visible flag set. See set
66        */
67        virtual bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
68        /** Sets the last visited frame id for this node.
69        @param node the current node
70        @param frameId the current frame id
71        */
[2258]72        virtual void SetLastVisited(GtpVisibility::HierarchyNode *node,
73                                                                const unsigned int frameId) const;
[1170]74        /** Returns frame id when this node was last visited by the traverser. See set
75        */
76        virtual unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
77
78
79        /** Visualization of a culled node, dependent on the culling type.
80        @param node the hierarchy node to be visualized
81        @param type can be one of FRUSTUM_CULLED, QUERY_CULLED
82        */
83        virtual void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
[2258]84                                                                         GtpVisibility::CullingType type) const;
[1170]85
86
87        /** Returns the geometry of a given hierarchy node.
88        @param node the hierarchy node containing the geometry
89        @param geometryList geometry is returned in this list
90        @param includeChildren if the geometry of the children should be taken into account
91        */
92        virtual void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,   
[2280]93                                                                         GeometryVector *geometryList,
[2258]94                                                                         bool includeChildren);
[1170]95
[2258]96        void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const {}
[1170]97
[2259]98        GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;}
[2258]99
100        bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;}
[2259]101
[2292]102        void CollectLeaves(GtpVisibility::HierarchyNode *root,
103                                           GtpVisibility::HierarchyNodeContainer &nodes) {};
104
105        void RenderNodeRecursive(GtpVisibility::HierarchyNode *node) {};
[1165]106};
107
108} // namespace Ogre
109
110#endif // _OgreKdTreeHierarchyInterface_H_
Note: See TracBrowser for help on using the repository browser.