[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;
|
---|
[162] | 29 |
|
---|
| 30 | class Exporter
|
---|
| 31 | {
|
---|
| 32 | protected:
|
---|
| 33 | string mFilename;
|
---|
[191] | 34 | bool mWireframe;
|
---|
[176] | 35 | bool mUseForcedMaterial;
|
---|
| 36 | Material mForcedMaterial;
|
---|
[162] | 37 |
|
---|
[191] | 38 | bool mExportRayDensity;
|
---|
| 39 |
|
---|
[162] | 40 | public:
|
---|
| 41 |
|
---|
[176] | 42 | Exporter(const string filename):mFilename(filename),
|
---|
[191] | 43 | mWireframe(false),
|
---|
| 44 | mUseForcedMaterial(false),
|
---|
| 45 | mExportRayDensity(false)
|
---|
[162] | 46 | {
|
---|
| 47 | }
|
---|
[170] | 48 | virtual ~Exporter() {}
|
---|
[162] | 49 |
|
---|
| 50 | virtual bool ExportScene(SceneGraphNode *node) = 0;
|
---|
| 51 |
|
---|
| 52 | virtual bool
|
---|
| 53 | ExportBox(const AxisAlignedBox3 &box) = 0;
|
---|
| 54 |
|
---|
| 55 | virtual bool
|
---|
| 56 | ExportKdTree(const KdTree &tree) = 0;
|
---|
| 57 |
|
---|
[438] | 58 | virtual bool
|
---|
[434] | 59 | ExportVssTree(const VssTree &tree) = 0;
|
---|
| 60 |
|
---|
[162] | 61 | virtual bool
|
---|
[438] | 62 | ExportVssTree2(const VssTree &tree,
|
---|
| 63 | const Vector3 direction
|
---|
| 64 | ) = 0;
|
---|
| 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 |
|
---|
[860] | 141 | }
|
---|
[162] | 142 |
|
---|
| 143 | #endif
|
---|