From e17ee4c96108b6a4a58e3405e295eae789ee18b2 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 30 Sep 2015 07:57:56 +0300 Subject: [PATCH] Persistence for keep arc orientation. Part 2 (issue #1027) --- src/SketchPlugin/SketchPlugin_Arc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)); -- 2.39.2