From: Anthony Geay Date: Wed, 28 Apr 2021 20:36:44 +0000 (+0200) Subject: Useful python function to transfert data without copy from SMESH X-Git-Tag: V9_8_0a1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a6d5d20bab45e6ff57447bcc4151a09bdf1d7f45;p=tools%2Fmedcoupling.git Useful python function to transfert data without copy from SMESH --- diff --git a/src/MEDCoupling_Swig/MEDCouplingMemArray.i b/src/MEDCoupling_Swig/MEDCouplingMemArray.i index a3f3ffb73..b567b4fc8 100644 --- a/src/MEDCoupling_Swig/MEDCouplingMemArray.i +++ b/src/MEDCoupling_Swig/MEDCouplingMemArray.i @@ -326,6 +326,8 @@ %newobject MEDCoupling::DataArrayPartDefinition::New; %newobject MEDCoupling::SlicePartDefinition::New; +%newobject FromPyIntPtrToDataArrayByte; + %feature("unref") DataArray "$this->decrRef();" %feature("unref") DataArrayDouble "$this->decrRef();" @@ -3698,10 +3700,21 @@ typedef DataArrayInt64 DataArrayIdType; } } }; + +} + +%inline +{ + MEDCoupling::DataArrayByte *FromPyIntPtrToDataArrayByte(long intPtr) + { + MEDCoupling::DataArrayByte *ret(reinterpret_cast(intPtr)); + return ret; + } } %include "DataArrayInt.i" + %pythoncode %{ def MEDCouplingStdReduceFunct(cls,params): a,b=params