From: nds Date: Fri, 16 May 2014 06:15:52 +0000 (+0400) Subject: refs #30 - Sketch base GUI: create, draw lines X-Git-Tag: V_0.2~56 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d871a5b3dd32fd62ea04511538348f659fde1eb1;p=modules%2Fshaper.git refs #30 - Sketch base GUI: create, draw lines Remove temporary call of the EraseAll method. Use instead of the EraseDeletedFeatures() if the listener catch Feature_Deleted event. --- diff --git a/src/PartSet/PartSet_Listener.cpp b/src/PartSet/PartSet_Listener.cpp index 0deb7fb74..b97b34f8e 100644 --- a/src/PartSet/PartSet_Listener.cpp +++ b/src/PartSet/PartSet_Listener.cpp @@ -50,7 +50,7 @@ void PartSet_Listener::processEvent(const Events_Message* theMessage) std::string aGroup = aDelMsg->group(); if (aDelMsg->group().compare("Sketch") == 0) { // Update only Sketch group - //myModule->workshop()->displayer()->EraseDeletedFeatures(); + myModule->workshop()->displayer()->EraseDeletedFeatures(); myModule->updateCurrentPreview(aGroup); } } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 9e47626c8..17998703c 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -330,7 +330,6 @@ void PartSet_Module::updateCurrentPreview(const std::string& theCmdId) std::map, boost::shared_ptr >::const_iterator anIt = aList.begin(), aLast = aList.end(); - aDisplayer->EraseAll(false); for (; anIt != aLast; anIt++) { boost::shared_ptr aFeature = (*anIt).first; boost::shared_ptr aPreview = (*anIt).second; diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index a01a31129..8daeaa9ed 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -8,6 +8,7 @@ #include "XGUI_ViewerProxy.h" #include +#include #include #include @@ -171,7 +172,7 @@ void XGUI_Displayer::EraseDeletedFeatures(const bool isUpdateViewer) for (; aFIt != aFLast; aFIt++) { boost::shared_ptr aFeature = (*aFIt).first; - if (!aFeature) { + if (!aFeature || !aFeature->data()->isValid()) { Handle(AIS_InteractiveObject) anAIS = (*aFIt).second; if (!anAIS.IsNull()) { aContext->Erase(anAIS, false);