From: ageay Date: Mon, 14 Feb 2011 10:29:12 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V6_main_FINAL~1077 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa732cc6012aea84d5d9a8db99dabb9ed4098d8a;p=tools%2Fmedcoupling.git *** empty log message *** --- diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 1419a4f16..b1a69f29c 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -670,8 +670,16 @@ namespace ParaMEDMEM throw INTERP_KERNEL::Exception("getNodeIdsNearPoints : to tiny array ! must be at least of size SpaceDim*nbOfNodes !"); self->getNodeIdsNearPoints(pos,nbOfNodes,eps,c,cI); PyObject *ret=PyTuple_New(2); - PyTuple_SetItem(ret,0,convertIntArrToPyList2(c)); - PyTuple_SetItem(ret,1,convertIntArrToPyList2(cI)); + MEDCouplingAutoRefCountObjectPtr d0=DataArrayInt::New(); + MEDCouplingAutoRefCountObjectPtr d1=DataArrayInt::New(); + d0->alloc(c.size(),1); + d1->alloc(cI.size(),1); + std::copy(c.begin(),c.end(),d0->getPointer()); + std::copy(cI.begin(),cI.end(),d1->getPointer()); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(d0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(d1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + d0->incrRef(); + d1->incrRef(); return ret; } diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 7ccb6760c..2eab0e0d2 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -4901,8 +4901,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): c=mesh.getNodeIdsNearPoint(pts,1e-7); self.assertEqual([4,9,11],c); c,cI=mesh.getNodeIdsNearPoints(pts,3,1e-7); - self.assertEqual([0,3,3,4],cI); - self.assertEqual([4,9,11,6],c); + self.assertEqual([0,3,3,4],cI.getValues()); + self.assertEqual([4,9,11,6],c.getValues()); pass def testFieldCopyTinyAttrFrom1(self):