From: azv Date: Fri, 29 Dec 2017 05:32:19 +0000 (+0300) Subject: Fix the problem related to incorrect DoF calculation while moving any element of... X-Git-Tag: V_2.10.1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7628a2b34c6b45206aea13f789cc4784cbae4347;p=modules%2Fshaper.git Fix the problem related to incorrect DoF calculation while moving any element of a sketch --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp index aaf98ef90..09c18b1f9 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp @@ -237,12 +237,15 @@ void PlaneGCSSolver_Solver::addFictiveConstraintIfNecessary() if (myFictiveConstraint) return; // no need several fictive constraints + int aDOF = myDOF; double* aParam = createParameter(); double* aFictiveParameter = new double(0.0); myFictiveConstraint = new GCS::ConstraintEqual(aFictiveParameter, aParam); myFictiveConstraint->setTag(CID_FICTIVE); myEquationSystem->addConstraint(myFictiveConstraint); + // DoF should not be changed when adding fictive constraint + myDOF = aDOF; } void PlaneGCSSolver_Solver::removeFictiveConstraint() @@ -250,7 +253,6 @@ void PlaneGCSSolver_Solver::removeFictiveConstraint() if (myFictiveConstraint) { myEquationSystem->removeConstraint(myFictiveConstraint); myParameters.pop_back(); - --myDOF; GCS::VEC_pD aParams = myFictiveConstraint->params(); for (GCS::VEC_pD::iterator anIt = aParams.begin(); anIt != aParams.end(); ++ anIt)