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 Beam;
|
---|
27 |
|
---|
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, const bool exportGeometry = false);
|
---|
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 ExportOspTree(const OspTree &tree);
|
---|
63 |
|
---|
64 | bool ExportBspTree(const BspTree &tree);
|
---|
65 |
|
---|
66 | bool
|
---|
67 | ExportScene(SceneGraphNode *root)
|
---|
68 | {
|
---|
69 | ExportSceneNode(root);
|
---|
70 | return true;
|
---|
71 | }
|
---|
72 |
|
---|
73 | virtual void
|
---|
74 | ExportPolygon(Polygon3 *poly);
|
---|
75 |
|
---|
76 | virtual void
|
---|
77 | ExportPolygons(const PolygonContainer &polys);
|
---|
78 |
|
---|
79 | virtual bool
|
---|
80 | ExportBox(const AxisAlignedBox3 &box);
|
---|
81 |
|
---|
82 | virtual void
|
---|
83 | ExportMesh(Mesh *mesh);
|
---|
84 |
|
---|
85 | virtual void
|
---|
86 | ExportViewCell(ViewCell *viewCell);
|
---|
87 |
|
---|
88 | bool
|
---|
89 | ExportRays(const RayContainer &rays,
|
---|
90 | const float length=1000,
|
---|
91 | const RgbColor &color = RgbColor(1,1,1));
|
---|
92 |
|
---|
93 | bool
|
---|
94 | ExportRays(const VssRayContainer &rays,
|
---|
95 | const RgbColor &color = RgbColor(1,1,1));
|
---|
96 |
|
---|
97 | virtual void
|
---|
98 | ExportBspSplitPlanes(const BspTree &tree);
|
---|
99 |
|
---|
100 | virtual void
|
---|
101 | ExportBspSplits(const BspTree &tree, const bool exportDepth);
|
---|
102 |
|
---|
103 | virtual void
|
---|
104 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
|
---|
105 |
|
---|
106 | virtual void
|
---|
107 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
|
---|
108 |
|
---|
109 | virtual void
|
---|
110 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
|
---|
111 |
|
---|
112 | virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
|
---|
113 |
|
---|
114 | bool
|
---|
115 | ExportRaySets(const vector<VssRayContainer> &rays,
|
---|
116 | const RgbColor &color);
|
---|
117 |
|
---|
118 | protected:
|
---|
119 |
|
---|
120 | virtual void
|
---|
121 | ExportSceneNode(SceneGraphNode *node);
|
---|
122 |
|
---|
123 | bool
|
---|
124 | ExportKdTreeRayDensity(const KdTree &tree);
|
---|
125 |
|
---|
126 | bool
|
---|
127 | ExportBspTreeRayDensity(const BspTree &tree);
|
---|
128 |
|
---|
129 | void ExportBspNodeSplits(BspNode *root,
|
---|
130 | const AxisAlignedBox3 &box,
|
---|
131 | const bool exportDepth,
|
---|
132 | const bool epsilon);
|
---|
133 |
|
---|
134 |
|
---|
135 | void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
|
---|
136 |
|
---|
137 | };
|
---|
138 |
|
---|
139 | };
|
---|
140 |
|
---|
141 | #endif
|
---|