X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSHAPERGUI%2FSHAPERGUI_SalomeViewer.cpp;h=37148b5a3b9025ec68fcd0aa1d7d04a55c093ddf;hb=c8fd356b4c1e7fb116023cfc9bc4ac87915607b0;hp=dc11d995f7482e637d411d1dd29e428735f45030;hpb=3a040dd8ae63705d0f8c9ab34897b7765675a905;p=modules%2Fshaper.git 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); + } + } } //**********************************************