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 MEDMEM_WRAPPER_CONNECTIVITY_HXX
23 #define MEDMEM_WRAPPER_CONNECTIVITY_HXX
25 #include "MEDMEM_Connectivity.hxx"
29 //////////////////////////////////////////////////////////////////
31 /// DECLARATIONS ET CODE ///
33 //////////////////////////////////////////////////////////////////
35 /*********************************************************/
37 /* Wrapper_Med_Connectivity */
39 /*********************************************************/
41 // obligé de faire de la recopie car MED n'utilise pas la numérotation standart C
43 class Wrapper_Med_Connectivity
49 vector< int* > premier_pointeur;
52 ~Wrapper_Med_Connectivity() {if (mailles) delete [] mailles;}
53 Wrapper_Med_Connectivity():mailles(NULL) {}
54 Wrapper_Med_Connectivity(MEDMEM::CONNECTIVITY * maillesmed)
56 const int * tab_sommets_mailles=maillesmed->getConnectivity(MED_EN::MED_NODAL, MED_EN::MED_CELL, MED_EN::MED_ALL_ELEMENTS);
57 const int * med_index=maillesmed->getValueIndex(MED_EN::MED_FULL_INTERLACE);
58 nbr_mailles=maillesmed->getNumberOf(MED_EN::MED_CELL,MED_EN::MED_ALL_ELEMENTS);
59 int size=med_index[nbr_mailles]-med_index[0];
60 types.resize(nbr_mailles);
61 premier_pointeur.resize(nbr_mailles);
62 mailles=new int[size];
66 mailles[i]=tab_sommets_mailles[i]-1;
68 for (i=0;i<nbr_mailles;i++)
70 types[i]=maillesmed->getElementType(MED_EN::MED_CELL,i+1); // A VERIFIER : le +1
71 premier_pointeur[i]=&mailles[med_index[i]-1]; // A VERIFIER : la formule
74 // Méthodes de la politique
75 inline int SIZE() {return nbr_mailles;}
76 inline int DONNE_TYPE_MAILLE(int i) {return types[i];}
77 inline int * DONNE_PREMIER_POINTEUR(int i) {return premier_pointeur[i];}