From d510608eb2fce025440cef0e27889a470658a5d7 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 23 May 2017 14:35:17 +0300 Subject: [PATCH] Issue #2151: Conflicting constraint when opening a study twice Avoid self-notifying of Middle-point and Collinear constraints while updating --- src/SketchSolver/SketchSolver_ConstraintCollinear.cpp | 3 +++ src/SketchSolver/SketchSolver_ConstraintMiddle.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp index 9b37c03c6..d084f8b7d 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCollinear.cpp @@ -62,6 +62,9 @@ void SketchSolver_ConstraintCollinear::process() void SketchSolver_ConstraintCollinear::notify(const FeaturePtr& theFeature, PlaneGCSSolver_Update* theUpdater) { + if (theFeature == myBaseConstraint) + return; // the constraint is already being updated + PlaneGCSSolver_UpdateCoincidence* anUpdater = static_cast(theUpdater); diff --git a/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp b/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp index e5388276c..2a1c1c421 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMiddle.cpp @@ -14,6 +14,9 @@ void SketchSolver_ConstraintMiddle::getAttributes( void SketchSolver_ConstraintMiddle::notify(const FeaturePtr& theFeature, PlaneGCSSolver_Update* theUpdater) { + if (theFeature == myBaseConstraint) + return; // the constraint is already being updated + PlaneGCSSolver_UpdateCoincidence* anUpdater = static_cast(theUpdater); bool isAccepted = anUpdater->addCoincidence(myAttributes.front(), myAttributes.back()); -- 2.39.2