1 | #ifndef __EXPORTER_H
|
---|
2 | #define __EXPORTER_H
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 | #include <vector>
|
---|
6 | using namespace std;
|
---|
7 |
|
---|
8 | #include "Material.h"
|
---|
9 | #include "Containers.h"
|
---|
10 | #include "VssRay.h"
|
---|
11 |
|
---|
12 | class KdTree;
|
---|
13 | class BspTree;
|
---|
14 | class VspKdTree;
|
---|
15 | class SceneGraphNode;
|
---|
16 | class Ray;
|
---|
17 | class AxisAlignedBox3;
|
---|
18 | class Intersectable;
|
---|
19 | class BspLeaf;
|
---|
20 | class Polygon3;
|
---|
21 | class VssTree;
|
---|
22 | class VspBspTree;
|
---|
23 | class RssTree;
|
---|
24 | class Mesh;
|
---|
25 |
|
---|
26 | class Exporter
|
---|
27 | {
|
---|
28 | protected:
|
---|
29 | string mFilename;
|
---|
30 | bool mWireframe;
|
---|
31 | bool mUseForcedMaterial;
|
---|
32 | Material mForcedMaterial;
|
---|
33 |
|
---|
34 | bool mExportRayDensity;
|
---|
35 |
|
---|
36 | public:
|
---|
37 |
|
---|
38 | Exporter(const string filename):mFilename(filename),
|
---|
39 | mWireframe(false),
|
---|
40 | mUseForcedMaterial(false),
|
---|
41 | mExportRayDensity(false)
|
---|
42 | {
|
---|
43 | }
|
---|
44 | virtual ~Exporter() {}
|
---|
45 |
|
---|
46 | virtual bool ExportScene(SceneGraphNode *node) = 0;
|
---|
47 |
|
---|
48 | virtual bool
|
---|
49 | ExportBox(const AxisAlignedBox3 &box) = 0;
|
---|
50 |
|
---|
51 | virtual bool
|
---|
52 | ExportKdTree(const KdTree &tree) = 0;
|
---|
53 |
|
---|
54 | virtual bool
|
---|
55 | ExportVssTree(const VssTree &tree) = 0;
|
---|
56 |
|
---|
57 | virtual bool
|
---|
58 | ExportVssTree2(const VssTree &tree,
|
---|
59 | const Vector3 direction
|
---|
60 | ) = 0;
|
---|
61 |
|
---|
62 | virtual bool
|
---|
63 | ExportVspKdTree(const VspKdTree &tree, const int maxPvs = 0) = 0;
|
---|
64 |
|
---|
65 | virtual bool
|
---|
66 | ExportBspTree(const BspTree &tree) = 0;
|
---|
67 |
|
---|
68 | // virtual bool
|
---|
69 | // ExportRays(const vector<Ray> &rays,
|
---|
70 | // const float length=1000,
|
---|
71 | // const RgbColor &color = RgbColor(1,1,1)
|
---|
72 | // ) = 0;
|
---|
73 |
|
---|
74 | virtual bool
|
---|
75 | ExportRays(const RayContainer &rays,
|
---|
76 | const float length=1000,
|
---|
77 | const RgbColor &color = RgbColor(1,1,1)
|
---|
78 | ) = 0;
|
---|
79 |
|
---|
80 | virtual bool
|
---|
81 | ExportRays(const VssRayContainer &rays,
|
---|
82 | const RgbColor &color = RgbColor(1,1,1)
|
---|
83 | ) = 0;
|
---|
84 |
|
---|
85 | virtual void
|
---|
86 | ExportViewCells(const ViewCellContainer &viewCells) = 0;
|
---|
87 | virtual void
|
---|
88 | ExportViewCell(ViewCell *viewCell) = 0;
|
---|
89 | virtual void
|
---|
90 | ExportIntersectable(Intersectable *object) = 0;
|
---|
91 |
|
---|
92 | virtual void
|
---|
93 | ExportBspSplitPlanes(const BspTree &tree) = 0;
|
---|
94 | virtual void
|
---|
95 | ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
|
---|
96 |
|
---|
97 | virtual void
|
---|
98 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
|
---|
99 |
|
---|
100 | virtual void
|
---|
101 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
|
---|
102 |
|
---|
103 | virtual void
|
---|
104 | ExportPolygons(const PolygonContainer &polys) = 0;
|
---|
105 |
|
---|
106 | virtual void
|
---|
107 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
|
---|
108 |
|
---|
109 | virtual void
|
---|
110 | ExportGeometry(const ObjectContainer &objects) = 0;
|
---|
111 |
|
---|
112 | virtual void
|
---|
113 | ExportMesh(Mesh *mesh) = 0;
|
---|
114 |
|
---|
115 | virtual bool
|
---|
116 | ExportRssTree2(const RssTree &tree,
|
---|
117 | const Vector3 direction) = 0;
|
---|
118 |
|
---|
119 | void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
|
---|
120 |
|
---|
121 | void SetWireframe() { mWireframe = true; }
|
---|
122 | void SetFilled() { mWireframe = false; }
|
---|
123 |
|
---|
124 | void SetForcedMaterial(const Material &m) {
|
---|
125 | mForcedMaterial = m;
|
---|
126 | mUseForcedMaterial = true;
|
---|
127 | }
|
---|
128 | void ResetForcedMaterial() {
|
---|
129 | mUseForcedMaterial = false;
|
---|
130 | }
|
---|
131 |
|
---|
132 | static Exporter *
|
---|
133 | GetExporter(const string filename);
|
---|
134 |
|
---|
135 | virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
|
---|
136 |
|
---|
137 | };
|
---|
138 |
|
---|
139 |
|
---|
140 |
|
---|
141 | #endif
|
---|