Salome HOME
Copyrights update
[modules/med.git] / src / MEDMEM / test_MEDMEM_PolyhedronArray.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20 // This program test the implementation of the POLYHEDRONARRAY class. //
21
22 #include "MEDMEM_PolyhedronArray.hxx"
23
24 using namespace std;
25 using namespace MEDMEM;
26 using namespace MED_EN;
27
28 int main(void)
29 {
30   POLYHEDRONARRAY myPArray(2,11,40);
31   med_int polyhedronindex[2] = {1,7};
32   med_int facesindex[11] = {1,5,9,13,17,21,25,28,31,34,37};
33   med_int nodes[40] = {1,2,6,5,2,3,7,6,4,3,7,8,1,4,8,5,1,2,3,4,5,6,7,8,5,6,9,6,7,9,7,8,9,8,5,9,5,6,7,8};
34
35   myPArray.setPolyhedronIndex(polyhedronindex);
36   myPArray.setFacesIndex(facesindex);
37   myPArray.setNodes(nodes);
38
39   POLYHEDRONARRAY myPArray2(myPArray);
40
41   const med_int* __polyhedronindex = myPArray2.getPolyhedronIndex();
42   const med_int* __facesindex = myPArray2.getFacesIndex();
43   const med_int* __nodes = myPArray2.getNodes();
44
45   cout << "__polyhedronindex =" << endl;
46   for (int i=0; i<2; i++)
47     cout << __polyhedronindex[i] << endl;
48   cout << "__facesindex =" << endl;
49   for (int i=0; i<11; i++)
50     cout << __facesindex[i] << endl;
51   cout << "__nodes =" << endl;
52   for (int i=0; i<40; i++)
53     cout << __nodes[i] << endl;
54
55   return 0;
56 }