From: ageay Date: Fri, 4 May 2012 12:29:03 +0000 (+0000) Subject: Profiles and Localization management. X-Git-Tag: V6_5_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=94d82de7c2ae414b28e706425834e685e06ee732;p=tools%2Fmedcoupling.git Profiles and Localization management. --- diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index 3902da9b2..148c2a1b6 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -692,10 +692,41 @@ namespace ParaMEDMEM return convertVecPairVecStToPy(ret); } - //void changePflsNamesInStruct(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); - //void changeLocsNamesInStruct(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); - //void changePflsNames(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); - //void changeLocsNames(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); + void changePflsNames(PyObject *li) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); + self->changePflsNames(v); + } + + void changePflsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); + self->changePflsRefsNamesGen(v); + } + + void changePflsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); + self->changePflsNamesInStruct(v); + } + + void changeLocsNames(PyObject *li) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); + self->changeLocsNames(v); + } + + void changeLocsRefsNamesGen(PyObject *li) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); + self->changeLocsRefsNamesGen(v); + } + + void changeLocsNamesInStruct(PyObject *li) throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair, std::string > > v=convertVecPairVecStFromPy(li); + self->changeLocsNamesInStruct(v); + } } }; diff --git a/src/MEDLoader/Swig/MEDLoaderTypemaps.i b/src/MEDLoader/Swig/MEDLoaderTypemaps.i index 08baefdec..3a18f44fc 100644 --- a/src/MEDLoader/Swig/MEDLoaderTypemaps.i +++ b/src/MEDLoader/Swig/MEDLoaderTypemaps.i @@ -204,3 +204,53 @@ PyObject *convertVecPairVecStToPy(const std::vector< std::pair, std::string > > convertVecPairVecStFromPy(PyObject *pyLi) +{ + std::vector< std::pair, std::string > > ret; + const char *msg="convertVecPairVecStFromPy : Expecting PyList of Tuples of size 2 ! The first elt in tupe is a list of strings and the 2nd one a string !"; + if(PyList_Check(pyLi)) + { + int size=PyList_Size(pyLi); + ret.resize(size); + for(int i=0;i, std::string> p; + int size2=PyTuple_Size(o); + if(size2!=2) + throw INTERP_KERNEL::Exception(msg); + PyObject *o0=PyTuple_GetItem(o,0); + if(PyList_Check(o0)) + { + int size2=PyList_Size(o0); + p.first.resize(size2); + for(int j=0;j