[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 | );
|
---|
| 61 |
|
---|
[462] | 62 | bool
|
---|
[425] | 63 | ExportVspKdTree(const VspKdTree &tree, const int maxPvs);
|
---|
[418] | 64 |
|
---|
[242] | 65 | bool ExportBspTree(const BspTree &tree);
|
---|
| 66 |
|
---|
[162] | 67 | bool
|
---|
[462] | 68 | ExportScene(SceneGraphNode *root)
|
---|
[162] | 69 | {
|
---|
| 70 | ExportSceneNode(root);
|
---|
| 71 | return true;
|
---|
| 72 | }
|
---|
[462] | 73 |
|
---|
| 74 | virtual void
|
---|
[260] | 75 | ExportPolygon(Polygon3 *poly);
|
---|
[242] | 76 |
|
---|
[462] | 77 | virtual void
|
---|
[362] | 78 | ExportPolygons(const PolygonContainer &polys);
|
---|
[263] | 79 |
|
---|
[176] | 80 | virtual bool
|
---|
[162] | 81 | ExportBox(const AxisAlignedBox3 &box);
|
---|
| 82 |
|
---|
| 83 | virtual void
|
---|
| 84 | ExportMeshInstance(MeshInstance *mi);
|
---|
| 85 |
|
---|
[176] | 86 | virtual void
|
---|
| 87 | ExportIntersectable(Intersectable *object);
|
---|
| 88 |
|
---|
| 89 | virtual void
|
---|
[162] | 90 | ExportMesh(Mesh *mesh);
|
---|
| 91 |
|
---|
[462] | 92 | virtual void
|
---|
[260] | 93 | ExportViewCell(ViewCell *viewCell);
|
---|
[176] | 94 |
|
---|
[462] | 95 | virtual void
|
---|
[313] | 96 | ExportViewCells(const ViewCellContainer &viewCells);
|
---|
[312] | 97 |
|
---|
[462] | 98 | virtual void
|
---|
[440] | 99 | ExportGeometry(const ObjectContainer &objects);
|
---|
| 100 |
|
---|
[448] | 101 | bool
|
---|
| 102 | ExportRays(const RayContainer &rays,
|
---|
| 103 | const float length=1000,
|
---|
| 104 | const RgbColor &color = RgbColor(1,1,1));
|
---|
| 105 | bool
|
---|
| 106 | ExportRays(const VssRayContainer &rays,
|
---|
| 107 | const RgbColor &color = RgbColor(1,1,1));
|
---|
| 108 |
|
---|
[462] | 109 | virtual void
|
---|
[313] | 110 | ExportBspSplitPlanes(const BspTree &tree);
|
---|
[462] | 111 |
|
---|
| 112 | virtual void
|
---|
[383] | 113 | ExportBspSplits(const BspTree &tree, const bool exportDepth);
|
---|
[312] | 114 |
|
---|
[360] | 115 | virtual void
|
---|
| 116 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
|
---|
| 117 |
|
---|
[373] | 118 | virtual void
|
---|
[396] | 119 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
|
---|
[373] | 120 |
|
---|
[448] | 121 |
|
---|
[462] | 122 | virtual void
|
---|
[448] | 123 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
|
---|
| 124 |
|
---|
[535] | 125 | virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
|
---|
| 126 |
|
---|
[162] | 127 | protected:
|
---|
[329] | 128 |
|
---|
[448] | 129 |
|
---|
[176] | 130 | virtual void
|
---|
[162] | 131 | ExportSceneNode(SceneGraphNode *node);
|
---|
| 132 |
|
---|
[191] | 133 | bool
|
---|
| 134 | ExportKdTreeRayDensity(const KdTree &tree);
|
---|
| 135 |
|
---|
[263] | 136 | bool
|
---|
[434] | 137 | ExportBspTreeRayDensity(const BspTree &tree);
|
---|
[462] | 138 |
|
---|
[448] | 139 | void ExportBspNodeSplits(BspNode *root,
|
---|
[462] | 140 | const AxisAlignedBox3 &box,
|
---|
[448] | 141 | const bool exportDepth,
|
---|
[462] | 142 | const bool epsilon);
|
---|
[459] | 143 |
|
---|
| 144 |
|
---|
| 145 | void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
|
---|
| 146 |
|
---|
[162] | 147 | };
|
---|
| 148 |
|
---|
[863] | 149 | };
|
---|
[162] | 150 |
|
---|
| 151 | #endif
|
---|