From 3f640830ca622fb7fbf78d15efbd289be834f895 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 7 Sep 2015 18:17:06 +0300 Subject: [PATCH] Make sketch without good (like auxiliary) sub-elements produce an empty result, not the previous one. --- src/SketchPlugin/SketchPlugin_Sketch.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index eec2e580f..2a5dd0944 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -77,7 +77,7 @@ void SketchPlugin_Sketch::execute() data()->attribute(SketchPlugin_Sketch::NORM_ID())); std::list aFeatures = aRefList->list(); - if (aFeatures.empty()) + if (aFeatures.empty()) // actually, this must be avoided by the validators return; std::list::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); @@ -113,8 +113,12 @@ void SketchPlugin_Sketch::execute() } } - if (aFeaturesPreview.empty()) + if (aFeaturesPreview.empty()) { + // no good features for generation of preview => erase result if exists + if (firstResult().get() && !firstResult()->isDisabled()) + removeResults(0, false); return; + } // Collect all edges as one big wire std::shared_ptr aBigWire(new GeomAPI_PlanarEdges); -- 2.39.2