From: azv Date: Wed, 31 Aug 2016 10:23:07 +0000 (+0300) Subject: Issue #1674: correct processing the case when removing one of conflicting constraints... X-Git-Tag: V_2.5.0~98 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2471cea8db8e8cf7461280982a754e12ed485ab6;p=modules%2Fshaper.git Issue #1674: correct processing the case when removing one of conflicting constraints and the system is still inconsistent --- 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; } }