]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2060: wrong constraint is conflicting with others error
authorazv <azv@opencascade.com>
Fri, 31 Mar 2017 09:52:31 +0000 (12:52 +0300)
committerazv <azv@opencascade.com>
Fri, 31 Mar 2017 09:52:31 +0000 (12:52 +0300)
Correct searching of constraints needed to set two lines collinear

src/SketchSolver/SketchSolver_ConstraintCollinear.cpp

index 555b77e5bb429cb74acc0ad7f64a94c31ec68559..9b37c03c616a834693c58c24f56fd4ac8b5d20d3 100644 (file)
@@ -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];
   }
 }