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"
24 Generic part : implement the readopen and close methods.
33 class GIBI_MESH_DRIVER : public GENDRIVER
38 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
43 // tableau de correspondance des types géométriques de CASTEM -> MED
44 static const size_t nb_geometrie_gibi=47;
45 static const medGeometryElement geomGIBItoMED[nb_geometrie_gibi] = // A COMPLETER
46 { /*1 */ MED_POINT1 ,/*2 */ MED_SEG2 ,/*3 */ MED_SEG3 ,/*4 */ MED_TRIA3 ,/*5 */ MED_NONE ,
47 /*6 */ MED_TRIA6 ,/*7 */ MED_NONE ,/*8 */ MED_QUAD4 ,/*9 */ MED_NONE ,/*10*/ MED_QUAD8 ,
48 /*11*/ MED_NONE ,/*12*/ MED_NONE ,/*13*/ MED_NONE ,/*14*/ MED_HEXA8 ,/*15*/ MED_HEXA20 ,
49 /*16*/ MED_PENTA6 ,/*17*/ MED_PENTA15,/*18*/ MED_NONE ,/*19*/ MED_NONE ,/*20*/ MED_NONE ,
50 /*21*/ MED_NONE ,/*22*/ MED_NONE ,/*23*/ MED_TETRA4 ,/*24*/ MED_TETRA10,/*25*/ MED_PYRA5 ,
51 /*26*/ MED_PYRA13 ,/*27*/ MED_NONE ,/*28*/ MED_NONE ,/*29*/ MED_NONE ,/*30*/ MED_NONE ,
52 /*31*/ MED_NONE ,/*32*/ MED_NONE ,/*33*/ MED_NONE ,/*34*/ MED_NONE ,/*35*/ MED_NONE ,
53 /*36*/ MED_NONE ,/*37*/ MED_NONE ,/*38*/ MED_NONE ,/*39*/ MED_NONE ,/*40*/ MED_NONE ,
54 /*41*/ MED_NONE ,/*42*/ MED_NONE ,/*43*/ MED_NONE ,/*44*/ MED_NONE ,/*45*/ MED_NONE ,
55 /*46*/ MED_NONE ,/*47*/ MED_NONE };
67 GIBI_MESH_DRIVER(const string & fileName,
69 med_mode_acces accessMode) ;
73 GIBI_MESH_DRIVER(const GIBI_MESH_DRIVER & driver) ;
78 virtual ~GIBI_MESH_DRIVER() ;
80 void open() throw (MEDEXCEPTION);
81 void close() throw (MEDEXCEPTION);
83 virtual void write( void ) const = 0 ;
84 virtual void read ( void ) = 0 ;
87 Set the name of the MESH asked in file.
89 It could be different than the name of the MESH object.
91 void setMeshName(const string & meshName) ;
93 Get the name of the MESH asked in file.
95 string getMeshName() const ;
98 virtual GENDRIVER * copy ( void ) const = 0 ;
103 class GIBI_MESH_RDONLY_DRIVER : public virtual GIBI_MESH_DRIVER
111 GIBI_MESH_RDONLY_DRIVER() ;
115 GIBI_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
119 GIBI_MESH_RDONLY_DRIVER(const GIBI_MESH_RDONLY_DRIVER & driver) ;
124 virtual ~GIBI_MESH_RDONLY_DRIVER() ;
127 Return a MEDEXCEPTION : it is the read-only driver.
129 void write( void ) const throw (MEDEXCEPTION);
131 Read MESH in the specified file.
133 void read ( void ) throw (MEDEXCEPTION);
137 GENDRIVER * copy ( void ) const ;
143 Driver Med for MESH : Write only.
145 Implement write method.
149 class GIBI_MESH_WRONLY_DRIVER : public virtual GIBI_MESH_DRIVER {
156 GIBI_MESH_WRONLY_DRIVER() ;
160 GIBI_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
164 GIBI_MESH_WRONLY_DRIVER(const GIBI_MESH_WRONLY_DRIVER & driver) ;
169 virtual ~GIBI_MESH_WRONLY_DRIVER() ;
172 Write MESH in the specified file.
174 void write( void ) const throw (MEDEXCEPTION);
176 Return a MEDEXCEPTION : it is the write-only driver.
178 void read ( void ) throw (MEDEXCEPTION);
182 GENDRIVER * copy ( void ) const ;
188 Driver GIBI for MESH : Read write.
189 - Use read method from GIBI_MESH_RDONLY_DRIVER
190 - Use write method from GIBI_MESH_WRONLY_DRIVER
194 class GIBI_MESH_RDWR_DRIVER : public GIBI_MESH_RDONLY_DRIVER, public GIBI_MESH_WRONLY_DRIVER {
201 GIBI_MESH_RDWR_DRIVER() ;
205 GIBI_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
209 GIBI_MESH_RDWR_DRIVER(const GIBI_MESH_RDWR_DRIVER & driver) ;
214 ~GIBI_MESH_RDWR_DRIVER() ;
217 Write MESH in the specified file.
219 void write(void) const throw (MEDEXCEPTION);
221 Read MESH in the specified file.
223 void read (void) throw (MEDEXCEPTION);
226 GENDRIVER * copy(void) const ;
232 #endif /* GIBI_MESH_DRIVER_HXX */