From: azv Date: Thu, 28 Apr 2016 13:57:42 +0000 (+0300) Subject: Update Projection feature during construction (issue #1473) X-Git-Tag: V_2.3.0~74 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ac3fd6881566a909b1b0dd82083f841940bb37cf;p=modules%2Fshaper.git Update Projection feature during construction (issue #1473) --- diff --git a/src/SketchPlugin/SketchPlugin_Projection.cpp b/src/SketchPlugin/SketchPlugin_Projection.cpp index ac7586626..7f78c0bbc 100644 --- a/src/SketchPlugin/SketchPlugin_Projection.cpp +++ b/src/SketchPlugin/SketchPlugin_Projection.cpp @@ -60,6 +60,7 @@ void SketchPlugin_Projection::execute() ResultConstructionPtr aConstr = document()->createConstruction(data()); aConstr->setShape(aProjection->lastResult()->shape()); aConstr->setIsInHistory(false); + aConstr->setDisplayed(false); setResult(aConstr); aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape()); @@ -114,6 +115,13 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) std::shared_ptr aSketchPlane = sketch()->plane(); + ResultConstructionPtr aResult = + std::dynamic_pointer_cast(lastResult()); + if (aResult && aResult->shape()) { + aResult->setShape(std::shared_ptr()); + aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape()); + } + if (anEdge->isLine()) { std::shared_ptr aFirst = aSketchPlane->project(anEdge->firstPoint()); std::shared_ptr aLast = aSketchPlane->project(anEdge->lastPoint()); @@ -184,6 +192,13 @@ void SketchPlugin_Projection::computeProjection(const std::string& theID) aFixed->execute(); } - if (theID == EXTERNAL_FEATURE_ID()) + if (theID == EXTERNAL_FEATURE_ID()) { selection(EXTERNAL_ID())->setValue(aExtFeature->context(), aExtFeature->context()->shape()); + + if (aResult) { + aResult->setShape(aProjection->lastResult()->shape()); + setResult(aResult); + aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape()); + } + } }