source: GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h @ 2600

Revision 2600, 1.5 KB checked in by mattausch, 16 years ago (diff)

preparing for moving objects (contains compile errors!)

Line 
1#ifndef _SceneGraph_H__
2#define _SceneGraph_H__
3
4#include <string>
5#include "Containers.h"
6#include "AxisAlignedBox3.h"
7
8
9namespace GtpVisibilityPreprocessor {
10
11
12/** Basic scene graph node, we are interested only in bounding boxes and topology
13    of the scene graph
14*/
15class SceneGraphNode
16{
17public:
18
19        virtual ~SceneGraphNode();
20        virtual bool IsLeaf() const = 0;
21
22        virtual void UpdateBox() = 0;
23
24//protected:
25
26        AxisAlignedBox3 mBox;
27};
28 
29
30
31/** Scene graph interior node.
32*/
33class SceneGraphInterior: public SceneGraphNode
34{
35public:
36        virtual bool IsLeaf() const { return false; }
37        virtual void UpdateBox();
38
39//protected:
40
41        NodeContainer mChildren;
42};
43
44
45/** Scene graph leaf node.
46*/
47class SceneGraphLeaf: public SceneGraphNode
48{
49public:
50
51        virtual bool IsLeaf() const { return true; }
52        virtual void UpdateBox();
53
54//protected:
55
56        MeshContainer mGeometry;
57};
58
59
60
61/** Scene graph class */
62class SceneGraph {
63
64public:
65
66        SceneGraph();
67        ~SceneGraph();
68       
69        bool Export(const std::string filename);
70 
71        int CollectObjects(ObjectContainer *instances);
72 
73        int AssignObjectIds();
74 
75        void GetStatistics(int &intersectables, int &faces) const;
76
77        AxisAlignedBox3 GetBox() const { return mRoot->mBox; }
78 
79        /** Exports binary version of the scene.
80        */
81        void ExportScene(const std::string filename);
82
83        /** Loads binary version of the scene.
84        */
85        void LoadScene(const std::string filename);
86
87        SceneGraphNode *GetRoot();
88
89        void SetRoot(SceneGraphNode *sgNnode);
90
91
92protected:
93
94         SceneGraphNode *mRoot;
95};
96
97
98}
99
100#endif
Note: See TracBrowser for help on using the repository browser.