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 | virtual void
|
---|
92 | ExportGeometry(const ObjectContainer &objects);
|
---|
93 |
|
---|
94 | bool
|
---|
95 | ExportRays(const RayContainer &rays,
|
---|
96 | const float length=1000,
|
---|
97 | const RgbColor &color = RgbColor(1,1,1));
|
---|
98 | bool
|
---|
99 | ExportRays(const VssRayContainer &rays,
|
---|
100 | const RgbColor &color = RgbColor(1,1,1));
|
---|
101 |
|
---|
102 | virtual bool
|
---|
103 | ExportRaySets(const vector<VssRayContainer> &rays,
|
---|
104 | const RgbColor &color) { return false; }
|
---|
105 |
|
---|
106 | virtual void
|
---|
107 | ExportBspSplitPlanes(const BspTree &tree);
|
---|
108 |
|
---|
109 | virtual void
|
---|
110 | ExportBspSplits(const BspTree &tree, const bool exportDepth);
|
---|
111 |
|
---|
112 | virtual void
|
---|
113 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
|
---|
114 |
|
---|
115 | virtual void
|
---|
116 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
|
---|
117 |
|
---|
118 |
|
---|
119 | virtual void
|
---|
120 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
|
---|
121 |
|
---|
122 | virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
|
---|
123 |
|
---|
124 | protected:
|
---|
125 |
|
---|
126 |
|
---|
127 | virtual void
|
---|
128 | ExportSceneNode(SceneGraphNode *node);
|
---|
129 |
|
---|
130 | bool
|
---|
131 | ExportKdTreeRayDensity(const KdTree &tree);
|
---|
132 |
|
---|
133 | bool
|
---|
134 | ExportBspTreeRayDensity(const BspTree &tree);
|
---|
135 |
|
---|
136 | void ExportBspNodeSplits(BspNode *root,
|
---|
137 | const AxisAlignedBox3 &box,
|
---|
138 | const bool exportDepth,
|
---|
139 | const bool epsilon);
|
---|
140 |
|
---|
141 |
|
---|
142 | void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
|
---|
143 |
|
---|
144 | };
|
---|
145 |
|
---|
146 | }
|
---|
147 |
|
---|
148 | #endif
|
---|