Salome HOME
Provide pop-up menu for steps
[modules/shaper.git] / src / ModelAPI / ModelAPI_Feature.cpp
index 4ac1b988605a589e88f8fc56401116c267ee4dd4..6eacd88767ff741bde1d1766ab8487f852cb14ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModelAPI_Feature.h"
@@ -88,15 +87,6 @@ void ModelAPI_Feature::setResult(const std::shared_ptr<ModelAPI_Result>& theResu
   theResult->setDisabled(theResult, false);
 }
 
-void ModelAPI_Feature::removeResult(const std::shared_ptr<ModelAPI_Result>& theResult)
-{
-  theResult->setDisabled(theResult, true);
-  // flush visualization changes
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  aLoop->flush(aRedispEvent);
-}
-
 void ModelAPI_Feature::eraseResultFromList(const std::shared_ptr<ModelAPI_Result>& theResult)
 {
   std::list<std::shared_ptr<ModelAPI_Result> >::iterator aResIter = myResults.begin();
@@ -173,8 +163,10 @@ void ModelAPI_Feature::erase()
   while (!myResults.empty()) {  // remove one by one with messages
     std::shared_ptr<ModelAPI_Result> aRes = *(myResults.begin());
     aRes->setDisabled(aRes, true); // to avoid activation of the Part result
-    if (!myResults.empty()) // disabling result may erase the list (on undo of Part, issue 665)
+    if (!myResults.empty()) {// disabling result may erase the list (on undo of Part, issue 665)
       myResults.erase(myResults.begin());
+      aRes->erase();
+    }
   }
   ModelAPI_Object::erase();
 }
@@ -232,6 +224,7 @@ bool ModelAPI_Feature::isDisabled()
   return myIsDisabled;
 }
 
+// LCOV_EXCL_START
 bool ModelAPI_Feature::setStable(const bool theFlag)
 {
   if (myIsStable != theFlag) {
@@ -245,6 +238,7 @@ bool ModelAPI_Feature::setStable(const bool theFlag)
   }
   return false;
 }
+// LCOV_EXCL_STOP
 
 bool ModelAPI_Feature::isStable()
 {