]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Roll back the Compisite feature: too serious swig problem
authormpv <mpv@opencascade.com>
Mon, 2 Mar 2015 12:08:24 +0000 (15:08 +0300)
committermpv <mpv@opencascade.com>
Mon, 2 Mar 2015 12:08:24 +0000 (15:08 +0300)
src/ModelAPI/ModelAPI.i
src/PythonFeaturesPlugin/PythonFeaturesPlugin_Box.py
src/PythonFeaturesPlugin/extrusion.py

index a6956f15603e3b9f58212f1e2cd5af17af17af38..ff4b9e7adaea62d7dc512f267b4ae77030c84cbc 100644 (file)
@@ -63,6 +63,7 @@
 %feature("director") ModelAPI_Plugin;
 %feature("director") ModelAPI_Object;
 %feature("director") ModelAPI_Feature;
+%feature("director") ModelAPI_CompositeFeature;
 %feature("director") ModelAPI_Data;
 
 // shared pointers
index d84e3394ff9a0dc97f262ca5ec72b90fcc4a3cae..a8b79c9ea39a014347daca5e17a60ed1ed6aeb2e 100644 (file)
@@ -5,7 +5,7 @@ import extrusion
 import sketch
 
 
-class PythonFeaturesPlugin_Box(ModelAPI.ModelAPI_CompositeFeature):
+class PythonFeaturesPlugin_Box(ModelAPI.ModelAPI_Feature):
 
     "Feature to create a box by drawing a sketch and extruding it"
 
@@ -123,25 +123,6 @@ class PythonFeaturesPlugin_Box(ModelAPI.ModelAPI_CompositeFeature):
         self.reference(self.HEIGHT_REF_ID()).setValue(aHeightFeature.firstResult())
         return aHeightFeature
 
-    def addFeature(self, theID):
-        pass
-
-    def numberOfSubs(self):
-        # extrusion and sketch
-        return 2
-
-    def subFeature(self, theIndex):
-        if theIndex = 1: # sketch
-          return self.mySketch
-        return self.myExtrusion
-
-    def subFeatureId(self, theIndex):
-        return 0
-
-    def isSub(self, theFeature):
-        if theFeature = self.mySketch or theFeature = self.myExtrusion:
-          return True
-        return False
 
 # TEST
 """
index 9008479a07d13146e63599860b7e1050b6b6014b..225bd9e1233ca19a5c3e9be0456046304f4c08e8 100644 (file)
@@ -5,6 +5,8 @@ def addNew(builder, length, part, edges=None, reverse=False):
     feature = part.addFeature("Extrusion")
     feature.selection("extrusion_face").setValue(builder.geometry(),
                                                  builder.face())
+    if length < 0.0000001:
+      length = 50
     feature.real("extrusion_size").setValue(length)
     feature.boolean("extrusion_reverse").setValue(reverse)
     feature.execute()