[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 |
|
---|
[1486] | 29 |
|
---|
| 30 |
|
---|
[712] | 31 | class VrmlExporter : public Exporter
|
---|
| 32 | {
|
---|
| 33 | std::ofstream stream;
|
---|
| 34 |
|
---|
| 35 | public:
|
---|
| 36 |
|
---|
| 37 | VrmlExporter(const string filename);
|
---|
| 38 |
|
---|
| 39 | ~VrmlExporter();
|
---|
| 40 |
|
---|
| 41 | bool
|
---|
[1197] | 42 | ExportKdTree(const KdTree &tree, const bool exportGeometry = false);
|
---|
[712] | 43 |
|
---|
[1106] | 44 | bool
|
---|
[712] | 45 | ExportVssTree(const VssTree &tree);
|
---|
| 46 |
|
---|
| 47 | bool
|
---|
| 48 | ExportVssTree2(const VssTree &tree,
|
---|
| 49 | const Vector3 direction
|
---|
| 50 | );
|
---|
| 51 |
|
---|
| 52 | virtual bool
|
---|
| 53 | ExportRssTree2(const RssTree &tree,
|
---|
| 54 | const Vector3 direction
|
---|
| 55 | );
|
---|
[1006] | 56 | #if 0
|
---|
[712] | 57 | bool
|
---|
[1006] | 58 | ExportVspOspTree(const VspKdTree &tree, const int maxPvs);
|
---|
| 59 | #endif
|
---|
[712] | 60 | bool ExportBspTree(const BspTree &tree);
|
---|
| 61 |
|
---|
| 62 | bool
|
---|
| 63 | ExportScene(SceneGraphNode *root)
|
---|
| 64 | {
|
---|
| 65 | ExportSceneNode(root);
|
---|
| 66 | return true;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | virtual void
|
---|
| 70 | ExportPolygon(Polygon3 *poly);
|
---|
| 71 |
|
---|
| 72 | virtual void
|
---|
| 73 | ExportPolygons(const PolygonContainer &polys);
|
---|
| 74 |
|
---|
| 75 | virtual bool
|
---|
| 76 | ExportBox(const AxisAlignedBox3 &box);
|
---|
| 77 |
|
---|
| 78 | virtual void
|
---|
| 79 | ExportMesh(Mesh *mesh);
|
---|
| 80 |
|
---|
| 81 | virtual void
|
---|
| 82 | ExportViewCell(ViewCell *viewCell);
|
---|
| 83 |
|
---|
| 84 | bool
|
---|
| 85 | ExportRays(const RayContainer &rays,
|
---|
| 86 | const float length=1000,
|
---|
| 87 | const RgbColor &color = RgbColor(1,1,1));
|
---|
| 88 | bool
|
---|
| 89 | ExportRays(const VssRayContainer &rays,
|
---|
| 90 | const RgbColor &color = RgbColor(1,1,1));
|
---|
| 91 |
|
---|
[1112] | 92 | virtual bool
|
---|
| 93 | ExportRaySets(const vector<VssRayContainer> &rays,
|
---|
| 94 | const RgbColor &color) { return false; }
|
---|
| 95 |
|
---|
[712] | 96 | virtual void
|
---|
| 97 | ExportBspSplitPlanes(const BspTree &tree);
|
---|
| 98 |
|
---|
| 99 | virtual void
|
---|
| 100 | ExportBspSplits(const BspTree &tree, const bool exportDepth);
|
---|
| 101 |
|
---|
| 102 | virtual void
|
---|
| 103 | ExportLeavesGeometry(const BspTree &tree, const vector<BspLeaf *> &leaves);
|
---|
| 104 |
|
---|
| 105 | virtual void
|
---|
| 106 | ExportBspLeaves(const BspTree &tree, const int maxPvs = 0);
|
---|
| 107 |
|
---|
| 108 |
|
---|
| 109 | virtual void
|
---|
| 110 | ExportBspSplits(const VspBspTree &tree, const bool exportDepth);
|
---|
| 111 |
|
---|
| 112 | virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box);
|
---|
| 113 |
|
---|
| 114 | protected:
|
---|
| 115 |
|
---|
| 116 |
|
---|
| 117 | virtual void
|
---|
| 118 | ExportSceneNode(SceneGraphNode *node);
|
---|
| 119 |
|
---|
| 120 | bool
|
---|
| 121 | ExportKdTreeRayDensity(const KdTree &tree);
|
---|
| 122 |
|
---|
| 123 | bool
|
---|
| 124 | ExportBspTreeRayDensity(const BspTree &tree);
|
---|
| 125 |
|
---|
| 126 | void ExportBspNodeSplits(BspNode *root,
|
---|
| 127 | const AxisAlignedBox3 &box,
|
---|
| 128 | const bool exportDepth,
|
---|
| 129 | const bool epsilon);
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 | void ExportViewpoint(const Vector3 &point, const Vector3 &direction);
|
---|
| 133 |
|
---|
[2124] | 134 | //virtual bool ExportTraversalTree(const KdTree &tree, const bool exportViewCells);
|
---|
[712] | 135 | };
|
---|
| 136 |
|
---|
[860] | 137 | }
|
---|
[712] | 138 |
|
---|
| 139 | #endif
|
---|