source: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h @ 2332

Revision 2332, 3.1 KB checked in by mattausch, 17 years ago (diff)

implemented part of rendering estimation of wimmer et al. for view space / object space subdivision.
warning: not working with undersampling estimation + local visibility based subdivision.

Line 
1#ifndef _OctreeHierarchyInterface_H__
2#define _OctreeHierarchyInterface_H__
3
4#include <OgreOctree.h>
5#include <OgreOctreeSceneManager.h>
6#include "OgreSceneNodeHierarchyInterface.h"
7
8namespace Ogre {
9/**
10        This class implements the hierarchy interface for the Ogre octree hierarchy.
11*/
12class OctreeHierarchyInterface : public SceneNodeHierarchyInterface
13{
14public:
15        OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys);
16       
17        /** Sets the number of nodes in this octree
18                @remark do not confuse this with the OctreeNode class
19                which is derived from SceneNode.
20                @param num number of nodes in the octree
21        */
22        void SetNumOctreeNodes(unsigned int num);
23
24        /** Gets the given option for the scene traverser.
25            @remarks
26                See setOption
27        */
28        void PullUpVisibility(GtpVisibility::HierarchyNode *node) const;
29       
30        /** Traverses and renders the given node.
31                @param node current node
32                @remark pushes children on a distance queue.
33        */
34        void TraverseNode(GtpVisibility::HierarchyNode *node);
35        /** @copydoc HierarchyInterface::RenderNode */
36        void RenderNode(GtpVisibility::HierarchyNode *node);
37        bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
38        bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
39        float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
40       
41        void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible) const;
42        void SetLastVisited(GtpVisibility::HierarchyNode *node, const unsigned int frameId) const;
43
44        bool IsNodeVisible(GtpVisibility::HierarchyNode *node) const;
45        unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const;
46
47        void VisualizeCulledNode(GtpVisibility::HierarchyNode *node,
48                                                         GtpVisibility::CullingType type) const;
49
50        void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
51                                                         GeometryVector *geometryList,
52                                                         bool includeChildren);
53       
54        void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const;
55
56        GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *node);
57
58        bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const;
59
60        void RenderNodeRecursive(GtpVisibility::HierarchyNode *node);
61
62        void CollectLeaves(GtpVisibility::HierarchyNode *root,
63                                           GtpVisibility::HierarchyNodeContainer &nodes);
64
65        void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const;
66        void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const;
67        float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const;
68
69        GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node);
70
71
72protected:
73
74        /** Returns pointer to the bounding box of the node.
75                @param node current hierarchy node
76                @returns bounding box of current node
77        */
78        AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
79        /** Returns squared distance of center of box with respect to the camera .
80                @param cam current camera
81                @param box axis aligned box
82        */
83        Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
84};
85} // namespace Ogre
86
87#endif // OctreeHierarchyInterface_H
Note: See TracBrowser for help on using the repository browser.