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