From: azv Date: Wed, 27 May 2015 13:52:11 +0000 (+0300) Subject: Issue #567: Fixing of a vertical line X-Git-Tag: V_1.2.0~52 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e2f538e6c7a2a210120b9258aa9da7108035dbe;p=modules%2Fshaper.git Issue #567: Fixing of a vertical line --- diff --git a/src/SketchSolver/SketchSolver_ConstraintRigid.cpp b/src/SketchSolver/SketchSolver_ConstraintRigid.cpp index 735412dde..6082f2fd4 100644 --- a/src/SketchSolver/SketchSolver_ConstraintRigid.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintRigid.cpp @@ -203,6 +203,13 @@ void SketchSolver_ConstraintRigid::fixLine(const Slvs_Entity& theLine) !myStorage->isPointFixed(theLine.point[1], aFixed, true)) fixPoint(theLine.point[0]); if (!isUsedInEqual(theLine, anEqual)) { + // Check the distance is not set yet + std::list aDistConstr = myStorage->getConstraintsByType(SLVS_C_PT_PT_DISTANCE); + std::list::const_iterator aDIt = aDistConstr.begin(); + for (; aDIt != aDistConstr.end(); aDIt++) + if ((aDIt->ptA == theLine.point[0] && aDIt->ptB == theLine.point[1]) || + (aDIt->ptA == theLine.point[1] && aDIt->ptB == theLine.point[0])) + return; // Calculate distance between points on the line double aCoords[4]; for (int i = 0; i < 2; i++) {