From ac3fd6881566a909b1b0dd82083f841940bb37cf Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 28 Apr 2016 16:57:42 +0300 Subject: [PATCH] Update Projection feature during construction (issue #1473) --- src/SketchPlugin/SketchPlugin_Projection.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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()); + } + } } -- 2.39.2