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