From: mpv Date: Thu, 9 Apr 2015 09:37:15 +0000 (+0300) Subject: Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0 X-Git-Tag: V_1.1.0~52^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b565fcd859e5551d317233b9e8103b3987f1e79a;hp=8b3047a8dbb6be4fca3a92ae3dfb4148438d6fde;p=modules%2Fshaper.git Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0 --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index 026266a30..5599f3b0b 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -209,14 +210,28 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID) { std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(CENTER_ID())); - if (!aCenterAttr->isInitialized()) - return; std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(START_ID())); - if (!aStartAttr->isInitialized()) - return; std::shared_ptr anEndAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(END_ID())); + if (theID == EXTERNAL_ID()) { + std::shared_ptr aSelection = data()->selection(EXTERNAL_ID())->value(); + // update arguments due to the selection value + if (aSelection && !aSelection->isNull() && aSelection->isEdge()) { + std::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); + std::shared_ptr aCirc = anEdge->circle(); + if (aCirc.get()) { + aStartAttr->setValue(sketch()->to2D(anEdge->firstPoint())); + anEndAttr->setValue(sketch()->to2D(anEdge->lastPoint())); + aCenterAttr->setValue(sketch()->to2D(aCirc->center())); + } + } + return; + } + if (!aCenterAttr->isInitialized()) + return; + if (!aStartAttr->isInitialized()) + return; if (!anEndAttr->isInitialized()) return;