[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;
|
---|
[162] | 22 |
|
---|
| 23 | class Exporter
|
---|
| 24 | {
|
---|
| 25 | protected:
|
---|
| 26 | string mFilename;
|
---|
[191] | 27 | bool mWireframe;
|
---|
[176] | 28 | bool mUseForcedMaterial;
|
---|
| 29 | Material mForcedMaterial;
|
---|
[162] | 30 |
|
---|
[191] | 31 | bool mExportRayDensity;
|
---|
| 32 |
|
---|
[162] | 33 | public:
|
---|
| 34 |
|
---|
[176] | 35 | Exporter(const string filename):mFilename(filename),
|
---|
[191] | 36 | mWireframe(false),
|
---|
| 37 | mUseForcedMaterial(false),
|
---|
| 38 | mExportRayDensity(false)
|
---|
[162] | 39 | {
|
---|
| 40 | }
|
---|
[170] | 41 | virtual ~Exporter() {}
|
---|
[162] | 42 |
|
---|
| 43 | virtual bool ExportScene(SceneGraphNode *node) = 0;
|
---|
| 44 |
|
---|
| 45 | virtual bool
|
---|
| 46 | ExportBox(const AxisAlignedBox3 &box) = 0;
|
---|
| 47 |
|
---|
| 48 | virtual bool
|
---|
| 49 | ExportKdTree(const KdTree &tree) = 0;
|
---|
| 50 |
|
---|
[438] | 51 | virtual bool
|
---|
[434] | 52 | ExportVssTree(const VssTree &tree) = 0;
|
---|
| 53 |
|
---|
[162] | 54 | virtual bool
|
---|
[438] | 55 | ExportVssTree2(const VssTree &tree,
|
---|
| 56 | const Vector3 direction
|
---|
| 57 | ) = 0;
|
---|
| 58 |
|
---|
| 59 | virtual bool
|
---|
[425] | 60 | ExportVspKdTree(const VspKdTree &tree, const int maxPvs = 0) = 0;
|
---|
[418] | 61 |
|
---|
| 62 | virtual bool
|
---|
[242] | 63 | ExportBspTree(const BspTree &tree) = 0;
|
---|
| 64 |
|
---|
[386] | 65 | // virtual bool
|
---|
| 66 | // ExportRays(const vector<Ray> &rays,
|
---|
| 67 | // const float length=1000,
|
---|
| 68 | // const RgbColor &color = RgbColor(1,1,1)
|
---|
| 69 | // ) = 0;
|
---|
[176] | 70 |
|
---|
[349] | 71 | virtual bool
|
---|
| 72 | ExportRays(const RayContainer &rays,
|
---|
[386] | 73 | const float length=1000,
|
---|
| 74 | const RgbColor &color = RgbColor(1,1,1)
|
---|
| 75 | ) = 0;
|
---|
[162] | 76 |
|
---|
[386] | 77 | virtual bool
|
---|
| 78 | ExportRays(const VssRayContainer &rays,
|
---|
| 79 | const RgbColor &color = RgbColor(1,1,1)
|
---|
| 80 | ) = 0;
|
---|
| 81 |
|
---|
[261] | 82 | virtual void
|
---|
[313] | 83 | ExportViewCells(const ViewCellContainer &viewCells) = 0;
|
---|
[312] | 84 | virtual void
|
---|
| 85 | ExportViewCell(ViewCell *viewCell) = 0;
|
---|
[162] | 86 | virtual void
|
---|
[176] | 87 | ExportIntersectable(Intersectable *object) = 0;
|
---|
| 88 |
|
---|
[313] | 89 | virtual void
|
---|
| 90 | ExportBspSplitPlanes(const BspTree &tree) = 0;
|
---|
| 91 | virtual void
|
---|
[383] | 92 | ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0;
|
---|
[360] | 93 | virtual void
|
---|
| 94 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves) = 0;
|
---|
[313] | 95 |
|
---|
[362] | 96 | virtual void
|
---|
| 97 | ExportPolygons(const PolygonContainer &polys) = 0;
|
---|
| 98 |
|
---|
[373] | 99 | virtual void
|
---|
[379] | 100 | ExportBspViewCellPartition(const BspTree &tree, const int maxPvs = 0) = 0;
|
---|
[373] | 101 |
|
---|
| 102 | virtual void
|
---|
[396] | 103 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0;
|
---|
[373] | 104 |
|
---|
[440] | 105 | virtual void
|
---|
| 106 | ExportGeometry(const ObjectContainer &objects) = 0;
|
---|
| 107 |
|
---|
[191] | 108 | void SetExportRayDensity(const bool d) { mExportRayDensity = d; }
|
---|
| 109 |
|
---|
| 110 | void SetWireframe() { mWireframe = true; }
|
---|
| 111 | void SetFilled() { mWireframe = false; }
|
---|
[162] | 112 |
|
---|
[176] | 113 | void SetForcedMaterial(const Material &m) {
|
---|
| 114 | mForcedMaterial = m;
|
---|
| 115 | mUseForcedMaterial = true;
|
---|
| 116 | }
|
---|
| 117 | void ResetForcedMaterial() {
|
---|
| 118 | mUseForcedMaterial = false;
|
---|
| 119 | }
|
---|
| 120 |
|
---|
[162] | 121 | static Exporter *
|
---|
| 122 | GetExporter(const string filename);
|
---|
| 123 |
|
---|
| 124 | };
|
---|
| 125 |
|
---|
| 126 |
|
---|
| 127 |
|
---|
| 128 | #endif
|
---|