Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/med.git] / src / MEDMEM / MEDMEM_VtkMeshDriver.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #ifndef VTK_MESH_DRIVER_HXX
21 #define VTK_MESH_DRIVER_HXX
22
23 #include "MEDMEM.hxx"
24
25 #include <string>
26 #include <vector>
27 #include "MEDMEM_define.hxx"
28 #include "MEDMEM_GenDriver.hxx"
29
30 #include "MEDMEM_STRING.hxx"
31 #include "MEDMEM_Exception.hxx"
32 #include "MEDMEM_Utilities.hxx"
33
34 #include <fstream>
35
36
37 /*!
38
39   Driver Vtk for MESH (only for writing).
40
41   Generic part : implement open and close methods.
42
43 */
44 namespace MEDMEM {
45 class MESH;
46 class FAMILY;
47 class GROUP;
48 class CONNECTIVITY;
49 class MEDMEM_EXPORT VTK_MESH_DRIVER : public GENDRIVER
50 {
51 protected:
52
53   MESH *   _ptrMesh;
54   ofstream *        _vtkFile ;     // The _vtkFile used to write Meshes and Fields to _filename
55   string         _meshName;
56
57 public :
58
59   /*!
60     Constructor.
61   */
62   VTK_MESH_DRIVER() ;
63   /*!
64     Constructor.
65   */
66   VTK_MESH_DRIVER(const string & fileName,  MESH * ptrMesh) ;
67   /*!
68     Copy constructor.
69   */
70   VTK_MESH_DRIVER(const VTK_MESH_DRIVER & driver) ;
71
72   /*!
73     Destructor.
74   */
75   ~VTK_MESH_DRIVER() ;
76
77   void open() ;
78   void close() ;
79
80   void openConst() const throw (MEDEXCEPTION);
81   void closeConst() const throw (MEDEXCEPTION);
82
83   void write( void ) const throw (MEDEXCEPTION) ;
84   void read ( void ) throw (MEDEXCEPTION) ;
85
86   /*!
87     Set the name of the MESH asked in file.
88
89     It could be different than the name of the MESH object.
90   */
91   void   setMeshName(const string & meshName) ;
92   /*!
93     Get the name of the MESH asked in file.
94   */
95   string getMeshName() const ;
96
97 private:
98   GENDRIVER * copy ( void ) const;
99
100 };
101 };
102
103 #endif /* VTK_MESH_DRIVER_HXX */