+ bool aContains = false;
+ QMap<int, ModuleBase_ViewerPrsPtr>::iterator aIt;
+ for (aIt = myItems.begin(); aIt != myItems.end(); aIt++) {
+ ModuleBase_ViewerPrsPtr aPrs = aIt.value();
+ if (aPrs->object() == theObject) {
+ aContains = true;
+ break;
+ }
+ }
+ if (aContains) {
+ std::map<ObjectPtr, TopoDS_ListOfShape> aObjectToShapes;
+ std::map<ObjectPtr, Handle(ModuleBase_ResultPrs)> aObjectToPrs;
+ std::set<ObjectPtr> aObjects;
+ std::set<int> aIdsToRem;
+
+ TopoDS_ListOfShape aHideShapes;
+ std::map<ObjectPtr, TopoDS_ListOfShape>::const_iterator aSIt;
+ for (aIt = myItems.begin(); aIt != myItems.end(); aIt++) {
+ ModuleBase_ViewerPrsPtr aPrs = aIt.value();
+ if (aPrs->object() == theObject) {
+ TopoDS_Shape aShape = aPrs->shape()->impl<TopoDS_Shape>();
+ if (!aShape.IsNull())
+ aHideShapes.Append(aShape);
+ aPrs->setInteractive(theAIS->impl<Handle(AIS_InteractiveObject)>());
+ }
+ }
+ double aTransp = transparency();
+ if (aHideShapes.Size() > 0) {
+ Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(
+ theAIS->impl<Handle(AIS_InteractiveObject)>());
+ if (!aResultPrs.IsNull()) {
+ aResultPrs->setSubShapeHidden(aHideShapes);
+ aResultPrs->setHiddenSubShapeTransparency(aTransp);
+ aObjects.insert(theObject);
+ }
+ }
+ removeItems(aIdsToRem);
+ myWorkshop->selector()->clearSelection();
+ if (redisplayObjects(aObjects))
+ QTimer::singleShot(50, this, SLOT(flushRedisplay()));
+ }
+}
+
+void XGUI_FacesPanel::removeItems(std::set<int> theIds)
+{
+ if (theIds.empty())
+ return;
+ myListView->removeItems(theIds);
+ std::set<int>::const_iterator aRIt;
+ for (aRIt = theIds.begin(); aRIt != theIds.end(); aRIt++)
+ myItems.remove(*aRIt);