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

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