]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Initialize parameter of SketchPlugin_Arc on execute() to avoid its reverting
authorazv <azv@opencascade.com>
Sat, 1 Apr 2017 13:50:54 +0000 (16:50 +0300)
committerazv <azv@opencascade.com>
Sat, 1 Apr 2017 13:50:54 +0000 (16:50 +0300)
src/SketchPlugin/SketchPlugin_Arc.cpp

index 0dac256a86de36f03ecb8112087fd267a97fd520..ca7579d8664f8f285ba30f85a1d09b63b1c3d0e4 100644 (file)
@@ -103,6 +103,12 @@ void SketchPlugin_Arc::execute()
       GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, anEnd, aStart, aNormal)
     : GeomAlgoAPI_EdgeBuilder::lineCircleArc(aCenter, aStart, anEnd, aNormal);
 
+  if (myParamBefore == 0) { // parameter has not been calculate yet
+    std::shared_ptr<GeomAPI_Circ2d> aCircleForArc(
+        new GeomAPI_Circ2d(aCenterAttr->pnt(), aStartAttr->pnt()));
+    aCircleForArc->parameter(anEndAttr->pnt(), paramTolerance, myParamBefore);
+  }
+
   std::shared_ptr<ModelAPI_ResultConstruction> aResult = document()->createConstruction(data(), 1);
   aResult->setShape(anArcShape);
   aResult->setIsInHistory(false);