]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Module.cpp
Salome HOME
Issue #3262: Undo automatic constraint even several conflicting objects were sent
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 7aaeed01ac9bf5c6e1fce13962a0d8242668739c..eeb18584f342dc5f8d26077e92f3bf73e85267d8 100644 (file)
@@ -1859,29 +1859,25 @@ void PartSet_Module::enableCustomModes() {
 void PartSet_Module::onConflictingConstraints()
 {
   const std::set<ObjectPtr>& aConstraints = myOverconstraintListener->conflictingObjects();
-  if (aConstraints.size() == 1) {
-    QObjectPtrList aObjectsList;
-    std::set<ObjectPtr>::const_iterator aIt;
-    for (aIt = aConstraints.cbegin(); aIt != aConstraints.cend(); aIt++) {
-      if (mySketchReentrantMgr->isLastAutoConstraint(*aIt))
-        aObjectsList.append(*aIt);
-    }
-    if (aObjectsList.size() > 0) {
-      XGUI_Workshop* aWorkshop = getWorkshop();
-      QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text();
-      ModuleBase_Operation* anOpAction = new ModuleBase_Operation(aDescription);
-      XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
-
-      ModuleBase_Operation* anOp = anOpMgr->currentOperation();
-      if (sketchMgr()->isNestedSketchOperation(anOp))
-        anOp->abort();
+  QObjectPtrList aObjectsList;
+  std::set<ObjectPtr>::const_iterator aIt;
+  for (aIt = aConstraints.cbegin(); aIt != aConstraints.cend(); aIt++) {
+    if (mySketchReentrantMgr->isLastAutoConstraint(*aIt))
+      aObjectsList.append(*aIt);
+  }
+  if (aObjectsList.size() > 0) {
+    XGUI_Workshop* aWorkshop = getWorkshop();
+    QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text();
+    ModuleBase_Operation* anOpAction = new ModuleBase_Operation(aDescription);
+    XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
 
-      anOpMgr->startOperation(anOpAction);
-      aWorkshop->deleteFeatures(aObjectsList);
-      anOpMgr->commitOperation();
-      ModuleBase_Tools::flushUpdated(sketchMgr()->activeSketch());
+    ModuleBase_Operation* anOp = anOpMgr->currentOperation();
+    if (sketchMgr()->isNestedSketchOperation(anOp))
+      anOp->abort();
 
-      myWorkshop->viewer()->update();
-    }
+    anOpMgr->startOperation(anOpAction);
+    aWorkshop->deleteFeatures(aObjectsList);
+    anOpMgr->commitOperation();
+    ModuleBase_Tools::flushUpdated(sketchMgr()->activeSketch());
   }
 }