]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_VtkMeshDriver.hxx
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_VtkMeshDriver.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_MESH_DRIVER_HXX
23 #define VTK_MESH_DRIVER_HXX
24
25 #include "MEDMEM.hxx"
26
27 #include <string>
28 #include <vector>
29 #include "MEDMEM_define.hxx"
30 #include "MEDMEM_GenDriver.hxx"
31
32 #include "MEDMEM_STRING.hxx"
33 #include "MEDMEM_Exception.hxx"
34 #include "MEDMEM_Utilities.hxx"
35
36 #include <fstream>
37
38
39 /*!
40
41   Driver Vtk for MESH (only for writing).
42
43   Generic part : implement open and close methods.
44
45 */
46 namespace MEDMEM {
47 class MESH;
48 class FAMILY;
49 class GROUP;
50 class CONNECTIVITY;
51 class MEDMEM_EXPORT VTK_MESH_DRIVER : public GENDRIVER
52 {
53 protected:
54
55   MESH *   _ptrMesh;
56   ofstream *        _vtkFile ;     // The _vtkFile used to write Meshes and Fields to _filename
57   string         _meshName;
58
59 public :
60
61   /*!
62     Constructor.
63   */
64   VTK_MESH_DRIVER() ;
65   /*!
66     Constructor.
67   */
68   VTK_MESH_DRIVER(const string & fileName,  MESH * ptrMesh) ;
69   /*!
70     Copy constructor.
71   */
72   VTK_MESH_DRIVER(const VTK_MESH_DRIVER & driver) ;
73
74   /*!
75     Destructor.
76   */
77   ~VTK_MESH_DRIVER() ;
78
79   void open() ;
80   void close() ;
81
82   void openConst() const throw (MEDEXCEPTION);
83   void closeConst() const throw (MEDEXCEPTION);
84
85   void write( void ) const throw (MEDEXCEPTION) ;
86   void read ( void ) throw (MEDEXCEPTION) ;
87
88   /*!
89     Set the name of the MESH asked in file.
90
91     It could be different than the name of the MESH object.
92   */
93   void   setMeshName(const string & meshName) ;
94   /*!
95     Get the name of the MESH asked in file.
96   */
97   string getMeshName() const ;
98
99 private:
100   GENDRIVER * copy ( void ) const;
101
102 };
103 }
104
105 #endif /* VTK_MESH_DRIVER_HXX */