Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ImLib3DFile.hpp

Go to the documentation of this file.
00001 /* ImLib3D
00002  * Copyright (c) 2001, ULP-IPB Strasbourg.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or (at
00007  * your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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

Generated on Fri Jun 17 13:36:05 2005 for ImLib3D by  doxygen 1.4.2