From: spo Date: Wed, 3 Jun 2015 09:54:36 +0000 (+0300) Subject: Fix: SWIG std::list> problem X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=338e025bbe85ee0c7f5b546be0e2fb55b3530e2b;p=modules%2Fshaper.git Fix: SWIG std::list> problem --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index f53434b4c..3c5f5a771 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -41,4 +41,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."""