source:
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
@
1328
Revision 1328, 1.1 KB checked in by mattausch, 18 years ago (diff) |
---|
Rev | Line | |
---|---|---|
[372] | 1 | #ifndef _SceneGraph_H__ |
2 | #define _SceneGraph_H__ | |
3 | ||
4 | #include <string> | |
5 | using namespace std; | |
6 | ||
7 | #include "Containers.h" | |
8 | #include "AxisAlignedBox3.h" | |
9 | ||
[860] | 10 | namespace GtpVisibilityPreprocessor { |
[372] | 11 | |
12 | /** Basic scene graph node, we are interested only in bounding boxes and topology | |
[1002] | 13 | of the scene graph |
14 | */ | |
[372] | 15 | class SceneGraphNode { |
16 | public: | |
17 | ObjectContainer mGeometry; | |
18 | SceneGraphNodeContainer mChildren; | |
19 | AxisAlignedBox3 mBox; | |
[1002] | 20 | ~SceneGraphNode(); |
[492] | 21 | void UpdateBox(); |
[372] | 22 | }; |
23 | ||
24 | ||
25 | /** Scene graph class */ | |
26 | class SceneGraph { | |
27 | ||
28 | public: | |
[1002] | 29 | |
[1328] | 30 | SceneGraph(); |
[1002] | 31 | ~SceneGraph(); |
[1328] | 32 | |
33 | bool Export(const string filename); | |
[372] | 34 | |
[1328] | 35 | int CollectObjects(ObjectContainer *instances); |
[492] | 36 | |
[1328] | 37 | int AssignObjectIds(); |
[492] | 38 | |
[1328] | 39 | void GetStatistics(int &intersectables, int &faces) const; |
[372] | 40 | |
[1328] | 41 | AxisAlignedBox3 GetBox() const { return mRoot->mBox; } |
[492] | 42 | |
[1328] | 43 | /** Exports binary version of the scene. |
44 | */ | |
45 | void ExportScene(const string filename); | |
[1166] | 46 | |
[1328] | 47 | /** Loads binary version of the scene. |
48 | */ | |
49 | void LoadScene(const string filename); | |
[1166] | 50 | |
[1328] | 51 | SceneGraphNode *GetRoot(); |
52 | ||
53 | void SetRoot(SceneGraphNode *sgNnode); | |
54 | ||
[372] | 55 | protected: |
[1328] | 56 | |
57 | SceneGraphNode *mRoot; | |
[372] | 58 | }; |
59 | ||
60 | ||
[860] | 61 | } |
[372] | 62 | |
63 | #endif |
Note: See TracBrowser
for help on using the repository browser.