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

Revision 2091, 3.9 KB checked in by mattausch, 17 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"
[1764]13#include "AxisAlignedBox3.h"
[176]14
[863]15namespace GtpVisibilityPreprocessor {
16
[162]17class KdTree;
[242]18class BspTree;
[162]19class SceneGraphNode;
20class Ray;
[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),
[1764]50                                  mExportRayDensity(false),
51                                  mClampToBox(false)
[1416]52  {}
53
[170]54  virtual ~Exporter() {}
[162]55 
56  virtual bool ExportScene(SceneGraphNode *node) = 0;
57
58  virtual bool
59  ExportBox(const AxisAlignedBox3 &box) = 0;
60
61  virtual bool
[1197]62  ExportKdTree(const KdTree &tree, const bool exportGeometry = false) = 0;
[162]63
[438]64  virtual bool
[434]65  ExportVssTree(const VssTree &tree) = 0;
66
[162]67  virtual bool
[438]68  ExportVssTree2(const VssTree &tree,
69                                 const Vector3 direction
70                                 ) = 0;
71
72  virtual bool
[242]73  ExportBspTree(const BspTree &tree) = 0;
74
[1106]75  virtual bool
[1415]76  ExportOspTree(const OspTree &tree, const int maxPvs);
[176]77 
[349]78  virtual bool
79  ExportRays(const RayContainer &rays,
[466]80                         const float length=1000,
81                         const RgbColor &color = RgbColor(1,1,1)
82                         ) = 0;
83 
84  virtual bool
[386]85  ExportRays(const VssRayContainer &rays,
[466]86                         const RgbColor &color = RgbColor(1,1,1)
87                         ) = 0;
[1112]88
89  virtual bool
90  ExportRaySets(const vector<VssRayContainer> &rays,
91                                const RgbColor &color) = 0;
92
[261]93  virtual void
[1344]94  ExportViewCells(const ViewCellContainer &viewCells);
95 
[312]96  virtual void
97  ExportViewCell(ViewCell *viewCell) = 0;
[1344]98
[162]99  virtual void
[1344]100  ExportIntersectable(Intersectable *object);
[176]101
[313]102  virtual void
103  ExportBspSplitPlanes(const BspTree &tree) = 0;
104  virtual void
[383]105  ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
[448]106
[360]107  virtual void
108  ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
[448]109 
[362]110  virtual void
[448]111  ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
112
113  virtual void
[362]114  ExportPolygons(const PolygonContainer &polys) = 0;
115
[373]116  virtual void
[396]117  ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
[373]118
[440]119  virtual void
[2091]120  ExportGeometry(const ObjectContainer &objects,
121                                 const bool exportSingleMesh = false,
122                                 AxisAlignedBox3 *bbox = NULL);
[440]123
[2091]124  virtual void
[486]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; }
[1867]137 
[2091]138  void SetForcedMaterial(const Material &m)
139  {
140          mForcedMaterial = m;
141          mUseForcedMaterial = true;
[176]142  }
[2091]143
144  void ResetForcedMaterial()
145  {
146          mUseForcedMaterial = false;
[176]147  }
148   
[162]149  static Exporter *
150  GetExporter(const string filename);
151
[459]152  virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
[1139]153
154  void ExportKdIntersectable(const KdIntersectable &kdObj);
[1344]155
[2091]156  bool ExportBvHierarchy(const BvHierarchy &bvHierarchy,
157                                                 const float maxPvs,
158                                                 AxisAlignedBox3 *box = NULL,
159                                                 const bool exportBoundingBoxes = true);
[1416]160
[1344]161  virtual void ExportMeshInstance(MeshInstance *mi);
162
[2091]163  virtual void ExportTransformedMeshInstance(TransformedMeshInstance *mi);
[1344]164
[2091]165  virtual void
166  ExportPolygon(Polygon3 *poly) = 0;
[1764]167
[2091]168
169  ///////////////////////////
170
[1764]171  bool mClampToBox;
172  AxisAlignedBox3 mBoundingBox;
[162]173};
174 
[860]175}
[162]176
177#endif
Note: See TracBrowser for help on using the repository browser.