+//********************************************************************
+bool XGUI_FacesPanel::hideEmptyObjects()
+{
+ bool isModified = false;
+ static Events_ID aDispEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ for (QMap<int, ModuleBase_ViewerPrsPtr>::const_iterator anIt = myItems.begin();
+ anIt != myItems.end(); anIt++) {
+ ModuleBase_ViewerPrsPtr aPrs = anIt.value();
+ ObjectPtr anObject = aPrs->object();
+ if (!anObject.get() || !anObject->isDisplayed())
+ continue;
+
+ Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(
+ aPrs->interactive());
+ if (aResultPrs.IsNull())
+ continue;
+
+ if (!aResultPrs->hasSubShapeVisible(ModuleBase_Tools::getSelectedShape(aPrs))) {
+ // erase object because it is entirely hidden
+ anObject->setDisplayed(false);
+ myHiddenObjects.insert(anObject);
+ ModelAPI_EventCreator::get()->sendUpdated(anObject, aDispEvent);
+ isModified = true;
+ }
+ }
+ return isModified;
+}