source: trunk/VUT/GtpVisibilityPreprocessor/src/Exporter.h @ 535

Revision 535, 3.2 KB checked in by mattausch, 19 years ago (diff)
Line 
1#ifndef __EXPORTER_H
2#define __EXPORTER_H
3
4#include <string>
5#include <vector>
6using namespace std;
7
8#include "Material.h"
9#include "Containers.h"
10#include "VssRay.h"
11
12class KdTree;
13class BspTree;
14class VspKdTree;
15class SceneGraphNode;
16class Ray;
17class AxisAlignedBox3;
18class Intersectable;
19class BspLeaf;
20class Polygon3;
21class VssTree;
22class VspBspTree;
23class RssTree;
24class Mesh;
25class Beam;
26
27class Exporter
28{
29protected:
30  string mFilename;
31  bool mWireframe;
32  bool mUseForcedMaterial;
33  Material mForcedMaterial;
34
35  bool mExportRayDensity;
36 
37public:
38 
39  Exporter(const string filename):mFilename(filename),
40                                  mWireframe(false),
41                                  mUseForcedMaterial(false),
42                                  mExportRayDensity(false)
43  {
44  }
45  virtual ~Exporter() {}
46 
47  virtual bool ExportScene(SceneGraphNode *node) = 0;
48
49  virtual bool
50  ExportBox(const AxisAlignedBox3 &box) = 0;
51
52  virtual bool
53  ExportKdTree(const KdTree &tree) = 0;
54
55  virtual bool
56  ExportVssTree(const VssTree &tree) = 0;
57
58  virtual bool
59  ExportVssTree2(const VssTree &tree,
60                                 const Vector3 direction
61                                 ) = 0;
62
63  virtual bool
64  ExportVspKdTree(const VspKdTree &tree, const int maxPvs = 0) = 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.