From: azv Date: Wed, 30 Sep 2015 04:57:56 +0000 (+0300) Subject: Persistence for keep arc orientation. Part 2 (issue #1027) X-Git-Tag: V_1.4.0_demo1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e17ee4c96108b6a4a58e3405e295eae789ee18b2;p=modules%2Fshaper.git Persistence for keep arc orientation. Part 2 (issue #1027) --- diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index 7a75652b2..8f51fe28f 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -59,6 +59,10 @@ void SketchPlugin_Arc::initAttributes() ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID()); data()->addAttribute(INVERSED_ID(), ModelAPI_AttributeBoolean::typeId()); + AttributeBooleanPtr isInversed = + std::dynamic_pointer_cast(attribute(INVERSED_ID())); + if (!isInversed->isInitialized()) + isInversed->setValue(false); // get the initial values if (anEndAttr->isInitialized()) { @@ -106,7 +110,8 @@ void SketchPlugin_Arc::execute() anEndAttr->setValue(aProjection); */ std::shared_ptr aEndPoint(aSketch->to3D(anEndAttr->x(), anEndAttr->y())); - AttributeBooleanPtr isInversed = std::dynamic_pointer_cast(attribute(INVERSED_ID())); + AttributeBooleanPtr isInversed = + std::dynamic_pointer_cast(attribute(INVERSED_ID())); std::shared_ptr anXDir(new GeomAPI_Dir(aStartPoint->xyz()->decreased(aCenter->xyz()))); std::shared_ptr anAx2(new GeomAPI_Ax2(aCenter, aNormal, anXDir));