Salome HOME
Merge branch 'BR_internationalization'
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 2c127173d9a4f79e97afcdbcb90ac0a02c55e7e1..f53edf79b0b553ce577e56f3702a4375b11d7592 100755 (executable)
@@ -446,8 +446,9 @@ bool PartSet_Module::canApplyAction(const ObjectPtr& theObject, const QString& t
   if (theActionId == "MOVE_CMD") {
     FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
     if (aFeature) {
+      ResultPtr aResult = ModuleBase_Tools::firstResult(aFeature);
       // part features can not be moved in the history.
-      if (aFeature->getKind() == PartSetPlugin_Part::ID())
+      if (aResult.get() && aResult->groupName() == ModelAPI_ResultPart::group())
         aValid = false;
     }
   }
@@ -526,6 +527,14 @@ void PartSet_Module::activeSelectionModes(QIntList& theModes)
     PartSet_SketcherMgr::sketchSelectionModes(theModes);
 }
 
+void PartSet_Module::customSubShapesSelectionModes(QIntList& theTypes)
+{
+  if (theTypes.contains(TopAbs_FACE))
+    theTypes.append(SketcherPrs_Tools::Sel_Sketch_Face);
+  if (theTypes.contains(TopAbs_WIRE))
+    theTypes.append(SketcherPrs_Tools::Sel_Sketch_Wire);
+}
+
 bool PartSet_Module::isMouseOverWindow()
 {
   return mySketchMgr->isMouseOverWindow();
@@ -817,6 +826,8 @@ bool PartSet_Module::canCommitOperation() const
 void PartSet_Module::launchOperation(const QString& theCmdId)
 {
   storeConstraintsState(theCmdId.toStdString());
+  updateConstraintsState(theCmdId.toStdString());
+
   ModuleBase_IModule::launchOperation(theCmdId);
 }
 
@@ -828,6 +839,10 @@ void PartSet_Module::storeConstraintsState(const std::string& theFeatureKind)
                                                   mySketchMgr->showConstraintStates();
     myHasConstraintShown = aShownStates;
   }
+}
+
+void PartSet_Module::updateConstraintsState(const std::string& theFeatureKind)
+{
   if (PartSet_SketcherMgr::constraintsIdList().contains(theFeatureKind.c_str())) {
     // Show constraints if a constraint was anOperation
     mySketchMgr->updateBySketchParameters(PartSet_Tools::Geometrical, true);