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