#ifndef __EXPORTER_H #define __EXPORTER_H #include #include using namespace std; #include "Material.h" #include "Containers.h" #include "VssRay.h" namespace GtpVisibilityPreprocessor { class KdTree; class BspTree; class SceneGraphNode; class Ray; class AxisAlignedBox3; class Intersectable; class BspLeaf; class Polygon3; class VssTree; class VspBspTree; class RssTree; class Mesh; class Beam; class Exporter { protected: string mFilename; bool mWireframe; bool mUseForcedMaterial; Material mForcedMaterial; bool mExportRayDensity; public: Exporter(const string filename):mFilename(filename), mWireframe(false), mUseForcedMaterial(false), mExportRayDensity(false) { } virtual ~Exporter() {} virtual bool ExportScene(SceneGraphNode *node) = 0; virtual bool ExportBox(const AxisAlignedBox3 &box) = 0; virtual bool ExportKdTree(const KdTree &tree) = 0; virtual bool ExportVssTree(const VssTree &tree) = 0; virtual bool ExportVssTree2(const VssTree &tree, const Vector3 direction ) = 0; virtual bool ExportBspTree(const BspTree &tree) = 0; // virtual bool // ExportRays(const vector &rays, // const float length=1000, // const RgbColor &color = RgbColor(1,1,1) // ) = 0; virtual bool ExportRays(const RayContainer &rays, const float length=1000, const RgbColor &color = RgbColor(1,1,1) ) = 0; virtual bool ExportRays(const VssRayContainer &rays, const RgbColor &color = RgbColor(1,1,1) ) = 0; virtual void ExportViewCells(const ViewCellContainer &viewCells) = 0; virtual void ExportViewCell(ViewCell *viewCell) = 0; virtual void ExportIntersectable(Intersectable *object) = 0; virtual void ExportBspSplitPlanes(const BspTree &tree) = 0; virtual void ExportBspSplits(const BspTree &tree, const bool exportDepth = false) = 0; virtual void ExportLeavesGeometry(const BspTree &tree, const vector &leaves) = 0; virtual void ExportBspSplits(const VspBspTree &tree, const bool exportDepth = false) = 0; virtual void ExportPolygons(const PolygonContainer &polys) = 0; virtual void ExportBspLeaves(const BspTree &tree, const int maxPvs = 0) = 0; virtual void ExportGeometry(const ObjectContainer &objects) = 0; virtual void ExportMesh(Mesh *mesh) = 0; virtual bool ExportRssTree2(const RssTree &tree, const Vector3 direction) = 0; virtual void ExportBeam(const Beam &beam, const AxisAlignedBox3 &box) = 0; void SetExportRayDensity(const bool d) { mExportRayDensity = d; } void SetWireframe() { mWireframe = true; } void SetFilled() { mWireframe = false; } void SetForcedMaterial(const Material &m) { mForcedMaterial = m; mUseForcedMaterial = true; } void ResetForcedMaterial() { mUseForcedMaterial = false; } static Exporter * GetExporter(const string filename); virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0; }; } #endif