[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"
|
---|
[162] | 13 |
|
---|
| 14 | class SceneGraphNode;
|
---|
| 15 | class Mesh;
|
---|
[176] | 16 | class Intersectable;
|
---|
| 17 | class MeshInstance;
|
---|
[242] | 18 | class Polygon3;
|
---|
| 19 | class ViewCell;
|
---|
| 20 | class BspTree;
|
---|
[162] | 21 |
|
---|
| 22 | class X3dExporter : public Exporter
|
---|
| 23 | {
|
---|
| 24 | std::ofstream stream;
|
---|
| 25 |
|
---|
| 26 | public:
|
---|
| 27 |
|
---|
| 28 | X3dExporter(const string filename);
|
---|
| 29 |
|
---|
| 30 | ~X3dExporter();
|
---|
| 31 |
|
---|
| 32 |
|
---|
[386] | 33 | // bool
|
---|
| 34 | // ExportRays(const vector<Ray> &rays,
|
---|
| 35 | // const float length=1000,
|
---|
| 36 | // const RgbColor &color = RgbColor(1,1,1));
|
---|
[162] | 37 |
|
---|
| 38 | bool
|
---|
| 39 | ExportKdTree(const KdTree &tree);
|
---|
| 40 |
|
---|
[418] | 41 | bool
|
---|
| 42 | ExportVspKdTree(const VspKdTree &tree);
|
---|
| 43 |
|
---|
[242] | 44 | bool ExportBspTree(const BspTree &tree);
|
---|
| 45 |
|
---|
[162] | 46 | bool
|
---|
| 47 | ExportScene(SceneGraphNode *root)
|
---|
| 48 | {
|
---|
| 49 | ExportSceneNode(root);
|
---|
| 50 | return true;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
[242] | 53 | virtual void
|
---|
[260] | 54 | ExportPolygon(Polygon3 *poly);
|
---|
[242] | 55 |
|
---|
[362] | 56 | virtual void
|
---|
| 57 | ExportPolygons(const PolygonContainer &polys);
|
---|
[263] | 58 |
|
---|
[176] | 59 | virtual bool
|
---|
[162] | 60 | ExportBox(const AxisAlignedBox3 &box);
|
---|
| 61 |
|
---|
| 62 | virtual void
|
---|
| 63 | ExportMeshInstance(MeshInstance *mi);
|
---|
| 64 |
|
---|
[176] | 65 | virtual void
|
---|
| 66 | ExportIntersectable(Intersectable *object);
|
---|
| 67 |
|
---|
| 68 | virtual void
|
---|
[162] | 69 | ExportMesh(Mesh *mesh);
|
---|
| 70 |
|
---|
[260] | 71 | virtual void
|
---|
| 72 | ExportViewCell(ViewCell *viewCell);
|
---|
[176] | 73 |
|
---|
[261] | 74 | virtual void
|
---|
[313] | 75 | ExportViewCells(const ViewCellContainer &viewCells);
|
---|
[312] | 76 |
|
---|
[313] | 77 | virtual void
|
---|
| 78 | ExportBspSplitPlanes(const BspTree &tree);
|
---|
| 79 |
|
---|
| 80 | virtual void
|
---|
[383] | 81 | ExportBspSplits(const BspTree &tree, const bool exportDepth);
|
---|
[312] | 82 |
|
---|
[360] | 83 | virtual void
|
---|
| 84 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
|
---|
| 85 |
|
---|
[349] | 86 | bool
|
---|
| 87 | ExportRays(const RayContainer &rays,
|
---|
[386] | 88 | const float length=1000,
|
---|
| 89 | const RgbColor &color = RgbColor(1,1,1));
|
---|
[349] | 90 |
|
---|
[386] | 91 | bool
|
---|
| 92 | ExportRays(const VssRayContainer &rays,
|
---|
| 93 | const RgbColor &color = RgbColor(1,1,1));
|
---|
| 94 |
|
---|
[373] | 95 | virtual void
|
---|
[379] | 96 | ExportBspViewCellPartition(const BspTree &tree, const int maxPvs = 0);
|
---|
[373] | 97 |
|
---|
| 98 | virtual void
|
---|
[396] | 99 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
|
---|
[373] | 100 |
|
---|
[162] | 101 | protected:
|
---|
[329] | 102 |
|
---|
[176] | 103 | virtual void
|
---|
[162] | 104 | ExportSceneNode(SceneGraphNode *node);
|
---|
| 105 |
|
---|
[191] | 106 | bool
|
---|
| 107 | ExportKdTreeRayDensity(const KdTree &tree);
|
---|
| 108 |
|
---|
[263] | 109 | bool
|
---|
| 110 | ExportBspTreeRayDensity(const BspTree &tree);
|
---|
[162] | 111 | };
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | #endif
|
---|