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