
#ifndef __WFX_SCENE_X3DLOADER_H__
#define __WFX_SCENE_X3DLOADER_H__

#include <WFX/WFXIncludes.h>
#include <WFX/io/File.h>
#include <WFX/scene/Node.h>
#include <tinyxml/tinyxml.h>

namespace WFX {

    namespace scene {

        /**
         * Very very incomplete X3D Loader
         * This is a 3 minute hack - needs to be redonE
         */
        class X3DLoader {
            public:

                /** Ctor */
                X3DLoader();
                
                /**
                 * static method that wraps loadFromFile
                 */
                static Node* load(const WFX::io::File& f);


                /**
                 * tries to parse the given X3D File and returns a
                 * Node*
                 */
                Node* loadFromFile(const WFX::io::File& f);

            protected:
            
            private:
                /** parse the Scene node */
                Node* parseScene(TiXmlElement* e);
                /** parse transform node */
                Spatial* parseTransform(TiXmlElement* e);
                /** parse shape node */
                Spatial* parseShape(TiXmlElement* e);
                /** parse IndexedFaceSet node */
                Spatial* parseIndexedFaceSet(TiXmlElement* e);

        };

    }

}


#endif //include guard


