00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00020 #ifndef _ImLib3DFile_hpp
00021 #define _ImLib3DFile_hpp
00022
00023
00024 #include<ImLib3D/XMLBinaryFile.hpp>
00025
00027 class ImLib3DFile : public XMLBinaryFile
00028 {
00029 public:
00030 static bool IsImLib3DImage(const string &fname);
00031 ~ImLib3DFile(){if(isOpen){Close();}}
00032 ImLib3DFile(const string &_fileName="",const string &mode="",bool _exceptionOnFail=false):
00033 XMLBinaryFile(_fileName,mode,_exceptionOnFail)
00034 {;}
00035 };
00036
00038 class Streamable
00039 {
00040 public:
00042
00043 xmlpp::Element *CreateWriteNode(const string &topNodeName,ImLib3DFile *file,xmlpp::Element *parentNode,xmlpp::Element *node) const;
00045
00046 xmlpp::Element *CreateReadNode(const string &topNodeName,ImLib3DFile *file,xmlpp::Element *parentNode,xmlpp::Element *node);
00048 virtual void Read( ImLib3DFile *file,xmlpp::Element *parentNode=NULL,xmlpp::Element *node=NULL)=0;
00050 virtual void Write(ImLib3DFile *file,xmlpp::Element *parentNode=NULL,xmlpp::Element *node=NULL) const=0;
00052 virtual void ReadFromFile( const string &fname) {ImLib3DFile file(fname,"r");Read (&file);}
00054 virtual void WriteToFile(const string &fname) const {ImLib3DFile file(fname,"w");Write(&file);}
00055 };
00056
00057 #endif //_ImLib3DFile_hpp