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

Revision 1006, 3.1 KB checked in by mattausch, 18 years ago (diff)

started viewspace-objectspace subdivision
removed memory leaks

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;
29
30class Exporter
31{
32protected:
33  string mFilename;
34  bool mWireframe;
35  bool mUseForcedMaterial;
36  Material mForcedMaterial;
37
38  bool mExportRayDensity;
39 
40public:
41 
42  Exporter(const string filename):mFilename(filename),
43                                  mWireframe(false),
44                                  mUseForcedMaterial(false),
45                                  mExportRayDensity(false)
46  {
47  }
48  virtual ~Exporter() {}
49 
50  virtual bool ExportScene(SceneGraphNode *node) = 0;
51
52  virtual bool
53  ExportBox(const AxisAlignedBox3 &box) = 0;
54
55  virtual bool
56  ExportKdTree(const KdTree &tree) = 0;
57
58  virtual bool
59  ExportVssTree(const VssTree &tree) = 0;
60
61  virtual bool
62  ExportVssTree2(const VssTree &tree,
63                                 const Vector3 direction
64                                 ) = 0;
65
66  virtual bool
67  ExportBspTree(const BspTree &tree) = 0;
68
69//    virtual bool
70//    ExportRays(const vector<Ray> &rays,
71//           const float length=1000,
72//           const RgbColor &color = RgbColor(1,1,1)
73//           ) = 0;
74 
75  virtual bool
76  ExportRays(const RayContainer &rays,
77                         const float length=1000,
78                         const RgbColor &color = RgbColor(1,1,1)
79                         ) = 0;
80 
81  virtual bool
82  ExportRays(const VssRayContainer &rays,
83                         const RgbColor &color = RgbColor(1,1,1)
84                         ) = 0;
85 
86  virtual void
87  ExportViewCells(const ViewCellContainer &viewCells) = 0;
88  virtual void
89  ExportViewCell(ViewCell *viewCell) = 0;
90  virtual void
91  ExportIntersectable(Intersectable *object) = 0;
92
93  virtual void
94  ExportBspSplitPlanes(const BspTree &tree) = 0;
95  virtual void
96  ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
97
98  virtual void
99  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
100 
101  virtual void
102  ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
103
104  virtual void
105  ExportPolygons(const PolygonContainer &polys) = 0;
106
107  virtual void
108  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
109
110  virtual void
111  ExportGeometry(const ObjectContainer &objects) = 0;
112
113  virtual void
114  ExportMesh(Mesh *mesh) = 0;
115
116  virtual bool
117  ExportRssTree2(const RssTree &tree,
118                                 const Vector3 direction) = 0;
119
120  virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box) = 0;
121
122  void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
123 
124  void SetWireframe() { mWireframe = true; }
125  void SetFilled() { mWireframe = false; }
126
127  void SetForcedMaterial(const Material &m) {
128    mForcedMaterial = m;
129    mUseForcedMaterial = true;
130  }
131  void ResetForcedMaterial() {
132    mUseForcedMaterial = false;
133  }
134   
135  static Exporter *
136  GetExporter(const string filename);
137
138  virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
139};
140 
141}
142
143#endif
Note: See TracBrowser for help on using the repository browser.