]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2151: Conflicting constraint when opening a study twice
authorazv <azv@opencascade.com>
Tue, 23 May 2017 11:35:17 +0000 (14:35 +0300)
committerazv <azv@opencascade.com>
Tue, 23 May 2017 11:35:17 +0000 (14:35 +0300)
Avoid self-notifying of Middle-point and Collinear constraints while updating

src/SketchSolver/SketchSolver_ConstraintCollinear.cpp
src/SketchSolver/SketchSolver_ConstraintMiddle.cpp

index 9b37c03c616a834693c58c24f56fd4ac8b5d20d3..d084f8b7d96eeb28fb5204a60ac94b5ba71ca96a 100644 (file)
@@ -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<PlaneGCSSolver_UpdateCoincidence*>(theUpdater);
 
index e5388276c4b61db0b069f30d6a9f2aab631d66d5..2a1c1c421079065910f621727c88fdb5a78a9da4 100644 (file)
@@ -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<PlaneGCSSolver_UpdateCoincidence*>(theUpdater);
   bool isAccepted = anUpdater->addCoincidence(myAttributes.front(), myAttributes.back());