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