]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make sketch without good (like auxiliary) sub-elements produce an empty result, not...
authormpv <mpv@opencascade.com>
Mon, 7 Sep 2015 15:17:06 +0000 (18:17 +0300)
committermpv <mpv@opencascade.com>
Mon, 7 Sep 2015 15:17:06 +0000 (18:17 +0300)
src/SketchPlugin/SketchPlugin_Sketch.cpp

index eec2e580f48b2bfecd484e50de53f02436b1b3a1..2a5dd0944780f0c7e21decd6617dd180b335de41 100644 (file)
@@ -77,7 +77,7 @@ void SketchPlugin_Sketch::execute()
       data()->attribute(SketchPlugin_Sketch::NORM_ID()));
 
   std::list<ObjectPtr> aFeatures = aRefList->list();
-  if (aFeatures.empty())
+  if (aFeatures.empty()) // actually, this must be avoided by the validators
     return;
 
   std::list<ObjectPtr>::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<GeomAPI_PlanarEdges> aBigWire(new GeomAPI_PlanarEdges);