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

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