//**************************************************************
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
#endif
std::set<ObjectPtr> anObjects;
- foreach (ObjectPtr aObj, theList) {
+ foreach (ObjectPtr aObj, aSrcList) {
anObjects.insert(aObj);
}
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));