]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix the problem related to incorrect DoF calculation while moving any element of...
authorazv <azv@opencascade.com>
Fri, 29 Dec 2017 05:32:19 +0000 (08:32 +0300)
committerazv <azv@opencascade.com>
Fri, 29 Dec 2017 05:33:17 +0000 (08:33 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp

index aaf98ef90338ecbba27928e511662b187a6efaa7..09c18b1f9b958927461f90907053e5c6c32d4b8b 100644 (file)
@@ -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)