1 // MED MEDMEM : MED files in memory
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : test_MEDMEM_CellModel.cxx
28 #include "utilities.h"
29 #include "MEDMEM_CellModel.hxx"
30 #include "MEDMEM_DriversDef.hxx"
32 int main (int argc, char ** argv) {
33 list<MED_FR::med_geometrie_element> geomList = MED_FR::meshEntities[MED_FR::MED_MAILLE] ;
34 list<MED_FR::med_geometrie_element>::iterator itGeomList ;
35 for(itGeomList=geomList.begin();itGeomList!=geomList.end();itGeomList++) {
36 CELLMODEL myCellModel((MED_EN::medGeometryElement)(*itGeomList)) ;
38 cout << "First CellModel :" << endl << endl ;
40 cout << myCellModel << endl ;
42 cout << "Number of constituents type : "<<myCellModel.getNumberOfConstituentsType() << endl ;
44 set <medGeometryElement> geomType = myCellModel.getAllConstituentsType() ;
45 set <medGeometryElement>::iterator geomTypeIt ;
46 cout << "Types list : " ;
47 for(geomTypeIt=geomType.begin();geomTypeIt!=geomType.end();geomTypeIt++)
48 cout << (*geomTypeIt) << " " ;
51 map <medGeometryElement,int> myMap = myCellModel.getNumberOfConstituentsForeachType() ;
52 map <medGeometryElement,int>::iterator myMapIt ;
53 for(myMapIt=myMap.begin();myMapIt!=myMap.end();myMapIt++)
54 cout << " - " << (*myMapIt).second << " constituent(s) of type " << (*myMapIt).first << endl ;
57 cout << "Second CellModel :" << endl << endl ;
58 CELLMODEL myCellModel2=myCellModel ;
59 cout << myCellModel2 << endl ;
61 cout << "Third CellModel :" << endl << endl ;
62 CELLMODEL myCellModel3 ;
63 myCellModel3=myCellModel ;
64 cout << myCellModel3 << endl ;