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