From 2471cea8db8e8cf7461280982a754e12ed485ab6 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 31 Aug 2016 13:23:07 +0300 Subject: [PATCH] Issue #1674: correct processing the case when removing one of conflicting constraints and the system is still inconsistent --- src/SketchSolver/SketchSolver_Group.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SketchSolver/SketchSolver_Group.cpp b/src/SketchSolver/SketchSolver_Group.cpp index e8dfdc975..0c6017cb5 100644 --- a/src/SketchSolver/SketchSolver_Group.cpp +++ b/src/SketchSolver/SketchSolver_Group.cpp @@ -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 aConflicting = myStorage->getConflictingConstraints(mySketchSolver); - if (myConflictingConstraints.empty()) - sendMessage(EVENT_SOLVER_FAILED, aConflicting); - else { + if (!myConflictingConstraints.empty()) { std::set::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; } } -- 2.39.2