#ifndef __EXPORTER_H #define __EXPORTER_H #include #include using namespace std; #include "Material.h" #include "Containers.h" #include "AxisAlignedBox3.h" namespace GtpVisibilityPreprocessor { class KdTree; class BspTree; class SceneGraphNode; class Ray; class Intersectable; class BspLeaf; class Polygon3; class VssTree; class VspBspTree; class RssTree; class Mesh; class Beam; class OspTree; class KdIntersectable; class BvHierarchy; class TransformedMeshInstance; class MeshInstance; class VssRay; class TraversalTree; struct VssRayContainer; 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), mClampToBox(false) {} virtual ~Exporter() {} virtual bool ExportScene(SceneGraphNode *node) = 0; virtual bool ExportBox(const AxisAlignedBox3 &box) = 0; virtual bool ExportKdTree(const KdTree &tree, const bool exportGeometry = false) = 0; virtual bool ExportTraversalTree(const TraversalTree &tree, const bool exportViewCells); 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 ExportOspTree(const OspTree &tree, const int maxPvs); 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 bool ExportRaySets(const vector &rays, const RgbColor &color) = 0; virtual void ExportViewCells(const ViewCellContainer &viewCells); virtual void ExportViewCell(ViewCell *viewCell) = 0; virtual void ExportIntersectable(Intersectable *object); 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, const bool exportSingleMesh = false, AxisAlignedBox3 *bbox = NULL); 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; void ExportKdIntersectable(const KdIntersectable &kdObj); bool ExportBvHierarchy(const BvHierarchy &bvHierarchy, const float maxPvs, AxisAlignedBox3 *box = NULL, const bool exportBoundingBoxes = true); virtual void ExportMeshInstance(MeshInstance *mi); virtual void ExportTransformedMeshInstance(TransformedMeshInstance *mi); virtual void ExportPolygon(Polygon3 *poly) = 0; /////////////////////////// bool mClampToBox; AxisAlignedBox3 mBoundingBox; }; } #endif