From: mpv Date: Mon, 7 Sep 2015 15:17:06 +0000 (+0300) Subject: Make sketch without good (like auxiliary) sub-elements produce an empty result, not... X-Git-Tag: V_1.4.0_beta4~84 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3f640830ca622fb7fbf78d15efbd289be834f895;p=modules%2Fshaper.git Make sketch without good (like auxiliary) sub-elements produce an empty result, not the previous one. --- 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);