source: GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h @ 1404

Revision 1404, 3.8 KB checked in by mattausch, 18 years ago (diff)

debugging after merge

Line 
1#ifndef __EXPORTER_H
2#define __EXPORTER_H
3
4#include <string>
5#include <vector>
6using namespace std;
7
8
9
10#include "Material.h"
11#include "Containers.h"
12#include "VssRay.h"
13
14namespace GtpVisibilityPreprocessor {
15
16class KdTree;
17class BspTree;
18class SceneGraphNode;
19class Ray;
20class AxisAlignedBox3;
21class Intersectable;
22class BspLeaf;
23class Polygon3;
24class VssTree;
25class VspBspTree;
26class RssTree;
27class Mesh;
28class Beam;
29class OspTree;
30class KdIntersectable;
31class BvHierarchy;
32class TransformedMeshInstance;
33
34
35class Exporter
36{
37protected:
38  string mFilename;
39  bool mWireframe;
40  bool mUseForcedMaterial;
41  Material mForcedMaterial;
42
43  bool mExportRayDensity;
44 
45public:
46 
47  Exporter(const string filename):mFilename(filename),
48                                  mWireframe(false),
49                                  mUseForcedMaterial(false),
50                                  mExportRayDensity(false)
51  {
52  }
53  virtual ~Exporter() {}
54 
55  virtual bool ExportScene(SceneGraphNode *node) = 0;
56
57  virtual bool
58  ExportBox(const AxisAlignedBox3 &box) = 0;
59
60  virtual bool
61  ExportKdTree(const KdTree &tree, const bool exportGeometry = false) = 0;
62
63  virtual bool
64  ExportVssTree(const VssTree &tree) = 0;
65
66  virtual bool
67  ExportVssTree2(const VssTree &tree,
68                                 const Vector3 direction
69                                 ) = 0;
70
71  virtual bool
72  ExportBspTree(const BspTree &tree) = 0;
73
74  virtual bool
75  ExportOspTree(const OspTree &tree, const int maxPvs);// = 0;
76
77//    virtual bool
78//    ExportRays(const vector<Ray> &rays,
79//           const float length=1000,
80//           const RgbColor &color = RgbColor(1,1,1)
81//           ) = 0;
82 
83  virtual bool
84  ExportRays(const RayContainer &rays,
85                         const float length=1000,
86                         const RgbColor &color = RgbColor(1,1,1)
87                         ) = 0;
88 
89  virtual bool
90  ExportRays(const VssRayContainer &rays,
91                         const RgbColor &color = RgbColor(1,1,1)
92                         ) = 0;
93
94  virtual bool
95  ExportRaySets(const vector<VssRayContainer> &rays,
96                                const RgbColor &color) = 0;
97
98  virtual void
99  ExportViewCells(const ViewCellContainer &viewCells);
100 
101  virtual void
102  ExportViewCell(ViewCell *viewCell) = 0;
103
104  virtual void
105  ExportIntersectable(Intersectable *object);
106
107  virtual void
108  ExportBspSplitPlanes(const BspTree &tree) = 0;
109  virtual void
110  ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
111
112  virtual void
113  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
114 
115  virtual void
116  ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
117
118  virtual void
119  ExportPolygons(const PolygonContainer &polys) = 0;
120
121  virtual void
122  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
123
124  virtual void
125  ExportGeometry(const ObjectContainer &objects, const bool exportSingleMesh = false);
126
127  virtual void
128  ExportMesh(Mesh *mesh) = 0;
129
130  virtual bool
131  ExportRssTree2(const RssTree &tree,
132                                 const Vector3 direction) = 0;
133
134  virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box) = 0;
135
136  void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
137 
138  void SetWireframe() { mWireframe = true; }
139  void SetFilled() { mWireframe = false; }
140
141  void SetForcedMaterial(const Material &m) {
142    mForcedMaterial = m;
143    mUseForcedMaterial = true;
144  }
145  void ResetForcedMaterial() {
146    mUseForcedMaterial = false;
147  }
148   
149  static Exporter *
150  GetExporter(const string filename);
151
152  virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
153
154  void ExportKdIntersectable(const KdIntersectable &kdObj);
155  bool ExportBvHierarchy(const BvHierarchy &bvHierarchy, const int maxPvs);
156
157  virtual void ExportMeshInstance(MeshInstance *mi);
158
159  virtual void
160  ExportTransformedMeshInstance(TransformedMeshInstance *mi);
161
162  virtual void ExportPolygon(Polygon3 *poly) = 0;
163};
164 
165}
166
167#endif
Note: See TracBrowser for help on using the repository browser.