From 8a1df15b9e0bc63ea753bd8056f2f0df3f3973e2 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 5 May 2017 08:05:10 +0200 Subject: [PATCH] Correct error in wrapping --- src/MEDCoupling_Swig/MEDCouplingCommon.i | 31 ++++++++++++++++--- .../MEDPartitionerCommon.i | 18 +++++++++-- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index f66c2106c..653f5af58 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -427,6 +427,9 @@ using namespace INTERP_KERNEL; %newobject MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell; %newobject MEDCoupling::MEDCouplingGaussLocalization::buildRefCell; %newobject MEDCoupling::MEDCouplingSkyLineArray::BuildFromPolyhedronConn; +%newobject MEDCoupling::MEDCouplingSkyLineArray::getSuperIndexArray; +%newobject MEDCoupling::MEDCouplingSkyLineArray::getIndexArray; +%newobject MEDCoupling::MEDCouplingSkyLineArray::getValuesArray; %feature("unref") MEDCouplingPointSet "$this->decrRef();" %feature("unref") MEDCouplingMesh "$this->decrRef();" @@ -1216,10 +1219,6 @@ namespace MEDCoupling int getNumberOf() const; int getLength() const; - DataArrayInt* getSuperIndexArray() const; - DataArrayInt* getIndexArray() const; - DataArrayInt* getValuesArray() const; - void deletePack(const int i, const int j) throw(INTERP_KERNEL::Exception); %extend @@ -1248,6 +1247,30 @@ namespace MEDCoupling { return self->simpleRepr(); } + + DataArrayInt *getSuperIndexArray() const + { + DataArrayInt *ret(self->getSuperIndexArray()); + if(ret) + ret->incrRef(); + return ret; + } + + DataArrayInt *getIndexArray() const + { + DataArrayInt *ret(self->getIndexArray()); + if(ret) + ret->incrRef(); + return ret; + } + + DataArrayInt *getValuesArray() const + { + DataArrayInt *ret(self->getValuesArray()); + if(ret) + ret->incrRef(); + return ret; + } PyObject *getSimplePackSafe(int absolutePackId) const throw(INTERP_KERNEL::Exception) { diff --git a/src/MEDPartitioner_Swig/MEDPartitionerCommon.i b/src/MEDPartitioner_Swig/MEDPartitionerCommon.i index 7ecf24f86..350ac7555 100644 --- a/src/MEDPartitioner_Swig/MEDPartitionerCommon.i +++ b/src/MEDPartitioner_Swig/MEDPartitionerCommon.i @@ -38,6 +38,8 @@ using namespace MEDPARTITIONER; %newobject MEDPARTITIONER::MEDPartitioner::New; %newobject MEDPARTITIONER::MEDPartitioner::Graph; +%newobject MEDPARTITIONER::MEDPartitioner::Graph::getGraph; +%newobject MEDPARTITIONER::MEDPartitioner::Graph::getPartition; %newobject MEDPARTITIONER::MEDPartitioner::getMEDFileData; %feature("unref") MEDCoupling::MEDFileData "$this->decrRef();" @@ -53,8 +55,20 @@ namespace MEDPARTITIONER typedef enum {METIS,SCOTCH} splitter_type; public: virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception); - const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const; - const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const; + MEDCoupling::MEDCouplingSkyLineArray *getGraph() const + { + const MEDCoupling::MEDCouplingSkyLineArray *ret(self->getGraph()); + if(ret) + ret->incrRef(); + return const_cast(ret); + } + const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const + { + const MEDCoupling::MEDCouplingSkyLineArray *ret(self->getPartition()); + if(ret) + ret->incrRef(); + return const_cast(ret); + } int nbVertices() const; }; -- 2.39.2