00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ARCHON_X3D_SCENE_FORMAT_H
00021 #define ARCHON_X3D_SCENE_FORMAT_H
00022
00023 #include <string>
00024
00025 #include <archon/x3d/server/scene.H>
00026
00027 namespace Archon
00028 {
00029 namespace X3D
00030 {
00031 using namespace std;
00032 using namespace Utilities;
00033
00037 struct SerializedScene
00038 {
00039 static Ref<Scene> load(Ref<Stream::Reader>,
00040 string sourceName, string formatSpecifier,
00041 ProgressTracker *, Logger *)
00042 throw(UnknownFormatException, InvalidFormatException,
00043 IOException, UnexpectedException);
00044
00045 static void save(Ref<const Scene>, Ref<Stream::Writer>,
00046 string targetName, string formatSpecifier,
00047 ProgressTracker *, Logger *)
00048 throw(UnknownFormatException, IOException, UnexpectedException);
00049 }
00050
00058 struct Format
00059 {
00060 static size_t getNumberOfFormats();
00061 static const SceneFormat *getFormat(size_t index);
00062
00068 virtual string getSpecifier() const = 0;
00069
00074 virtual bool checkSignature(Ref<Stream::Reader>) const = 0;
00075
00082 virtual bool checkSuffix(string suffix) const = 0;
00083
00084 virtual Ref<Scene> load(Ref<Stream::Reader>, ProgressTracker *, Logger *) const
00085 throw(InvalidFormatException, IOException, UnexpectedException) = 0;
00086
00087 virtual void save(Ref<Scene>, Ref<Stream::Writer>, ProgressTracker *, Logger *) const
00088 throw(IOException, UnexpectedException) = 0;
00089
00093 virtual ~Format() {}
00094 };
00095 }
00096 }
00097
00098 #endif // ARCHON_X3D_SCENE_FORMAT_H