From: azv Date: Wed, 31 Aug 2016 09:12:32 +0000 (+0300) Subject: Freeze when canceling conflicting constraint (issue #1688) X-Git-Tag: V_2.5.0~100 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b0319882ff12b3c6b3832e023b6719fb688eef80;p=modules%2Fshaper.git Freeze when canceling conflicting constraint (issue #1688) --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp index d0f503aba..c522bbacc 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp @@ -183,14 +183,13 @@ GCS::SolveStatus PlaneGCSSolver_Solver::solveWithoutTangent() if (aResult == GCS::Success) { GCS::VEC_I aRedundant; aSystemWithoutTangent->getRedundant(aRedundant); - if (aRedundant.empty()) - myEquationSystem = aSystemWithoutTangent; - else + if (!aRedundant.empty()) aResult = GCS::Failed; } // additional check that removed constraints are still correct if (aResult == GCS::Success) { + aSystemWithoutTangent->applySolution(); std::set::const_iterator aRemIt = aRemovedTangent.begin(); for (; aRemIt != aRemovedTangent.end(); ++aRemIt) if (!isTangentTruth(*aRemIt)) @@ -199,8 +198,10 @@ GCS::SolveStatus PlaneGCSSolver_Solver::solveWithoutTangent() aResult = GCS::Failed; } - // Add IDs of removed tangent to the list of conflicting constraints - if (aResult == GCS::Failed) { + if (aResult == GCS::Success) + myEquationSystem = aSystemWithoutTangent; + else { + // Add IDs of removed tangent to the list of conflicting constraints std::set::const_iterator aRemIt = aRemovedTangent.begin(); for (; aRemIt != aRemovedTangent.end(); ++aRemIt) myConflictingIDs.insert((*aRemIt)->getTag());