]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_VtkMeshDriver.hxx
Salome HOME
update from the MedMemory V1.0.1
[modules/med.git] / src / MEDMEM / MEDMEM_VtkMeshDriver.hxx
1 #ifndef VTK_MESH_DRIVER_HXX
2 #define VTK_MESH_DRIVER_HXX
3
4 #include <string>
5 #include <vector>
6 #include "MEDMEM_define.hxx"
7 #include "MEDMEM_GenDriver.hxx"
8
9 #include "MEDMEM_STRING.hxx"
10 #include "MEDMEM_Exception.hxx"
11 #include "utilities.h"
12
13 #include <fstream>
14
15 class MESH;
16 class FAMILY;
17 class GROUP;
18 class CONNECTIVITY;
19
20 /*!
21
22   Driver Vtk for MESH (only for writing).
23
24   Generic part : implement open and close methods.
25
26 */
27 class VTK_MESH_DRIVER : public GENDRIVER
28 {
29 protected:
30
31   MESH *   _ptrMesh;
32   ofstream *        _vtkFile ;     // The _vtkFile used to write Meshes and Fields to _filename
33   string         _meshName;
34
35 public :
36
37   /*!
38     Constructor.
39   */
40   VTK_MESH_DRIVER() ;
41   /*!
42     Constructor.
43   */
44   VTK_MESH_DRIVER(const string & fileName,  MESH * ptrMesh) ;
45   /*!
46     Copy constructor.
47   */
48   VTK_MESH_DRIVER(const VTK_MESH_DRIVER & driver) ;
49
50   /*!
51     Destructor.
52   */
53   ~VTK_MESH_DRIVER() ;
54
55   void open() ;
56   void close() ;
57
58   void openConst() const throw (MEDEXCEPTION);
59   void closeConst() const throw (MEDEXCEPTION);
60
61   void write( void ) const throw (MEDEXCEPTION) ;
62   void read ( void ) throw (MEDEXCEPTION) ;
63
64   /*!
65     Set the name of the MESH asked in file.
66
67     It could be different than the name of the MESH object.
68   */
69   void   setMeshName(const string & meshName) ;
70   /*!
71     Get the name of the MESH asked in file.
72   */
73   string getMeshName() const ;
74
75 private:
76   GENDRIVER * copy ( void ) const;
77
78 };
79
80 #endif /* VTK_MESH_DRIVER_HXX */