Back to index

salome-med  6.5.0
MEDMEM_VtkMedDriver.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 VTK_MED_DRIVER_HXX
00024 #define VTK_MED_DRIVER_HXX
00025 
00026 #include "MEDMEM.hxx"
00027 
00028 #include <string>
00029 #include "MEDMEM_STRING.hxx"
00030 #include "MEDMEM_Utilities.hxx"
00031 #include "MEDMEM_Exception.hxx"
00032 
00033 #include "MEDMEM_GenDriver.hxx"
00034 
00035 #include <fstream>
00036 #include <vector>
00037 
00038 using namespace std ;
00039 
00040 
00041 namespace MEDMEM {
00042 class GMESH;
00043 class SUPPORT;
00044 class FIELD_;
00045 class MED;
00046 // This driver pilots within a VTK class read/write accesses of fields/meshes
00047 class MEDMEM_EXPORT VTK_MED_DRIVER : public GENDRIVER
00048 {
00049 protected:
00050 
00051   const std::vector< const FIELD_* > _fields;
00052   
00053 private:
00054   VTK_MED_DRIVER();
00055 
00056   void open()   ;
00057   void close()  ;
00058   void openConst()  const ;
00059   void closeConst() const ;
00060 
00061 public :
00062   VTK_MED_DRIVER(const string & fileName, const std::vector< const FIELD_* >& fields);
00063   VTK_MED_DRIVER(const VTK_MED_DRIVER & driver);
00064   ~VTK_MED_DRIVER();
00065   // OPERATEUR DE RECOPIE AVEC _vtkFile ??
00066 
00067   //virtual void write          ( void )  ;
00068   void write                 ( void ) const ;
00069   virtual void read          ( void )  {} ;
00070   //  virtual void writeFrom      ( void ) const ;
00071   //  virtual void read           ( void ) ;
00072   GENDRIVER * copy (void ) const ;
00073 
00074 private :
00075   void writeMesh(const GMESH * myMesh) const ;
00076   void writeField(const FIELD_ * myField, std::string name) const ;
00077 //   void writeSupport(SUPPORT * mySupport) const ;
00078 
00079 };
00080 }
00081 
00082 
00083 #endif /* VTK_MED_DRIVER_HXX */