source: GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h @ 2124

Revision 2124, 2.4 KB checked in by mattausch, 17 years ago (diff)
Line 
1#ifndef __X3DEXPORTER_H
2#define __X3DEXPORTER_H
3
4#include <string>
5using std::string;
6
7#include <iostream>
8#include <fstream>
9
10#include "Exporter.h"
11#include "Containers.h"
12#include "VssRay.h"
13#include "ViewCell.h"
14
15namespace GtpVisibilityPreprocessor {
16
17class SceneGraphNode;
18class Mesh;
19class Intersectable;
20class MeshInstance;
21class Polygon3;
22class ViewCell;
23class BspTree;
24class VspBspTree;
25class BspNode;
26class Beam;
27
28
29class X3dExporter : public Exporter
30{
31        std::ofstream stream;
32
33public:
34
35        X3dExporter(const string filename);
36
37        ~X3dExporter();
38
39        bool
40                ExportKdTree(const KdTree &tree, const bool exportGeometry = false);
41
42        bool
43                ExportVssTree(const VssTree &tree);
44
45        bool
46                ExportVssTree2(const VssTree &tree,
47                const Vector3 direction);
48
49        virtual bool
50                ExportRssTree2(const RssTree &tree,
51                const Vector3 direction);
52
53        bool ExportBspTree(const BspTree &tree);
54
55        bool
56                ExportScene(SceneGraphNode *root)
57        {
58                ExportSceneNode(root);
59                return true;
60        }
61
62        virtual void
63                ExportPolygon(Polygon3 *poly);
64
65        virtual void
66                ExportPolygons(const PolygonContainer &polys);
67
68        virtual bool
69                ExportBox(const AxisAlignedBox3 &box);
70
71        virtual void
72                ExportMesh(Mesh *mesh);
73
74        virtual void
75                ExportViewCell(ViewCell *viewCell);
76
77        bool
78                ExportRays(const RayContainer &rays,
79                const float length=1000,
80                const RgbColor &color = RgbColor(1,1,1));
81
82        bool
83                ExportRays(const VssRayContainer &rays,
84                const RgbColor &color = RgbColor(1,1,1));
85
86        virtual void
87                ExportBspSplitPlanes(const BspTree &tree);
88
89        virtual void
90                ExportBspSplits(const BspTree &tree, const bool exportDepth);
91
92        virtual void
93                ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
94
95        virtual void ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
96
97        virtual void ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
98
99        virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
100
101        bool ExportRaySets(const vector<VssRayContainer> &rays,
102                                           const RgbColor &color);
103
104
105protected:
106
107        virtual void ExportSceneNode(SceneGraphNode *node);
108
109        bool ExportKdTreeRayDensity(const KdTree &tree);
110
111        bool ExportBspTreeRayDensity(const BspTree &tree);
112
113        void ExportBspNodeSplits(BspNode *root,
114                                                         const AxisAlignedBox3 &box,
115                                                         const bool exportDepth,
116                                                         const bool epsilon);
117
118        void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
119};
120
121};
122
123#endif
Note: See TracBrowser for help on using the repository browser.