]> 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>
Fri, 5 Jun 2015 10:45:31 +0000 (13:45 +0300)
src/GeomAlgoAPI/GeomAlgoAPI.i
src/PythonAPI/modeler/sketcher.py

index f53434b4cd31a7f7ba6364589be72b606fccc8ca..3c5f5a7712f43755629cdbb88e29057aaedc17ab 100644 (file)
@@ -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<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."""