Back to index

salome-med  6.5.0
MEDMEM_EnsightMedDriver.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef ENSIGHT_MED_DRIVER_HXX
00024 #define ENSIGHT_MED_DRIVER_HXX
00025 
00026 #include <string>
00027 #include "MEDMEM_STRING.hxx"
00028 #include "MEDMEM_Utilities.hxx"
00029 #include "MEDMEM_Exception.hxx"
00030 
00031 #include "MEDMEM_EnsightUtils.hxx"
00032 
00033 #include <fstream>
00034 
00035 using namespace std ;
00036 
00037 
00038 namespace MEDMEM {
00039 class MESH;
00040 class SUPPORT;
00041 class FIELD_;
00042 
00043 // ==============================================================================
00047 // ==============================================================================
00048 
00049 class MEDMEM_EXPORT ENSIGHT_MED_DRIVER : public MEDMEM_ENSIGHT::_CaseFileDriver_User
00050 {
00051 protected:
00052   
00053   virtual void openConst()  const;
00054 
00055 public :
00056   ENSIGHT_MED_DRIVER();
00057   ENSIGHT_MED_DRIVER(const string & fileName, MED_EN::med_mode_acces accessMode);
00058   ENSIGHT_MED_DRIVER(const ENSIGHT_MED_DRIVER & driver);
00059   virtual ~ENSIGHT_MED_DRIVER();
00060 
00061   virtual void open();
00062   virtual void close();
00063 };
00064 
00065 // ==============================================================================
00069 // ==============================================================================
00070 
00071 class MEDMEM_EXPORT ENSIGHT_MED_RDONLY_DRIVER : public virtual ENSIGHT_MED_DRIVER
00072 {
00073 public :
00074   ENSIGHT_MED_RDONLY_DRIVER();
00075   ENSIGHT_MED_RDONLY_DRIVER(const string & fileName, std::vector< FIELD_* >& fields);
00076   ENSIGHT_MED_RDONLY_DRIVER(const ENSIGHT_MED_RDONLY_DRIVER & driver);
00077   virtual ~ENSIGHT_MED_RDONLY_DRIVER();
00078   virtual void write          ( void ) const throw (MEDEXCEPTION) ;
00079   virtual void read           ( void ) ;
00080   virtual void readFileStruct ( void ) ;
00081   GENDRIVER * copy ( void ) const;
00082 private:
00083 
00084   std::vector< FIELD_* > * _fields;
00085   bool _isFileStructRead;
00086 };
00087 
00088 // ==============================================================================
00095 // ==============================================================================
00096 
00097 class MEDMEM_EXPORT ENSIGHT_MED_WRONLY_DRIVER : public virtual ENSIGHT_MED_DRIVER
00098 {
00099   const std::vector< const FIELD_* > _fields;
00100 public :
00101   ENSIGHT_MED_WRONLY_DRIVER();
00102   ENSIGHT_MED_WRONLY_DRIVER(const string & fileName, const std::vector< const FIELD_* >& fields);
00103   ENSIGHT_MED_WRONLY_DRIVER(const ENSIGHT_MED_WRONLY_DRIVER & driver);
00104   virtual ~ENSIGHT_MED_WRONLY_DRIVER();
00105   virtual void write          ( void ) const throw (MEDEXCEPTION) ;
00106   virtual void read           ( void ) throw (MEDEXCEPTION) ;
00107   GENDRIVER * copy ( void ) const;
00108 };
00109 
00110 }
00111 
00112 
00113 #endif /* ENSIGTH_MED_DRIVER_HXX */