1 | #ifndef __VRMLEXPORTER_H
|
---|
2 | #define __VRMLEXPORTER_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 | class OspTree;
|
---|
28 |
|
---|
29 | class VrmlExporter : public Exporter
|
---|
30 | {
|
---|
31 | std::ofstream stream;
|
---|
32 |
|
---|
33 | public:
|
---|
34 |
|
---|
35 | VrmlExporter(const string filename);
|
---|
36 |
|
---|
37 | ~VrmlExporter();
|
---|
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 ExportOspTree(const OspTree &tree);
|
---|
50 |
|
---|
51 | bool
|
---|
52 | ExportVssTree(const VssTree &tree);
|
---|
53 |
|
---|
54 | bool
|
---|
55 | ExportVssTree2(const VssTree &tree,
|
---|
56 | const Vector3 direction
|
---|
57 | );
|
---|
58 |
|
---|
59 | virtual bool
|
---|
60 | ExportRssTree2(const RssTree &tree,
|
---|
61 | const Vector3 direction
|
---|
62 | );
|
---|
63 | #if 0
|
---|
64 | bool
|
---|
65 | ExportVspOspTree(const VspKdTree &tree, const int maxPvs);
|
---|
66 | #endif
|
---|
67 | bool ExportBspTree(const BspTree &tree);
|
---|
68 |
|
---|
69 | bool
|
---|
70 | ExportScene(SceneGraphNode *root)
|
---|
71 | {
|
---|
72 | ExportSceneNode(root);
|
---|
73 | return true;
|
---|
74 | }
|
---|
75 |
|
---|
76 | virtual void
|
---|
77 | ExportPolygon(Polygon3 *poly);
|
---|
78 |
|
---|
79 | virtual void
|
---|
80 | ExportPolygons(const PolygonContainer &polys);
|
---|
81 |
|
---|
82 | virtual bool
|
---|
83 | ExportBox(const AxisAlignedBox3 &box);
|
---|
84 |
|
---|
85 | virtual void
|
---|
86 | ExportMesh(Mesh *mesh);
|
---|
87 |
|
---|
88 | virtual void
|
---|
89 | ExportViewCell(ViewCell *viewCell);
|
---|
90 |
|
---|
91 | bool
|
---|
92 | ExportRays(const RayContainer &rays,
|
---|
93 | const float length=1000,
|
---|
94 | const RgbColor &color = RgbColor(1,1,1));
|
---|
95 | bool
|
---|
96 | ExportRays(const VssRayContainer &rays,
|
---|
97 | const RgbColor &color = RgbColor(1,1,1));
|
---|
98 |
|
---|
99 | virtual bool
|
---|
100 | ExportRaySets(const vector<VssRayContainer> &rays,
|
---|
101 | const RgbColor &color) { return false; }
|
---|
102 |
|
---|
103 | virtual void
|
---|
104 | ExportBspSplitPlanes(const BspTree &tree);
|
---|
105 |
|
---|
106 | virtual void
|
---|
107 | ExportBspSplits(const BspTree &tree, const bool exportDepth);
|
---|
108 |
|
---|
109 | virtual void
|
---|
110 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
|
---|
111 |
|
---|
112 | virtual void
|
---|
113 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
|
---|
114 |
|
---|
115 |
|
---|
116 | virtual void
|
---|
117 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
|
---|
118 |
|
---|
119 | virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
|
---|
120 |
|
---|
121 | protected:
|
---|
122 |
|
---|
123 |
|
---|
124 | virtual void
|
---|
125 | ExportSceneNode(SceneGraphNode *node);
|
---|
126 |
|
---|
127 | bool
|
---|
128 | ExportKdTreeRayDensity(const KdTree &tree);
|
---|
129 |
|
---|
130 | bool
|
---|
131 | ExportBspTreeRayDensity(const BspTree &tree);
|
---|
132 |
|
---|
133 | void ExportBspNodeSplits(BspNode *root,
|
---|
134 | const AxisAlignedBox3 &box,
|
---|
135 | const bool exportDepth,
|
---|
136 | const bool epsilon);
|
---|
137 |
|
---|
138 |
|
---|
139 | void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
|
---|
140 |
|
---|
141 | };
|
---|
142 |
|
---|
143 | }
|
---|
144 |
|
---|
145 | #endif
|
---|