From: vsv Date: Thu, 20 Jul 2017 12:01:31 +0000 (+0300) Subject: Issue #2223: EraseAll function has to erase only SALOME interactive objects. X-Git-Tag: V_2.7.2RC~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c8a734951c3d64b45f20394e619a920602522f3c;p=modules%2Fshaper.git Issue #2223: EraseAll function has to erase only SALOME interactive objects. --- diff --git a/src/SHAPERGUI/CMakeLists.txt b/src/SHAPERGUI/CMakeLists.txt index f56ba704f..63887c6b7 100644 --- a/src/SHAPERGUI/CMakeLists.txt +++ b/src/SHAPERGUI/CMakeLists.txt @@ -72,6 +72,7 @@ SET(PROJECT_LIBRARIES ${OCCViewer} ${qtx} ${CAS_SHAPE} + ${SalomeObject} ) ADD_DEFINITIONS( -DSHAPERGUI_EXPORTS ${CAS_DEFINITIONS} ) diff --git a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp index dc11d995f..37148b5a3 100644 --- a/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp +++ b/src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp @@ -27,6 +27,7 @@ #include #include +#include #include @@ -374,8 +375,18 @@ void SHAPERGUI_SalomeViewer::fitAll() //********************************************** void SHAPERGUI_SalomeViewer::eraseAll() { - SOCC_Viewer* aViewer = dynamic_cast(myView->viewer()); - aViewer->EraseAll(0); + Handle(AIS_InteractiveContext) aContext = AISContext(); + AIS_ListOfInteractive aList; + aContext->DisplayedObjects(aList); + AIS_ListIteratorOfListOfInteractive aLIt; + Handle(AIS_InteractiveObject) anAISIO; + for (aLIt.Initialize(aList); aLIt.More(); aLIt.Next()) { + anAISIO = aLIt.Value(); + Handle(Standard_Type) aType = anAISIO->DynamicType(); + if (anAISIO->IsKind(STANDARD_TYPE(SALOME_AISShape))) { + aContext->Erase(anAISIO, false); + } + } } //**********************************************