Salome HOME
#748 - move part problem
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 8bde3e6f8179e8e5a423b3e936447283f4a7990f..0d493f7f20f36032d55c98f80cd3e94b0263da21 100644 (file)
@@ -331,6 +331,20 @@ bool PartSet_Module::canRedo() const
   return aCanRedo;
 }
 
+bool PartSet_Module::canApplyAction(const ObjectPtr& theObject, const QString& theActionId) const
+{
+  bool aValid = true;
+  if (theActionId == "DELETE_CMD" || theActionId == "MOVE_CMD") {
+    FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+    if (aFeature) {
+      // part features are removed in the PartSet module only.
+      if (aFeature->getKind() == PartSetPlugin_Part::ID())
+        aValid = false;
+    }
+  }
+  return aValid;
+}
+
 bool PartSet_Module::canCommitOperation() const
 {
   return mySketchMgr->canCommitOperation();