
#ifndef __WFX_SCENE_BOUNDINGVOLUME_H__
#define __WFX_SCENE_BOUNDINGVOLUME_H__

#include <WFX/WFXIncludes.h>
#include <WFX/renderer/Drawable.h>
#include <WFX/math/Vector3.h>
#include <WFX/math/Matrix3.h>
#include <WFX/math/Plane.h>

namespace WFX {

    namespace math {
        class Sphere;
        class Cube;
    }

    namespace scene {

        class SceneGraphVisitor;

        /**
         * boundingvolume interface
         */
        class BoundingVolume : public WFX::renderer::Drawable {
            public:

                /** transforms the boundingvolume according to standard transforms */
                virtual void transformBy(math::Matrix3& rot, math::Vector3& trans, Real scale) = 0;
                /** recalculates the bounding volume from vertices */
                virtual void computeFromVertices(UInt count, math::Vector3* verts) = 0;
                /** returns the side of a plane this volume is on */
                virtual math::Plane::Side whichSide(const math::Plane& plane) const = 0;
                /** creates a copy of this BV and returns a pointer to it */
                virtual BoundingVolume* copy() = 0;
                /** visitor pattern... this function needs to be overwritten for merging */
                virtual void merge(BoundingVolume* bv) = 0;
                /** merger function */
                virtual void mergeMe(BoundingVolume* bv) = 0;
                /** merge a sphere */
                virtual void mergeSphere(WFX::math::Sphere& s) = 0;
                /** merge a cube */
                virtual void mergeCube(WFX::math::Cube& c) = 0;

                /** Drawable interface */
                virtual void draw(WFX::renderer::Renderer* r) = 0;

                /** accept a SceneGraphVisitor */
                virtual void accept(SceneGraphVisitor* v) = 0;

                /** print debug info */
                virtual void printDebug() = 0;

            protected:

        };

    }

}


#endif //include guard


