From: azv Date: Thu, 2 Jul 2015 14:27:16 +0000 (+0300) Subject: Issue #639: Detaching of lines and moving is fixed X-Git-Tag: V_1.3.0~123 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=729ea3c3b62c68de5bb84ebd972a03b8ff069790;p=modules%2Fshaper.git Issue #639: Detaching of lines and moving is fixed --- diff --git a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp index 04e6db8d2..532097e99 100644 --- a/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp @@ -170,6 +170,12 @@ bool SketchSolver_ConstraintCoincidence::remove(ConstraintPtr theConstraint) return false; // there is no constraint, which is specified to remove else { bool isEmpty = anExtraIt->first == SLVS_E_UNKNOWN; + if (!isEmpty) { + for (aPos = 0; aPos < (int)mySlvsConstraints.size(); aPos++) + if (mySlvsConstraints[aPos] == anExtraIt->first) + break; + aPos -= 1; + } myExtraCoincidence.erase(anExtraIt); if (isEmpty) return false; diff --git a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp index dfbed30fd..d5b96bf33 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp @@ -79,8 +79,16 @@ void SketchSolver_ConstraintMovement::getAttributes( std::dynamic_pointer_cast(*anIt); aDeltaX -= aPt->x(); aDeltaY -= aPt->y(); - if (aDeltaX * aDeltaX + aDeltaY * aDeltaY >= tolerance * tolerance) + if (aDeltaX * aDeltaX + aDeltaY * aDeltaY >= tolerance * tolerance) { theAttributes.push_back(anAttr); + // update point coordinates + double aNewPos[2] = {aPt->x(), aPt->y()}; + for (int i = 0; i < 2; i++) { + Slvs_Param aParam = myStorage->getParameter(anAttrEnt.param[i]); + aParam.val = aNewPos[i]; + myStorage->updateParameter(aParam); + } + } else theIsFullyMoved = false; }