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

Revision 712, 2.9 KB checked in by mattausch, 19 years ago (diff)

added exporter for Vrml
added transformations to x3d loader

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