source: GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.h @ 1121

Revision 1121, 3.1 KB checked in by mattausch, 18 years ago (diff)
Line 
1#ifndef __VRMLEXPORTER_H
2#define __VRMLEXPORTER_H
3
4#include <string>
5using 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
15namespace GtpVisibilityPreprocessor {
16
17class SceneGraphNode;
18class Mesh;
19class Intersectable;
20class MeshInstance;
21class Polygon3;
22class ViewCell;
23class BspTree;
24class VspBspTree;
25class BspNode;
26class Beam;
27class OspTree;
28
29class VrmlExporter : public Exporter
30{
31  std::ofstream stream;
32
33public:
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);
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  ExportMeshInstance(MeshInstance *mi);
87
88  virtual void
89  ExportTransformedMeshInstance(TransformedMeshInstance *mi);
90
91  virtual void
92  ExportIntersectable(Intersectable *object);
93
94  virtual void
95  ExportMesh(Mesh *mesh);
96
97  virtual void
98  ExportViewCell(ViewCell *viewCell);
99
100  virtual void
101  ExportViewCells(const ViewCellContainer &viewCells);
102
103  virtual void
104  ExportGeometry(const ObjectContainer &objects);
105
106  bool
107  ExportRays(const RayContainer &rays,
108                         const float length=1000,
109                         const RgbColor &color = RgbColor(1,1,1));
110  bool
111  ExportRays(const VssRayContainer &rays,
112                         const RgbColor &color = RgbColor(1,1,1));
113
114  virtual bool
115  ExportRaySets(const vector<VssRayContainer> &rays,
116        const RgbColor &color) { return false; }
117
118  virtual void
119  ExportBspSplitPlanes(const BspTree &tree);
120
121  virtual void
122  ExportBspSplits(const BspTree &tree, const bool exportDepth);
123
124  virtual void
125  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
126
127  virtual void
128  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
129
130
131  virtual void
132  ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
133
134  virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
135
136protected:
137
138
139  virtual void
140  ExportSceneNode(SceneGraphNode *node);
141
142  bool
143  ExportKdTreeRayDensity(const KdTree &tree);
144
145  bool
146  ExportBspTreeRayDensity(const BspTree &tree);
147
148  void ExportBspNodeSplits(BspNode *root,
149                                                   const AxisAlignedBox3 &box,
150                                                   const bool exportDepth,
151                                                   const bool epsilon);
152
153
154  void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
155
156};
157
158}
159
160#endif
Note: See TracBrowser for help on using the repository browser.