]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
PlaneGCSSolver: update Angle constraint to be consistent with SketchPlugin_Constraint...
authorazv <azv@opencascade.com>
Wed, 1 Jun 2016 07:25:21 +0000 (10:25 +0300)
committerazv <azv@opencascade.com>
Wed, 1 Jun 2016 07:25:21 +0000 (10:25 +0300)
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Builder.cpp

index 3ad5b78a855ee6a334df466b08b9a9ae1b694385..24d9cb3f0429785d2cffa4bde614b88d755a648f 100644 (file)
@@ -955,9 +955,19 @@ ConstraintWrapperPtr createConstraintAngle(
     std::shared_ptr<PlaneGCSSolver_EntityWrapper> theEntity2)
 {
   std::shared_ptr<GCS::Line> aLine1 = std::dynamic_pointer_cast<GCS::Line>(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<GCS::Line> aLine2 = std::dynamic_pointer_cast<GCS::Line>(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<PlaneGCSSolver_ConstraintWrapper> aResult(
       new PlaneGCSSolver_ConstraintWrapper(theConstraint, aNewConstr, CONSTRAINT_ANGLE));