Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / src / MEDMEM / MEDMEM_VtkMedDriver.hxx
1 #ifndef VTK_MED_DRIVER_HXX
2 #define VTK_MED_DRIVER_HXX
3
4 #include <string>
5 #include "MEDMEM_STRING.hxx"
6 #include "MEDMEM_Utilities.hxx"
7 #include "MEDMEM_Exception.hxx"
8
9 #include "MEDMEM_GenDriver.hxx"
10
11 #include <fstream>
12
13 using namespace std ;
14
15
16 namespace MEDMEM {
17 class MESH;
18 class SUPPORT;
19 class FIELD_;
20 class MED;
21 // This driver pilots within a VTK class read/write accesses of fields/meshes
22 class VTK_MED_DRIVER : public GENDRIVER
23 {
24 protected:
25   
26   MED * const       _ptrMed ;     // Store 'VTK_DRIVER (0..n)----(1) VTK' associations
27   ofstream *        _vtkFile ;     // The _vtkFile used to write Meshes and Fields to _filename
28   
29 private:
30   VTK_MED_DRIVER();
31
32   //writeField(FIELD * myField) ;
33   //writeMesh(MESH * myMesh) ;
34
35   void open()   ;
36   void close()  ;
37   void openConst()  const ;
38   void closeConst() const ;
39
40 public :
41   VTK_MED_DRIVER(const string & fileName,  MED * const ptrMed);
42   VTK_MED_DRIVER(const VTK_MED_DRIVER & driver);
43   ~VTK_MED_DRIVER();
44   // OPERATEUR DE RECOPIE AVEC _vtkFile ??
45
46   //virtual void write          ( void )  ;
47   void write                 ( void ) const ;
48   virtual void read          ( void )  {} ;
49   //  virtual void writeFrom      ( void ) const ;
50   //  virtual void read           ( void ) ;
51   GENDRIVER * copy (void ) const ;
52
53 private :
54   void writeMesh(MESH * myMesh) const ;
55   void writeSupport(SUPPORT * mySupport) const ;
56   void writeField(FIELD_ * myField,string name) const ;
57
58 };
59 };
60
61
62 #endif /* VTK_MED_DRIVER_HXX */