]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix: SWIG std::list<std::shared_ptr<GeomAPI_Shape>> problem
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 3 Jun 2015 09:54:36 +0000 (12:54 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Tue, 9 Jun 2015 13:37:46 +0000 (16:37 +0300)
src/GeomAlgoAPI/GeomAlgoAPI.i
src/PythonAPI/modeler/sketcher.py

index c86c9a7a55d84bec374dcd6d586a3632568f3139..4f7402cf0718e04e7243cba55343466bc480a5fc 100644 (file)
@@ -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<GeomAPI_Shape>(*$1)), $descriptor(std::shared_ptr<GeomAPI_Shape> *), SWIG_POINTER_OWN | 0 );
+}
 %template(ShapeList) std::list<std::shared_ptr<GeomAPI_Shape> >;
\ No newline at end of file
index b0b3376c53d571ca55763dc4dc5126c027cf7cb8..c9737224ea2ec566efc24277c2b4c52283aa74f6 100644 (file)
@@ -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."""