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