]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #639: Detaching of lines and moving is fixed
authorazv <azv@opencascade.com>
Thu, 2 Jul 2015 14:27:16 +0000 (17:27 +0300)
committerazv <azv@opencascade.com>
Thu, 2 Jul 2015 14:27:16 +0000 (17:27 +0300)
src/SketchSolver/SketchSolver_ConstraintCoincidence.cpp
src/SketchSolver/SketchSolver_ConstraintMovement.cpp

index 04e6db8d21c62e7c460d973106f8c830f7c4b664..532097e9935d3b2deac470366824d307ee446953 100644 (file)
@@ -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;
index dfbed30fd2dcee8bf942ed0e16b7f67746b2908c..d5b96bf33b8d778c559920469218f531b9eb0db4 100644 (file)
@@ -79,8 +79,16 @@ void SketchSolver_ConstraintMovement::getAttributes(
           std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*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;
      }