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