]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Assign initial angle value as is (issue #1449)
authorazv <azv@opencascade.com>
Thu, 28 Apr 2016 11:06:44 +0000 (14:06 +0300)
committerazv <azv@opencascade.com>
Thu, 28 Apr 2016 11:07:02 +0000 (14:07 +0300)
src/SketchPlugin/SketchPlugin_ConstraintAngle.cpp

index aa3d392c4aa2f266a3370664a8679d2edc2168f1..8fb29c48c33e5866c795c9acc2c01e5798af491e 100644 (file)
@@ -174,6 +174,10 @@ double SketchPlugin_ConstraintAngle::calculateAngle()
     anAng = std::shared_ptr<GeomAPI_Angle2d>(new GeomAPI_Angle2d(aLine1, isReversed1, aLine2, isReversed2));
   }
   double anAngle = anAng->angleDegree();
+  std::shared_ptr<ModelAPI_AttributeDouble> aValueAttr = std::dynamic_pointer_cast<
+      ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_ConstraintAngle::VALUE()));
+  if (!aValueAttr->isInitialized())
+    aValueAttr->setValue(anAngle);
   /// an angle value should be corrected by the current angle type
   anAngle = getAngleForType(anAngle);
   boolean(ANGLE_REVERSED_FIRST_LINE_ID())->setValue(anAng->isReversed(0));