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

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