From: vsv Date: Fri, 28 Sep 2018 08:36:27 +0000 (+0300) Subject: Improve "Show only": do not hide already displayed objects X-Git-Tag: CEA_2018-2~56 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d0a50868675eccabf49d00a513d9d9d046eb98c5;p=modules%2Fshaper.git Improve "Show only": do not hide already displayed objects --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index e50e140ff..378ffae70 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -2498,11 +2498,14 @@ void XGUI_Workshop::showObjects(const QObjectPtrList& theList, bool isVisible) //************************************************************** void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList) { + QObjectPtrList aSrcList = theList; // Hide all displayed objects QObjectPtrList aList = myDisplayer->displayedObjects(); foreach (ObjectPtr aObj, aList) { - if (module()->canEraseObject(aObj)) + if ((!aSrcList.contains(aObj)) && (module()->canEraseObject(aObj))) aObj->setDisplayed(false); + else + aSrcList.removeAll(aObj); } //Do not use eraseAll if you didn't send Redisplay event: //all objects are erased from viewer, but considered as displayed in displayer @@ -2514,7 +2517,7 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList) #endif std::set anObjects; - foreach (ObjectPtr aObj, theList) { + foreach (ObjectPtr aObj, aSrcList) { anObjects.insert(aObj); } @@ -2522,7 +2525,7 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList) return; // Show only objects from the list - foreach (ObjectPtr aObj, theList) { + foreach (ObjectPtr aObj, aSrcList) { aObj->setDisplayed(true); } Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));