00001 #ifndef X3DTK_X3DLOADER_H 00002 #define X3DTK_X3DLOADER_H 00003 00004 #include "X3DTypes.h" 00005 #include "Walker.h" 00006 00007 #include <list> 00008 00009 namespace X3DTK { 00010 00011 class X3DComponentWalker; 00012 class X3DComponentVisitor; 00013 00014 namespace X3D { 00015 00016 class Creator; 00017 class X3DComponentCreator; 00018 class Scene; 00019 class X3DFileValidator; 00020 class X3DXmlLoader; 00021 00022 } 00023 00030 class X3DLoader 00031 { 00032 public: 00034 X3DLoader(); 00036 virtual ~X3DLoader() = 0; 00037 00041 X3D::Scene *load(const char *file, bool fileValidation = true) const; 00042 00044 void setComponentCreator(X3D::X3DComponentCreator *component); 00046 void setWalkerForFileValidator(Walker *walker); 00048 void setComponentVisitorForFileValidator(X3DComponentVisitor *component); 00050 void X3DLoader::setFileValidator(X3D::X3DFileValidator *fileValidator); 00051 00053 template<class L> 00054 static L *getInstanceOf(); 00055 00057 template<class L> 00058 static void removeInstanceOf(); 00059 00061 static void removeAllInstances(); 00062 00063 protected: 00065 X3D::Creator *creator; 00067 X3D::X3DFileValidator *fileValidator; 00069 X3D::X3DXmlLoader *xmlLoader; 00070 00071 private: 00072 static std::list<X3DLoader *> _X3DLoaderList; 00073 }; 00074 00075 } 00076 00077 #include "X3DLoader.inl" 00078 00079 #endif