X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSwig%2FMEDLoaderCommon.i;h=3a348ebde8ff090e0178ae1fa9b630b90dbbe5c3;hb=cdd09520be1ff9d51b7f67e39fb0866bb71db901;hp=818147457532b8f2e4a48e6d2a3596a7f9e34677;hpb=1137c0797d039c3368cb55560a1b047a6612cabc;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 818147457..3a348ebde 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -125,6 +125,8 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileUMesh::buildExtrudedMesh; %newobject MEDCoupling::MEDFileUMesh::linearToQuadratic; %newobject MEDCoupling::MEDFileUMesh::quadraticToLinear; +%newobject MEDCoupling::MEDFileUMesh::symmetry3DPlane; +%newobject MEDCoupling::MEDFileUMesh::Aggregate; %newobject MEDCoupling::MEDFileCMesh::New; %newobject MEDCoupling::MEDFileCurveLinearMesh::New; %newobject MEDCoupling::MEDFileMeshMultiTS::New; @@ -205,6 +207,7 @@ using namespace MEDCoupling; %newobject MEDCoupling::MEDFileData::getMeshes; %newobject MEDCoupling::MEDFileData::getFields; %newobject MEDCoupling::MEDFileData::getParams; +%newobject MEDCoupling::MEDFileData::Aggregate; %newobject MEDCoupling::MEDFileParameterDouble1TS::New; %newobject MEDCoupling::MEDFileParameterDouble1TS::deepCopy; @@ -1241,6 +1244,7 @@ namespace MEDCoupling // void setFamilyNameAttachedOnId(int id, const std::string& newFamName) throw(INTERP_KERNEL::Exception); void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception); + void setCoordsForced(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception); void eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception); void removeMeshAtLevel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception); void setMeshAtLevel(int meshDimRelToMax, MEDCoupling1GTUMesh *m) throw(INTERP_KERNEL::Exception); @@ -1394,6 +1398,34 @@ namespace MEDCoupling self->removeMeshAtLevel(meshDimRelToMax); } + MEDFileUMesh *symmetry3DPlane(PyObject *point, PyObject *normalVector) const throw(INTERP_KERNEL::Exception) + { + const char msg[]="Python wrap of MEDFileUMesh::symmetry3DPlane : "; + double val,val2; + DataArrayDouble *a,*a2; + DataArrayDoubleTuple *aa,*aa2; + std::vector bb,bb2; + int sw; + const double *centerPtr(convertObjToPossibleCpp5_Safe(point,sw,val,a,aa,bb,msg,1,3,true)); + const double *vectorPtr(convertObjToPossibleCpp5_Safe(normalVector,sw,val2,a2,aa2,bb2,msg,1,3,true)); + MCAuto ret(self->symmetry3DPlane(centerPtr,vectorPtr)); + return ret.retn(); + } + + static MEDFileUMesh *Aggregate(PyObject *meshes) throw(INTERP_KERNEL::Exception) + { + std::vector meshesCpp; + convertFromPyObjVectorOfObj(meshes,SWIGTYPE_p_MEDCoupling__MEDFileUMesh,"MEDFileUMesh",meshesCpp); + MCAuto ret(MEDFileUMesh::Aggregate(meshesCpp)); + return ret.retn(); + } + + PyObject *getAllDistributionOfTypes() const throw(INTERP_KERNEL::Exception) + { + std::vector< std::pair > ret(self->getAllDistributionOfTypes()); + return convertVecPairIntToPy(ret); + } + DataArrayInt *deduceNodeSubPartFromCellSubPart(PyObject *extractDef) const throw(INTERP_KERNEL::Exception) { std::map > extractDefCpp; @@ -2304,17 +2336,8 @@ namespace MEDCoupling PyObject *getIterations() const throw(INTERP_KERNEL::Exception) { - std::vector< std::pair > res=self->getIterations(); - PyObject *ret=PyList_New(res.size()); - int rk=0; - for(std::vector< std::pair >::const_iterator iter=res.begin();iter!=res.end();iter++,rk++) - { - PyObject *elt=PyTuple_New(2); - PyTuple_SetItem(elt,0,SWIG_From_int((*iter).first)); - PyTuple_SetItem(elt,1,SWIG_From_int((*iter).second)); - PyList_SetItem(ret,rk,elt); - } - return ret; + std::vector< std::pair > res(self->getIterations()); + return convertVecPairIntToPy(res); } PyObject *getTimeSteps() const throw(INTERP_KERNEL::Exception) @@ -3460,6 +3483,14 @@ namespace MEDCoupling std::vector< std::pair > modifTab=convertVecPairStStFromPy(li); return self->changeMeshNames(modifTab); } + + static MEDFileData *Aggregate(PyObject *mfds) throw(INTERP_KERNEL::Exception) + { + std::vector mfdsCpp; + convertFromPyObjVectorOfObj(mfds,SWIGTYPE_p_MEDCoupling__MEDFileData,"MEDFileData",mfdsCpp); + MCAuto ret(MEDFileData::Aggregate(mfdsCpp)); + return ret.retn(); + } } };