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