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