]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make extrusions features correctly eat as a base a whole sketch feature selection.
authormpv <mpv@opencascade.com>
Mon, 20 Aug 2018 06:22:27 +0000 (09:22 +0300)
committermpv <mpv@opencascade.com>
Mon, 20 Aug 2018 06:22:27 +0000 (09:22 +0300)
src/Model/Model_AttributeSelection.cpp

index 847380c449691f31186433aedfe75260bffdd2fd..9d9fbb97b93b6f5f9288e12d5b43045cfb19f4fc 100644 (file)
@@ -353,20 +353,22 @@ std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::internalValue(CenterTyp
       if (aConstr->isInfinite())
         return aResult; // empty result
     }
-    // whole feature
-    FeaturePtr aFeature = contextFeature();
-    if (aFeature.get()) {
-      std::list<GeomShapePtr> allShapes;
-      std::list<ResultPtr>::const_iterator aRes = aFeature->results().cbegin();
-      for (; aRes != aFeature->results().cend(); aRes++) {
-        if (aRes->get() && !(*aRes)->isDisabled()) {
-          GeomShapePtr aShape = (*aRes)->shape();
-          if (aShape.get() && !aShape->isNull()) {
-            allShapes.push_back(aShape);
+    if (!aConstr.get()) { // for construction context, return empty result as usual even
+      // the whole feature is selected
+      FeaturePtr aFeature = contextFeature();
+      if (aFeature.get()) {
+        std::list<GeomShapePtr> allShapes;
+        std::list<ResultPtr>::const_iterator aRes = aFeature->results().cbegin();
+        for (; aRes != aFeature->results().cend(); aRes++) {
+          if (aRes->get() && !(*aRes)->isDisabled()) {
+            GeomShapePtr aShape = (*aRes)->shape();
+            if (aShape.get() && !aShape->isNull()) {
+              allShapes.push_back(aShape);
+            }
           }
         }
+        return GeomAlgoAPI_CompoundBuilder::compound(allShapes);
       }
-      return GeomAlgoAPI_CompoundBuilder::compound(allShapes);
     }
 
     Handle(TNaming_NamedShape) aSelection;