]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_VtkMedDriver.hxx
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_VtkMedDriver.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef VTK_MED_DRIVER_HXX
23 #define VTK_MED_DRIVER_HXX
24
25 #include "MEDMEM.hxx"
26
27 #include <string>
28 #include "MEDMEM_STRING.hxx"
29 #include "MEDMEM_Utilities.hxx"
30 #include "MEDMEM_Exception.hxx"
31
32 #include "MEDMEM_GenDriver.hxx"
33
34 #include <fstream>
35
36 using namespace std ;
37
38
39 namespace MEDMEM {
40 class MESH;
41 class SUPPORT;
42 class FIELD_;
43 class MED;
44 // This driver pilots within a VTK class read/write accesses of fields/meshes
45 class MEDMEM_EXPORT VTK_MED_DRIVER : public GENDRIVER
46 {
47 protected:
48   
49   MED * const       _ptrMed ;     // Store 'VTK_DRIVER (0..n)----(1) VTK' associations
50   ofstream *        _vtkFile ;     // The _vtkFile used to write Meshes and Fields to _filename
51   
52 private:
53   VTK_MED_DRIVER();
54
55   //writeField(FIELD * myField) ;
56   //writeMesh(MESH * myMesh) ;
57
58   void open()   ;
59   void close()  ;
60   void openConst()  const ;
61   void closeConst() const ;
62
63 public :
64   VTK_MED_DRIVER(const string & fileName,  MED * const ptrMed);
65   VTK_MED_DRIVER(const VTK_MED_DRIVER & driver);
66   ~VTK_MED_DRIVER();
67   // OPERATEUR DE RECOPIE AVEC _vtkFile ??
68
69   //virtual void write          ( void )  ;
70   void write                 ( void ) const ;
71   virtual void read          ( void )  {} ;
72   //  virtual void writeFrom      ( void ) const ;
73   //  virtual void read           ( void ) ;
74   GENDRIVER * copy (void ) const ;
75
76 private :
77   void writeMesh(MESH * myMesh) const ;
78   void writeSupport(SUPPORT * mySupport) const ;
79   void writeField(FIELD_ * myField,string name) const ;
80
81 };
82 }
83
84
85 #endif /* VTK_MED_DRIVER_HXX */