Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/med.git] / src / MEDMEM / MEDMEM_VtkMedDriver.hxx
1 //  MED MEDMEM : MED files in memory
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : MEDMEM_VtkMedDriver.hxx
25 //  Module : MED
26
27 #ifndef VTK_MED_DRIVER_HXX
28 #define VTK_MED_DRIVER_HXX
29
30 #include <string>
31 #include "MEDMEM_STRING.hxx"
32 #include "utilities.h"
33 #include "MEDMEM_Exception.hxx"
34
35 #include "MEDMEM_GenDriver.hxx"
36
37 #include <fstream>
38
39 using namespace std ;
40
41 class MESH;
42 class SUPPORT;
43 class FIELD_;
44 class MED;
45
46 // This driver pilots within a VTK class read/write accesses of fields/meshes
47 class VTK_MED_DRIVER : public GENDRIVER
48 {
49 protected:
50   
51   MED * const       _ptrMed ;     // Store 'VTK_DRIVER (0..n)----(1) VTK' associations
52   ofstream *        _vtkFile ;     // The _vtkFile used to write Meshes and Fields to _filename
53   
54 private:
55   VTK_MED_DRIVER();
56
57   //writeField(FIELD * myField) ;
58   //writeMesh(MESH * myMesh) ;
59
60   void open()   ;
61   void close()  ;
62   void openConst()  const ;
63   void closeConst() const ;
64
65 public :
66   VTK_MED_DRIVER(const string & fileName,  MED * const ptrMed);
67   VTK_MED_DRIVER(const VTK_MED_DRIVER & driver);
68   ~VTK_MED_DRIVER();
69   // OPERATEUR DE RECOPIE AVEC _vtkFile ??
70
71   //virtual void write          ( void )  ;
72   void write                 ( void ) const ;
73   virtual void read          ( void )  {} ;
74   //  virtual void writeFrom      ( void ) const ;
75   //  virtual void read           ( void ) ;
76   GENDRIVER * copy (void ) const ;
77
78 private :
79   void writeMesh(MESH * myMesh) const ;
80   void writeSupport(SUPPORT * mySupport) const ;
81   void writeField(FIELD_ * myField,string name) const ;
82
83 };
84
85
86 #endif /* VTK_MED_DRIVER_HXX */