X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingTypemaps.i;h=5880fc975b182b2ba55138578388dddc9b5df281;hb=62a3e1a7f12332a2fd01f5751b9f5ca99b8727e1;hp=b2e7702c1baea0d7b5b96829f887a6a811bbaf8c;hpb=659f8c67d0348350e12fde38fe8c4de1ff95dffe;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i index b2e7702c1..5880fc975 100644 --- a/src/MEDCoupling_Swig/MEDCouplingTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingTypemaps.i @@ -40,6 +40,8 @@ static PyObject *convertMesh(ParaMEDMEM::MEDCouplingMesh *mesh, int owner) throw ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCMesh,owner); if(dynamic_cast(mesh)) ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingCurveLinearMesh,owner); + if(dynamic_cast(mesh)) + ret=SWIG_NewPointerObj((void*)mesh,SWIGTYPE_p_ParaMEDMEM__MEDCouplingIMesh,owner); if(!ret) throw INTERP_KERNEL::Exception("Not recognized type of mesh on downcast !"); return ret; @@ -83,6 +85,71 @@ static PyObject* convertMultiFields(ParaMEDMEM::MEDCouplingMultiFields *mfs, int return ret; } +static PyObject *convertPartDefinition(ParaMEDMEM::PartDefinition *pd, int owner) throw(INTERP_KERNEL::Exception) +{ + PyObject *ret=0; + if(!pd) + { + Py_XINCREF(Py_None); + return Py_None; + } + if(dynamic_cast(pd)) + ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_ParaMEDMEM__DataArrayPartDefinition,owner); + else + ret=SWIG_NewPointerObj((void*)pd,SWIGTYPE_p_ParaMEDMEM__SlicePartDefinition,owner); + return ret; +} + +static PyObject *convertCartesianAMRMesh(ParaMEDMEM::MEDCouplingCartesianAMRMeshGen *mesh, int owner) throw(INTERP_KERNEL::Exception) +{ + if(!mesh) + { + Py_XINCREF(Py_None); + return Py_None; + } + if(dynamic_cast(mesh)) + { + return SWIG_NewPointerObj(reinterpret_cast(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMeshSub,owner); + } + if(dynamic_cast(mesh)) + { + return SWIG_NewPointerObj(reinterpret_cast(mesh),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRMesh,owner); + } + throw INTERP_KERNEL::Exception("convertCartesianAMRMesh wrap : unrecognized type of cartesian AMR mesh !"); +} + +static PyObject *convertDataForGodFather(ParaMEDMEM::MEDCouplingDataForGodFather *data, int owner) throw(INTERP_KERNEL::Exception) +{ + if(!data) + { + Py_XINCREF(Py_None); + return Py_None; + } + if(dynamic_cast(data)) + { + return SWIG_NewPointerObj(reinterpret_cast(data),SWIGTYPE_p_ParaMEDMEM__MEDCouplingAMRAttribute,owner); + } + throw INTERP_KERNEL::Exception("convertDataForGodFather wrap : unrecognized data type for AMR !"); +} + +static PyObject *convertCartesianAMRPatch(ParaMEDMEM::MEDCouplingCartesianAMRPatchGen *patch, int owner) throw(INTERP_KERNEL::Exception) +{ + if(!patch) + { + Py_XINCREF(Py_None); + return Py_None; + } + if(dynamic_cast(patch)) + { + return SWIG_NewPointerObj(reinterpret_cast(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatchGF,owner); + } + if(dynamic_cast(patch)) + { + return SWIG_NewPointerObj(reinterpret_cast(patch),SWIGTYPE_p_ParaMEDMEM__MEDCouplingCartesianAMRPatch,owner); + } + throw INTERP_KERNEL::Exception("convertCartesianAMRPatch wrap : unrecognized type of cartesian AMR patch !"); +} + static ParaMEDMEM::MEDCouplingFieldDouble *ParaMEDMEM_MEDCouplingFieldDouble___add__Impl(ParaMEDMEM::MEDCouplingFieldDouble *self, PyObject *obj) throw(INTERP_KERNEL::Exception) { const char msg[]="Unexpected situation in MEDCouplingFieldDouble.__add__ ! Expecting a not null MEDCouplingFieldDouble or DataArrayDouble or DataArrayDoubleTuple instance, or a list of double, or a double.";