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

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