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