1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef MED_MESH_DRIVER22_HXX
23 #define MED_MESH_DRIVER22_HXX
25 #include "MEDMEM_MedMeshDriver.hxx"
26 #include "MEDMEM_define.hxx"
27 #include "MEDMEM_Compatibility21_22.hxx"
33 Generic part : implement open and close methods.
43 class MED_MESH_DRIVER22 : public virtual MED_MESH_DRIVER
47 med_2_3::med_idt _medIdt ;
52 static const med_2_3::med_geometrie_element all_cell_type[MED_NBR_GEOMETRIE_MAILLE];
54 static const char * const all_cell_type_tab [MED_NBR_GEOMETRIE_MAILLE];
63 MED_MESH_DRIVER22(const string & fileName,
65 MED_EN::med_mode_acces accessMode) ;
69 MED_MESH_DRIVER22(const MED_MESH_DRIVER22 & driver) ;
74 virtual ~MED_MESH_DRIVER22() ;
82 Driver Med for MESH : Read only.
84 Implement read method.
88 class MED_MESH_RDONLY_DRIVER22 : public virtual IMED_MESH_RDONLY_DRIVER, public virtual MED_MESH_DRIVER22
96 MED_MESH_RDONLY_DRIVER22() ;
100 MED_MESH_RDONLY_DRIVER22(const string & fileName, MESH * ptrMesh) ;
104 MED_MESH_RDONLY_DRIVER22(const MED_MESH_RDONLY_DRIVER22 & driver) ;
109 virtual ~MED_MESH_RDONLY_DRIVER22() ;
112 Read MESH in the specified file.
116 * This method activate global faces computation from SCRATCH if a family on FACE exists in the MED file.
117 * This implies a complete renumbering of FACES. This is the default behaviour of this driver.
119 void activateFacesComputation() { _computeFaces=true; }
121 * This method desactivate global face computation.
122 * That is to say that FACES described in file are supposed to
123 * be correct and complete. The consequence is that reading is much faster. Use with care !
125 void desactivateFacesComputation() { _computeFaces=false; }
129 int getCONNECTIVITY();
131 int getNodalConnectivity(CONNECTIVITY * Connectivity) ;
132 int getNodesFamiliesNumber(int * MEDArrayNodeFamily) ;
133 int getCellsFamiliesNumber(int** Arrays, CONNECTIVITY* Connectivity, MED_EN::medEntityMesh entity) ;
136 GENDRIVER * copy ( void ) const ;
137 virtual void merge ( const GENDRIVER& driver );
145 Driver Med for MESH : Write only.
147 Implement write method.
151 class MED_MESH_WRONLY_DRIVER22 : public virtual IMED_MESH_WRONLY_DRIVER, public virtual MED_MESH_DRIVER22 {
158 MED_MESH_WRONLY_DRIVER22() ;
162 MED_MESH_WRONLY_DRIVER22(const string & fileName, MESH * ptrMesh, MED_EN::med_mode_acces access=MED_EN::WRONLY) ;
166 MED_MESH_WRONLY_DRIVER22(const MED_MESH_WRONLY_DRIVER22 & driver) ;
171 virtual ~MED_MESH_WRONLY_DRIVER22() ;
174 Write MESH in the specified file.
176 void write( void ) const;
179 int writeCoordinates () const;
180 int writeConnectivities (MED_EN::medEntityMesh entity) const;
181 void groupFamilyConverter(const vector<GROUP*>& groups,vector<FAMILY*>& families) const;
182 int writeFamilyNumbers () const;
183 int writeFamilies (vector<FAMILY*> & families) const;
184 int writeGRID() const;
186 GENDRIVER * copy ( void ) const ;
192 Driver Med for MESH : Read write.
193 - Use read method from MED_MESH_RDONLY_DRIVER
194 - Use write method from MED_MESH_WRONLY_DRIVER
198 class MED_MESH_RDWR_DRIVER22 : public IMED_MESH_RDWR_DRIVER, public MED_MESH_RDONLY_DRIVER22, public MED_MESH_WRONLY_DRIVER22 {
205 MED_MESH_RDWR_DRIVER22() ;
209 MED_MESH_RDWR_DRIVER22(const string & fileName, MESH * ptrMesh) ;
213 MED_MESH_RDWR_DRIVER22(const MED_MESH_RDWR_DRIVER22 & driver) ;
218 ~MED_MESH_RDWR_DRIVER22() ;
221 Write MESH in the specified file.
223 void write(void) const;
225 Read MESH in the specified file.
230 GENDRIVER * copy(void) const ;
235 #endif /* MED_MESH_DRIVER22_HXX */