From: azv Date: Fri, 31 Mar 2017 09:52:31 +0000 (+0300) Subject: Issue #2060: wrong constraint is conflicting with others error X-Git-Tag: V_2.7.0~116 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2a04cc53e744e4bc897b37d48f65f7dfeed83f0;p=modules%2Fshaper.git Issue #2060: wrong constraint is conflicting with others error Correct searching of constraints needed to set two lines collinear --- diff --git a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp index 555b77e5b..9b37c03c6 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp @@ -110,9 +110,12 @@ void SketchSolver_ConstraintCollinear::notify(const FeaturePtr& theFeature, } bool isNew = false; - for (int i = 0; i < 4 && !isNew; ++i) + for (int i = 0; i < 4; ++i) { if (aConstraintToApply[i] != myIsConstraintApplied[i]) isNew = true; + myIsConstraintApplied[i] = aConstraintToApply[i]; + } + if (isNew) { mySolverConstraint = createPointsOnLine(aPoints[0], aPoints[1], aLine); if (myInSolver) { @@ -123,8 +126,5 @@ void SketchSolver_ConstraintCollinear::notify(const FeaturePtr& theFeature, myStorage->addConstraint(myBaseConstraint, mySolverConstraint); myInSolver = true; } - - for (int i = 0; i < 4; ++i) - myIsConstraintApplied[i] = aConstraintToApply[i]; } }