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