1 // Copyright (C) 2007-2013 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 #include "MEDMEM_SkyLineArray.hxx"
25 using namespace MEDMEM;
27 int main (int argc, char ** argv) {
28 int NumberOfCell = 3 ; // 1 triangle,1 quadrangle,1 triangle
29 int Size = 10 ; // 10 nodes
31 int * index = new int[NumberOfCell+1] ;
36 int * value = new int[Size] ;
49 MEDSKYLINEARRAY * myArray = new MEDSKYLINEARRAY(NumberOfCell,Size,index,value) ;
51 cout << "Show all 1 :" << endl ;
52 for (int i=1; i<NumberOfCell+1 ; i++) {
53 const int * cell = myArray->getI(i) ;
54 int numberof = myArray->getNumberOfI(i) ;
56 for (int j=0;j<numberof;j++)
57 cout << cell[j] << " " ;
60 cout << "Show all 2 :" << endl ;
61 for (int i=1; i<NumberOfCell+1 ; i++) {
63 int numberof = myArray->getNumberOfI(i) ;
64 for (int j=1;j<numberof+1;j++)
65 cout << myArray->getIJ(i,j) << " " ;
69 MEDSKYLINEARRAY * myArray2 = new MEDSKYLINEARRAY(*myArray) ;
72 cout << "Show all 3 :" << endl ;
73 const int * index2 = myArray2->getIndex() ;
74 for (int i=1; i<=NumberOfCell ; i++) {
76 for (int j=index2[i-1];j<index2[i];j++)
77 cout << myArray2->getIndexValue(j) << " " ;