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

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