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

Revision 1121, 3.3 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, const int maxPvs);// = 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 bool
92  ExportRaySets(const vector<VssRayContainer> &rays,
93                                const RgbColor &color) = 0;
94
95  virtual void
96  ExportViewCells(const ViewCellContainer &viewCells) = 0;
97  virtual void
98  ExportViewCell(ViewCell *viewCell) = 0;
99  virtual void
100  ExportIntersectable(Intersectable *object) = 0;
101
102  virtual void
103  ExportBspSplitPlanes(const BspTree &tree) = 0;
104  virtual void
105  ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
106
107  virtual void
108  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
109 
110  virtual void
111  ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
112
113  virtual void
114  ExportPolygons(const PolygonContainer &polys) = 0;
115
116  virtual void
117  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
118
119  virtual void
120  ExportGeometry(const ObjectContainer &objects) = 0;
121
122  virtual void
123  ExportMesh(Mesh *mesh) = 0;
124
125  virtual bool
126  ExportRssTree2(const RssTree &tree,
127                                 const Vector3 direction) = 0;
128
129  virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box) = 0;
130
131  void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
132 
133  void SetWireframe() { mWireframe = true; }
134  void SetFilled() { mWireframe = false; }
135
136  void SetForcedMaterial(const Material &m) {
137    mForcedMaterial = m;
138    mUseForcedMaterial = true;
139  }
140  void ResetForcedMaterial() {
141    mUseForcedMaterial = false;
142  }
143   
144  static Exporter *
145  GetExporter(const string filename);
146
147  virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
148};
149 
150}
151
152#endif
Note: See TracBrowser for help on using the repository browser.