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