#ifndef __VRMLEXPORTER_H #define __VRMLEXPORTER_H #include using std::string; #include #include #include "Exporter.h" #include "Containers.h" #include "VssRay.h" #include "ViewCell.h" namespace GtpVisibilityPreprocessor { class SceneGraphNode; class Mesh; class Intersectable; class MeshInstance; class Polygon3; class ViewCell; class BspTree; class VspBspTree; class BspNode; class Beam; class OspTree; class VrmlExporter : public Exporter { std::ofstream stream; public: VrmlExporter(const string filename); ~VrmlExporter(); // bool // ExportRays(const vector &rays, // const float length=1000, // const RgbColor &color = RgbColor(1,1,1)); bool ExportKdTree(const KdTree &tree); //bool ExportOspTree(const OspTree &tree); bool ExportVssTree(const VssTree &tree); bool ExportVssTree2(const VssTree &tree, const Vector3 direction ); virtual bool ExportRssTree2(const RssTree &tree, const Vector3 direction ); #if 0 bool ExportVspOspTree(const VspKdTree &tree, const int maxPvs); #endif bool ExportBspTree(const BspTree &tree); bool ExportScene(SceneGraphNode *root) { ExportSceneNode(root); return true; } virtual void ExportPolygon(Polygon3 *poly); virtual void ExportPolygons(const PolygonContainer &polys); virtual bool ExportBox(const AxisAlignedBox3 &box); virtual void ExportMeshInstance(MeshInstance *mi); virtual void ExportTransformedMeshInstance(TransformedMeshInstance *mi); virtual void ExportIntersectable(Intersectable *object); virtual void ExportMesh(Mesh *mesh); virtual void ExportViewCell(ViewCell *viewCell); virtual void ExportViewCells(const ViewCellContainer &viewCells); virtual void ExportGeometry(const ObjectContainer &objects); bool ExportRays(const RayContainer &rays, const float length=1000, const RgbColor &color = RgbColor(1,1,1)); bool ExportRays(const VssRayContainer &rays, const RgbColor &color = RgbColor(1,1,1)); virtual bool ExportRaySets(const vector &rays, const RgbColor &color) { return false; } virtual void ExportBspSplitPlanes(const BspTree &tree); virtual void ExportBspSplits(const BspTree &tree, const bool exportDepth); virtual void ExportLeavesGeometry(const BspTree &tree, const vector &leaves); virtual void ExportBspLeaves(const BspTree &tree, const int maxPvs = 0); virtual void ExportBspSplits(const VspBspTree &tree, const bool exportDepth); virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box); protected: virtual void ExportSceneNode(SceneGraphNode *node); bool ExportKdTreeRayDensity(const KdTree &tree); bool ExportBspTreeRayDensity(const BspTree &tree); void ExportBspNodeSplits(BspNode *root, const AxisAlignedBox3 &box, const bool exportDepth, const bool epsilon); void ExportViewpoint(const Vector3 &point, const Vector3 &direction); }; } #endif