[162] | 1 | #ifndef __EXPORTER_H
|
---|
| 2 | #define __EXPORTER_H
|
---|
| 3 |
|
---|
| 4 | #include <string>
|
---|
| 5 | #include <vector>
|
---|
| 6 | using namespace std;
|
---|
| 7 |
|
---|
[176] | 8 | #include "Material.h"
|
---|
[261] | 9 | #include "Containers.h"
|
---|
[386] | 10 | #include "VssRay.h"
|
---|
[176] | 11 |
|
---|
[162] | 12 | class KdTree;
|
---|
[242] | 13 | class BspTree;
|
---|
[418] | 14 | class VspKdTree;
|
---|
[162] | 15 | class SceneGraphNode;
|
---|
| 16 | class Ray;
|
---|
| 17 | class AxisAlignedBox3;
|
---|
[176] | 18 | class Intersectable;
|
---|
[360] | 19 | class BspLeaf;
|
---|
[362] | 20 | class Polygon3;
|
---|
[434] | 21 | class VssTree;
|
---|
[448] | 22 | class VspBspTree;
|
---|
[446] | 23 | class RssTree;
|
---|
[486] | 24 | class Mesh;
|
---|
[535] | 25 | class Beam;
|
---|
[162] | 26 |
|
---|
| 27 | class Exporter
|
---|
| 28 | {
|
---|
| 29 | protected:
|
---|
| 30 | string mFilename;
|
---|
[191] | 31 | bool mWireframe;
|
---|
[176] | 32 | bool mUseForcedMaterial;
|
---|
| 33 | Material mForcedMaterial;
|
---|
[162] | 34 |
|
---|
[191] | 35 | bool mExportRayDensity;
|
---|
| 36 |
|
---|
[162] | 37 | public:
|
---|
| 38 |
|
---|
[176] | 39 | Exporter(const string filename):mFilename(filename),
|
---|
[191] | 40 | mWireframe(false),
|
---|
| 41 | mUseForcedMaterial(false),
|
---|
| 42 | mExportRayDensity(false)
|
---|
[162] | 43 | {
|
---|
| 44 | }
|
---|
[170] | 45 | virtual ~Exporter() {}
|
---|
[162] | 46 |
|
---|
| 47 | virtual bool ExportScene(SceneGraphNode *node) = 0;
|
---|
| 48 |
|
---|
| 49 | virtual bool
|
---|
| 50 | ExportBox(const AxisAlignedBox3 &box) = 0;
|
---|
| 51 |
|
---|
| 52 | virtual bool
|
---|
| 53 | ExportKdTree(const KdTree &tree) = 0;
|
---|
| 54 |
|
---|
[438] | 55 | virtual bool
|
---|
[434] | 56 | ExportVssTree(const VssTree &tree) = 0;
|
---|
| 57 |
|
---|
[162] | 58 | virtual bool
|
---|
[438] | 59 | ExportVssTree2(const VssTree &tree,
|
---|
| 60 | const Vector3 direction
|
---|
| 61 | ) = 0;
|
---|
| 62 |
|
---|
| 63 | virtual bool
|
---|
[425] | 64 | ExportVspKdTree(const VspKdTree &tree, const int maxPvs = 0) = 0;
|
---|
[418] | 65 |
|
---|
| 66 | virtual bool
|
---|
[242] | 67 | ExportBspTree(const BspTree &tree) = 0;
|
---|
| 68 |
|
---|
[386] | 69 | // virtual bool
|
---|
| 70 | // ExportRays(const vector<Ray> &rays,
|
---|
| 71 | // const float length=1000,
|
---|
| 72 | // const RgbColor &color = RgbColor(1,1,1)
|
---|
| 73 | // ) = 0;
|
---|
[176] | 74 |
|
---|
[349] | 75 | virtual bool
|
---|
| 76 | ExportRays(const RayContainer &rays,
|
---|
[466] | 77 | const float length=1000,
|
---|
| 78 | const RgbColor &color = RgbColor(1,1,1)
|
---|
| 79 | ) = 0;
|
---|
| 80 |
|
---|
| 81 | virtual bool
|
---|
[386] | 82 | ExportRays(const VssRayContainer &rays,
|
---|
[466] | 83 | const RgbColor &color = RgbColor(1,1,1)
|
---|
| 84 | ) = 0;
|
---|
| 85 |
|
---|
[261] | 86 | virtual void
|
---|
[313] | 87 | ExportViewCells(const ViewCellContainer &viewCells) = 0;
|
---|
[312] | 88 | virtual void
|
---|
| 89 | ExportViewCell(ViewCell *viewCell) = 0;
|
---|
[162] | 90 | virtual void
|
---|
[176] | 91 | ExportIntersectable(Intersectable *object) = 0;
|
---|
| 92 |
|
---|
[313] | 93 | virtual void
|
---|
| 94 | ExportBspSplitPlanes(const BspTree &tree) = 0;
|
---|
| 95 | virtual void
|
---|
[383] | 96 | ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
|
---|
[448] | 97 |
|
---|
[360] | 98 | virtual void
|
---|
| 99 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
|
---|
[448] | 100 |
|
---|
[362] | 101 | virtual void
|
---|
[448] | 102 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0;
|
---|
| 103 |
|
---|
| 104 | virtual void
|
---|
[362] | 105 | ExportPolygons(const PolygonContainer &polys) = 0;
|
---|
| 106 |
|
---|
[373] | 107 | virtual void
|
---|
[396] | 108 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
|
---|
[373] | 109 |
|
---|
[440] | 110 | virtual void
|
---|
| 111 | ExportGeometry(const ObjectContainer &objects) = 0;
|
---|
| 112 |
|
---|
[486] | 113 | virtual void
|
---|
| 114 | ExportMesh(Mesh *mesh) = 0;
|
---|
| 115 |
|
---|
[448] | 116 | virtual bool
|
---|
| 117 | ExportRssTree2(const RssTree &tree,
|
---|
| 118 | const Vector3 direction) = 0;
|
---|
| 119 |
|
---|
[535] | 120 | virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box) = 0;
|
---|
| 121 |
|
---|
[191] | 122 | void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
|
---|
| 123 |
|
---|
| 124 | void SetWireframe() { mWireframe = true; }
|
---|
| 125 | void SetFilled() { mWireframe = false; }
|
---|
[162] | 126 |
|
---|
[176] | 127 | void SetForcedMaterial(const Material &m) {
|
---|
| 128 | mForcedMaterial = m;
|
---|
| 129 | mUseForcedMaterial = true;
|
---|
| 130 | }
|
---|
| 131 | void ResetForcedMaterial() {
|
---|
| 132 | mUseForcedMaterial = false;
|
---|
| 133 | }
|
---|
| 134 |
|
---|
[162] | 135 | static Exporter *
|
---|
| 136 | GetExporter(const string filename);
|
---|
| 137 |
|
---|
[459] | 138 | virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0;
|
---|
[162] | 139 | };
|
---|
| 140 |
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | #endif
|
---|