]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Freeze when canceling conflicting constraint (issue #1688)
authorazv <azv@opencascade.com>
Wed, 31 Aug 2016 09:12:32 +0000 (12:12 +0300)
committerazv <azv@opencascade.com>
Wed, 31 Aug 2016 09:12:32 +0000 (12:12 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp

index d0f503aba13e3b6764d3a917a1b3e8d42978a8a4..c522bbacc212b47074aabfa1062bf9813ccc3ee6 100644 (file)
@@ -183,14 +183,13 @@ GCS::SolveStatus PlaneGCSSolver_Solver::solveWithoutTangent()
   if (aResult == GCS::Success) {
     GCS::VEC_I aRedundant;
     aSystemWithoutTangent->getRedundant(aRedundant);
-    if (aRedundant.empty())
-      myEquationSystem = aSystemWithoutTangent;
-    else
+    if (!aRedundant.empty())
       aResult = GCS::Failed;
   }
 
   // additional check that removed constraints are still correct
   if (aResult == GCS::Success) {
+    aSystemWithoutTangent->applySolution();
     std::set<GCS::Constraint*>::const_iterator aRemIt = aRemovedTangent.begin();
     for (; aRemIt != aRemovedTangent.end(); ++aRemIt)
       if (!isTangentTruth(*aRemIt))
@@ -199,8 +198,10 @@ GCS::SolveStatus PlaneGCSSolver_Solver::solveWithoutTangent()
       aResult = GCS::Failed;
   }
 
-  // Add IDs of removed tangent to the list of conflicting constraints
-  if (aResult == GCS::Failed) {
+  if (aResult == GCS::Success)
+      myEquationSystem = aSystemWithoutTangent;
+  else {
+    // Add IDs of removed tangent to the list of conflicting constraints
     std::set<GCS::Constraint*>::const_iterator aRemIt = aRemovedTangent.begin();
     for (; aRemIt != aRemovedTangent.end(); ++aRemIt)
       myConflictingIDs.insert((*aRemIt)->getTag());