From: azv Date: Tue, 23 May 2017 11:35:17 +0000 (+0300) Subject: Issue #2151: Conflicting constraint when opening a study twice X-Git-Tag: V_2.7.1.1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d510608eb2fce025440cef0e27889a470658a5d7;p=modules%2Fshaper.git Issue #2151: Conflicting constraint when opening a study twice Avoid self-notifying of Middle-point and Collinear constraints while updating --- 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());