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 |
|
---|
| 30 | ~SceneGraph();
|
---|
| 31 |
|
---|
[372] | 32 | SceneGraphNode *mRoot;
|
---|
| 33 | bool Export(const string filename);
|
---|
| 34 |
|
---|
| 35 | int
|
---|
[492] | 36 | CollectObjects(ObjectContainer *instances);
|
---|
| 37 |
|
---|
[387] | 38 | int
|
---|
[492] | 39 | AssignObjectIds();
|
---|
| 40 |
|
---|
| 41 | void
|
---|
| 42 | GetStatistics(int &intersectables, int &faces) const;
|
---|
[372] | 43 |
|
---|
[492] | 44 | AxisAlignedBox3 GetBox() const { return mRoot->mBox; }
|
---|
| 45 |
|
---|
[1166] | 46 | /** Exports binary version of the scene.
|
---|
| 47 | */
|
---|
| 48 | void ExportScene(const string filename);
|
---|
| 49 |
|
---|
| 50 | /** Loads binary version of the scene.
|
---|
| 51 | */
|
---|
| 52 | void LoadScene(const string filename);
|
---|
| 53 |
|
---|
[372] | 54 | protected:
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 |
|
---|
[860] | 58 | }
|
---|
[372] | 59 |
|
---|
| 60 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.