From: spo Date: Wed, 3 Jun 2015 09:54:36 +0000 (+0300) Subject: Fix: SWIG std::list> problem X-Git-Tag: V_1.3.0~260 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2a572d7e8b762ef3baa4607e184a3c17a25246f4;p=modules%2Fshaper.git Fix: SWIG std::list> problem --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index c86c9a7a5..4f7402cf0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -49,4 +49,7 @@ %include "GeomAlgoAPI_ShapeProps.h" %include "GeomAlgoAPI_SketchBuilder.h" +%typemap(out) std::list< std::shared_ptr< GeomAPI_Shape > >::value_type & { + $result = SWIG_NewPointerObj(SWIG_as_voidptr(new std::shared_ptr(*$1)), $descriptor(std::shared_ptr *), SWIG_POINTER_OWN | 0 ); +} %template(ShapeList) std::list >; \ No newline at end of file diff --git a/src/PythonAPI/modeler/sketcher.py b/src/PythonAPI/modeler/sketcher.py index b0b3376c5..c9737224e 100644 --- a/src/PythonAPI/modeler/sketcher.py +++ b/src/PythonAPI/modeler/sketcher.py @@ -161,10 +161,10 @@ class Sketch(): dx = geomDataAPI_Dir( self.my.data().attribute("DirX") ).dir() n = geomDataAPI_Dir( self.my.data().attribute("Norm") ).dir() - self.faces = ShapeList() # The faces are kept otherwise they are destroyed at exit - GeomAlgoAPI_SketchBuilder.createFaces(o, dx, n, self.selection, self.faces) + faces = ShapeList() # The faces are kept otherwise they are destroyed at exit + GeomAlgoAPI_SketchBuilder.createFaces(o, dx, n, self.selection, faces) #TODO: Deal with several faces - return self.faces[0] + return faces[0] def result (self): """Returns the result data of this Feature."""