Salome HOME
Fix for the #2716 comment 3 : make smash allow sub-solids selected, but "Apply" butto...
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchLabel.cpp
index 03007a3eb24a6cdede1c5d9d60baa8db2490bb91..14c7fbe576df29fc159cde3c618d86a771cc4900 100644 (file)
@@ -462,6 +462,19 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View
           isOwnerSet = true;
         }
       }
+      else {
+        aSelAttr->setValue(aFeature, GeomShapePtr());
+        GeomShapePtr aShape = aSelAttr->value();
+        if (!aShape.get() && aSelAttr->contextFeature().get() &&
+          aSelAttr->contextFeature()->firstResult().get()) {
+          aShape = aSelAttr->contextFeature()->firstResult()->shape();
+        }
+        if (aShape.get() && aShape->isPlanar()) {
+          const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
+          setSketchPlane(aTDShape);
+          isOwnerSet = true;
+        }
+      }
     }
   }
   return isOwnerSet;