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