
#ifndef __WFX_SCENE_BOUNDINGCUBEFINDER_H__
#define __WFX_SCENE_BOUNDINGCUBEFINDER_H__

#include <WFX/WFXIncludes.h>
#include <WFX/scene/SceneGraphVisitor.h>
#include <WFX/math/Cube.h>

namespace WFX {

    namespace scene {

        /**
         * finds a meth::Cube that includes all Vertices in the SceneGraph
         */
        class BoundingCubeFinder : public SceneGraphVisitor {
            public:
                /** Ctor */
                BoundingCubeFinder();
                virtual ~BoundingCubeFinder();

                /** visits a Node */
                void visitNode(Node& n);
                /** visits a TriMesh */
                void visitTriMesh(TriMesh& m);
                /** visits an OctreeNode */
                void visitOctreeNode(OctreeNode& o);

                /** returns the BoundingCube */
                WFX::math::Cube getBoundingCube();
                   
            protected:
            
            private:
                /** the bounding cube */
                WFX::math::Cube BoundingCube;
                /** # vertices visited */
                UInt VertexCount;
                /** vertices visited */
                std::list<WFX::scene::GeometryNode*> VisitedNodes;
                 
                

        };

    }

}


#endif //include guard


