]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1674: correct processing the case when removing one of conflicting constraints...
authorazv <azv@opencascade.com>
Wed, 31 Aug 2016 10:23:07 +0000 (13:23 +0300)
committerazv <azv@opencascade.com>
Wed, 31 Aug 2016 10:23:48 +0000 (13:23 +0300)
src/SketchSolver/SketchSolver_Group.cpp

index e8dfdc97521fbe28eb473ac39ee21a1353043785..0c6017cb587b1bb6e29d7e7407dcfcf533433da1 100644 (file)
@@ -407,13 +407,11 @@ bool SketchSolver_Group::resolveConstraints()
       if (!myConstraints.empty()) {
         // the error message should be changed before sending the message
         getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(SketchSolver_Error::CONSTRAINTS());
-        if (myPrevResult != aResult || myPrevResult == STATUS_UNKNOWN) {
+        if (myPrevResult != aResult || myPrevResult == STATUS_UNKNOWN || myPrevResult == STATUS_FAILED) {
           // Obtain list of conflicting constraints
           std::set<ObjectPtr> aConflicting = myStorage->getConflictingConstraints(mySketchSolver);
 
-          if (myConflictingConstraints.empty())
-            sendMessage(EVENT_SOLVER_FAILED, aConflicting);
-          else {
+          if (!myConflictingConstraints.empty()) {
             std::set<ObjectPtr>::iterator anIt = aConflicting.begin();
             for (; anIt != aConflicting.end(); ++anIt)
               myConflictingConstraints.erase(*anIt);
@@ -423,6 +421,8 @@ bool SketchSolver_Group::resolveConstraints()
             }
           }
           myConflictingConstraints = aConflicting;
+          if (!myConflictingConstraints.empty())
+            sendMessage(EVENT_SOLVER_FAILED, myConflictingConstraints);
           myPrevResult = aResult;
         }
       }