From 09dabb6acd9664f589a0bd9415d804d7a37ab801 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 1 Jun 2016 10:41:18 +0300 Subject: [PATCH] PLaneGCSSolver: It is not necessary to adjust Angle constraint (issue #1536) --- .../PlaneGCSSolver/PlaneGCSSolver_Builder.cpp | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp index 24d9cb3f0..027d57a0a 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp @@ -142,8 +142,6 @@ static ConstraintWrapperPtr -/// \brief Set flags for angle constraint -static void adjustAngle(ConstraintWrapperPtr theConstraint); /// \brief Update mirror points static void adjustMirror(ConstraintWrapperPtr theConstraint); /// \brief Update a sign of the point-line distance constraint @@ -459,9 +457,7 @@ void PlaneGCSSolver_Builder::adjustConstraint(ConstraintWrapperPtr theConstraint { SketchSolver_ConstraintType aType = theConstraint->type(); // Update flags and parameters in constraints - if (aType == CONSTRAINT_ANGLE) - adjustAngle(theConstraint); - else if (aType == CONSTRAINT_PT_LINE_DISTANCE) + if (aType == CONSTRAINT_PT_LINE_DISTANCE) adjustPtLineDistance(theConstraint); else if (aType == CONSTRAINT_SYMMETRIC) adjustMirror(theConstraint); @@ -1138,24 +1134,6 @@ ConstraintWrapperPtr createConstraintTangent( -void adjustAngle(ConstraintWrapperPtr theConstraint) -{ - BuilderPtr aBuilder = PlaneGCSSolver_Builder::getInstance(); - - std::shared_ptr aConstraint = - std::dynamic_pointer_cast(theConstraint); - - bool isReversed[2] = { - aConstraint->baseConstraint()->boolean( - SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->value(), - aConstraint->baseConstraint()->boolean( - SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value() - }; - - if (isReversed[0] != isReversed[1]) - aConstraint->setValue(aConstraint->value() - 180.0); -} - void makeMirrorPoints(EntityWrapperPtr theOriginal, EntityWrapperPtr theMirrored, EntityWrapperPtr theMirrorLine) -- 2.39.2