From: azv Date: Wed, 1 Jun 2016 07:25:21 +0000 (+0300) Subject: PlaneGCSSolver: update Angle constraint to be consistent with SketchPlugin_Constraint... X-Git-Tag: V_2.3.1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=94b4ebd0def2f4659ee228f419214625f30aa855;p=modules%2Fshaper.git PlaneGCSSolver: update Angle constraint to be consistent with SketchPlugin_ConstraintAngle feature (issue #1536) --- diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp index 3ad5b78a8..24d9cb3f0 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp @@ -955,9 +955,19 @@ ConstraintWrapperPtr createConstraintAngle( std::shared_ptr theEntity2) { std::shared_ptr aLine1 = std::dynamic_pointer_cast(theEntity1->entity()); + bool isLine1Rev = theConstraint->boolean( + SketchPlugin_ConstraintAngle::ANGLE_REVERSED_FIRST_LINE_ID())->value(); + GCS::Point aLine1Pt1 = isLine1Rev ? aLine1->p2 : aLine1->p1; + GCS::Point aLine1Pt2 = isLine1Rev ? aLine1->p1 : aLine1->p2; + std::shared_ptr aLine2 = std::dynamic_pointer_cast(theEntity2->entity()); + bool isLine2Rev = theConstraint->boolean( + SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID())->value(); + GCS::Point aLine2Pt1 = isLine2Rev ? aLine2->p2 : aLine2->p1; + GCS::Point aLine2Pt2 = isLine2Rev ? aLine2->p1 : aLine2->p2; + GCSConstraintPtr aNewConstr(new GCS::ConstraintL2LAngle( - *(aLine1), *(aLine2), theValue->parameter())); + aLine1Pt1, aLine1Pt2, aLine2Pt1, aLine2Pt2, theValue->parameter())); std::shared_ptr aResult( new PlaneGCSSolver_ConstraintWrapper(theConstraint, aNewConstr, CONSTRAINT_ANGLE));