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

Revision 2116, 4.0 KB checked in by mattausch, 17 years ago (diff)

implemented hashpvs

Line 
1#ifndef __EXPORTER_H
2#define __EXPORTER_H
3
4#include <string>
5#include <vector>
6using namespace std;
7
8
9#include "Material.h"
10#include "Containers.h"
11//#include "VssRay.h"
12#include "AxisAlignedBox3.h"
13
14namespace GtpVisibilityPreprocessor {
15
16class KdTree;
17class BspTree;
18class SceneGraphNode;
19class Ray;
20class Intersectable;
21class BspLeaf;
22class Polygon3;
23class VssTree;
24class VspBspTree;
25class RssTree;
26class Mesh;
27class Beam;
28class OspTree;
29class KdIntersectable;
30class BvHierarchy;
31class TransformedMeshInstance;
32class MeshInstance;
33class VssRay;
34//class Material;
35
36struct VssRayContainer;
37
38class Exporter
39{
40protected:
41  string mFilename;
42  bool mWireframe;
43  bool mUseForcedMaterial;
44  Material mForcedMaterial;
45
46  bool mExportRayDensity;
47 
48public:
49 
50  Exporter(const string filename):mFilename(filename),
51                                  mWireframe(false),
52                                  mUseForcedMaterial(false),
53                                  mExportRayDensity(false),
54                                  mClampToBox(false)
55  {}
56
57  virtual ~Exporter() {}
58 
59  virtual bool ExportScene(SceneGraphNode *node) = 0;
60
61  virtual bool
62  ExportBox(const AxisAlignedBox3 &box) = 0;
63
64  virtual bool
65  ExportKdTree(const KdTree &tree, const bool exportGeometry = false) = 0;
66
67  virtual bool
68  ExportVssTree(const VssTree &tree) = 0;
69
70  virtual bool
71  ExportVssTree2(const VssTree &tree,
72                                 const Vector3 direction
73                                 ) = 0;
74
75  virtual bool
76  ExportBspTree(const BspTree &tree) = 0;
77
78  virtual bool
79  ExportOspTree(const OspTree &tree, const int maxPvs);
80 
81  virtual bool
82  ExportRays(const RayContainer &rays,
83                         const float length=1000,
84                         const RgbColor &color = RgbColor(1,1,1)
85                         ) = 0;
86 
87  virtual bool
88  ExportRays(const VssRayContainer &rays,
89                         const RgbColor &color = RgbColor(1,1,1)
90                         ) = 0;
91
92  virtual bool
93  ExportRaySets(const vector<VssRayContainer> &rays,
94                                const RgbColor &color) = 0;
95
96  virtual void
97  ExportViewCells(const ViewCellContainer &viewCells);
98 
99  virtual void
100  ExportViewCell(ViewCell *viewCell) = 0;
101
102  virtual void
103  ExportIntersectable(Intersectable *object);
104
105  virtual void
106  ExportBspSplitPlanes(const BspTree &tree) = 0;
107  virtual void
108  ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
109
110  virtual void
111  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
112 
113  virtual void
114  ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
115
116  virtual void
117  ExportPolygons(const PolygonContainer &polys) = 0;
118
119  virtual void
120  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
121
122  virtual void
123  ExportGeometry(const ObjectContainer &objects,
124                                 const bool exportSingleMesh = false,
125                                 AxisAlignedBox3 *bbox = NULL);
126
127  virtual void
128  ExportMesh(Mesh *mesh) = 0;
129
130  virtual bool
131  ExportRssTree2(const RssTree &tree,
132                                 const Vector3 direction) = 0;
133
134  virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box) = 0;
135
136  void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
137 
138  void SetWireframe() { mWireframe = true; }
139  void SetFilled() { mWireframe = false; }
140 
141  void SetForcedMaterial(const Material &m)
142  {
143          mForcedMaterial = m;
144          mUseForcedMaterial = true;
145  }
146
147  void ResetForcedMaterial()
148  {
149          mUseForcedMaterial = false;
150  }
151   
152  static Exporter *
153  GetExporter(const string filename);
154
155  virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
156
157  void ExportKdIntersectable(const KdIntersectable &kdObj);
158
159  bool ExportBvHierarchy(const BvHierarchy &bvHierarchy,
160                                                 const float maxPvs,
161                                                 AxisAlignedBox3 *box = NULL,
162                                                 const bool exportBoundingBoxes = true);
163
164  virtual void ExportMeshInstance(MeshInstance *mi);
165
166  virtual void ExportTransformedMeshInstance(TransformedMeshInstance *mi);
167
168  virtual void
169  ExportPolygon(Polygon3 *poly) = 0;
170
171
172  ///////////////////////////
173
174  bool mClampToBox;
175  AxisAlignedBox3 mBoundingBox;
176};
177 
178}
179
180#endif
Note: See TracBrowser for help on using the repository browser.