1 #ifndef GIBI_MESH_DRIVER_HXX
2 #define GIBI_MESH_DRIVER_HXX
8 #include "MEDMEM_define.hxx"
9 #include "MEDMEM_GenDriver.hxx"
11 #include "MEDMEM_STRING.hxx"
12 #include "MEDMEM_Exception.hxx"
13 #include "utilities.h"
29 Generic part : implement the readopen and close methods.
34 class GIBI_MESH_DRIVER : public GENDRIVER
39 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
44 // tableau de correspondance des types géométriques de CASTEM -> MED
45 static const size_t nb_geometrie_gibi=47;
46 static const medGeometryElement geomGIBItoMED[nb_geometrie_gibi] = // A COMPLETER
47 { /*1 */ MED_POINT1 ,/*2 */ MED_SEG2 ,/*3 */ MED_SEG3 ,/*4 */ MED_TRIA3 ,/*5 */ MED_NONE ,
48 /*6 */ MED_TRIA6 ,/*7 */ MED_NONE ,/*8 */ MED_QUAD4 ,/*9 */ MED_NONE ,/*10*/ MED_QUAD8 ,
49 /*11*/ MED_NONE ,/*12*/ MED_NONE ,/*13*/ MED_NONE ,/*14*/ MED_HEXA8 ,/*15*/ MED_HEXA20 ,
50 /*16*/ MED_PENTA6 ,/*17*/ MED_PENTA15,/*18*/ MED_NONE ,/*19*/ MED_NONE ,/*20*/ MED_NONE ,
51 /*21*/ MED_NONE ,/*22*/ MED_NONE ,/*23*/ MED_TETRA4 ,/*24*/ MED_TETRA10,/*25*/ MED_PYRA5 ,
52 /*26*/ MED_PYRA13 ,/*27*/ MED_NONE ,/*28*/ MED_NONE ,/*29*/ MED_NONE ,/*30*/ MED_NONE ,
53 /*31*/ MED_NONE ,/*32*/ MED_NONE ,/*33*/ MED_NONE ,/*34*/ MED_NONE ,/*35*/ MED_NONE ,
54 /*36*/ MED_NONE ,/*37*/ MED_NONE ,/*38*/ MED_NONE ,/*39*/ MED_NONE ,/*40*/ MED_NONE ,
55 /*41*/ MED_NONE ,/*42*/ MED_NONE ,/*43*/ MED_NONE ,/*44*/ MED_NONE ,/*45*/ MED_NONE ,
56 /*46*/ MED_NONE ,/*47*/ MED_NONE };
68 GIBI_MESH_DRIVER(const string & fileName,
70 med_mode_acces accessMode) ;
74 GIBI_MESH_DRIVER(const GIBI_MESH_DRIVER & driver) ;
79 virtual ~GIBI_MESH_DRIVER() ;
81 void open() throw (MEDEXCEPTION);
82 void close() throw (MEDEXCEPTION);
84 virtual void write( void ) const = 0 ;
85 virtual void read ( void ) = 0 ;
88 Set the name of the MESH asked in file.
90 It could be different than the name of the MESH object.
92 void setMeshName(const string & meshName) ;
94 Get the name of the MESH asked in file.
96 string getMeshName() const ;
99 virtual GENDRIVER * copy ( void ) const = 0 ;
104 class GIBI_MESH_RDONLY_DRIVER : public virtual GIBI_MESH_DRIVER
112 GIBI_MESH_RDONLY_DRIVER() ;
116 GIBI_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
120 GIBI_MESH_RDONLY_DRIVER(const GIBI_MESH_RDONLY_DRIVER & driver) ;
125 virtual ~GIBI_MESH_RDONLY_DRIVER() ;
128 Return a MEDEXCEPTION : it is the read-only driver.
130 void write( void ) const throw (MEDEXCEPTION);
132 Read MESH in the specified file.
134 void read ( void ) throw (MEDEXCEPTION);
138 GENDRIVER * copy ( void ) const ;
144 Driver Med for MESH : Write only.
146 Implement write method.
150 class GIBI_MESH_WRONLY_DRIVER : public virtual GIBI_MESH_DRIVER {
157 GIBI_MESH_WRONLY_DRIVER() ;
161 GIBI_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
165 GIBI_MESH_WRONLY_DRIVER(const GIBI_MESH_WRONLY_DRIVER & driver) ;
170 virtual ~GIBI_MESH_WRONLY_DRIVER() ;
173 Write MESH in the specified file.
175 void write( void ) const throw (MEDEXCEPTION);
177 Return a MEDEXCEPTION : it is the write-only driver.
179 void read ( void ) throw (MEDEXCEPTION);
183 GENDRIVER * copy ( void ) const ;
189 Driver GIBI for MESH : Read write.
190 - Use read method from GIBI_MESH_RDONLY_DRIVER
191 - Use write method from GIBI_MESH_WRONLY_DRIVER
195 class GIBI_MESH_RDWR_DRIVER : public GIBI_MESH_RDONLY_DRIVER, public GIBI_MESH_WRONLY_DRIVER {
202 GIBI_MESH_RDWR_DRIVER() ;
206 GIBI_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
210 GIBI_MESH_RDWR_DRIVER(const GIBI_MESH_RDWR_DRIVER & driver) ;
215 ~GIBI_MESH_RDWR_DRIVER() ;
218 Write MESH in the specified file.
220 void write(void) const throw (MEDEXCEPTION);
222 Read MESH in the specified file.
224 void read (void) throw (MEDEXCEPTION);
227 GENDRIVER * copy(void) const ;
232 #endif /* GIBI_MESH_DRIVER_HXX */