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

Revision 418, 2.6 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;
21
22class Exporter
23{
24protected:
25  string mFilename;
26  bool mWireframe;
27  bool mUseForcedMaterial;
28  Material mForcedMaterial;
29
30  bool mExportRayDensity;
31 
32public:
33 
34  Exporter(const string filename):mFilename(filename),
35                                  mWireframe(false),
36                                  mUseForcedMaterial(false),
37                                  mExportRayDensity(false)
38  {
39  }
40  virtual ~Exporter() {}
41 
42  virtual bool ExportScene(SceneGraphNode *node) = 0;
43
44  virtual bool
45  ExportBox(const AxisAlignedBox3 &box) = 0;
46
47  virtual bool
48  ExportKdTree(const KdTree &tree) = 0;
49
50  virtual bool
51  ExportVspKdTree(const VspKdTree &tree) = 0;
52
53  virtual bool
54  ExportBspTree(const BspTree &tree) = 0;
55
56//    virtual bool
57//    ExportRays(const vector<Ray> &rays,
58//           const float length=1000,
59//           const RgbColor &color = RgbColor(1,1,1)
60//           ) = 0;
61 
62  virtual bool
63  ExportRays(const RayContainer &rays,
64                                                 const float length=1000,
65                                                 const RgbColor &color = RgbColor(1,1,1)
66                                                 ) = 0;
67
68        virtual bool
69  ExportRays(const VssRayContainer &rays,
70                                                 const RgbColor &color = RgbColor(1,1,1)
71                                                 ) = 0;
72
73  virtual void
74  ExportViewCells(const ViewCellContainer &viewCells) = 0;
75  virtual void
76  ExportViewCell(ViewCell *viewCell) = 0;
77  virtual void
78  ExportIntersectable(Intersectable *object) = 0;
79
80  virtual void
81  ExportBspSplitPlanes(const BspTree &tree) = 0;
82  virtual void
83  ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
84  virtual void
85  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
86       
87  virtual void
88  ExportPolygons(const PolygonContainer &polys) = 0;
89
90  virtual void
91  ExportBspViewCellPartition(const BspTree &tree, const int maxPvs = 0) = 0;
92
93  virtual void
94  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
95
96  void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
97 
98  void SetWireframe() { mWireframe = true; }
99  void SetFilled() { mWireframe = false; }
100
101  void SetForcedMaterial(const Material &m) {
102    mForcedMaterial = m;
103    mUseForcedMaterial = true;
104  }
105  void ResetForcedMaterial() {
106    mUseForcedMaterial = false;
107  }
108   
109  static Exporter *
110  GetExporter(const string filename);
111
112 
113};
114 
115
116
117#endif
Note: See TracBrowser for help on using the repository browser.