Salome HOME
[bos #32216][CEA] GUI ergonomic. Fixed scaling of Sketcher symbols because of using...
[modules/shaper.git] / src / XGUI / XGUI_FacesPanel.cpp
1 // Copyright (C) 2014-2024  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "XGUI_FacesPanel.h"
21 #include "XGUI_ObjectsBrowser.h"
22 #include "XGUI_SelectionMgr.h"
23 #include "XGUI_Selection.h"
24 #include "XGUI_Tools.h"
25 #include "XGUI_Workshop.h"
26 #include "XGUI_Displayer.h"
27 #include "XGUI_ViewerProxy.h"
28
29 #include <ModuleBase_IModule.h>
30 #include <ModuleBase_ISelection.h>
31 #include <ModuleBase_IWorkshop.h>
32 #include <ModuleBase_IViewer.h>
33 #include <ModuleBase_ListView.h>
34 #include <ModuleBase_ResultPrs.h>
35 #include <ModuleBase_Tools.h>
36 #include <ModuleBase_ViewerPrs.h>
37 #include <ModuleBase_SelectionFilterType.h>
38
39 #include <Config_PropManager.h>
40 #include <Events_Loop.h>
41 #include <GeomAlgoAPI_CompoundBuilder.h>
42 #include <GeomAPI_Shape.h>
43
44 #include <ModelAPI_Events.h>
45 #include <ModelAPI_AttributeSelectionList.h>
46
47 #include <ModuleBase_Operation.h>
48 #include <ModuleBase_OperationFeature.h>
49 #include <XGUI_OperationMgr.h>
50
51 #include <QAction>
52 #include <QCheckBox>
53 #include <QFocusEvent>
54 #include <QGridLayout>
55 #include <QListWidget>
56 #include <QMainWindow>
57 #include <QTimer>
58
59 #ifdef WIN32
60 #pragma warning(disable : 4189) // for skipping MAYBE_UNUSED on Win
61 #endif
62
63 static const int LayoutMargin = 3;
64
65 //********************************************************************
66 void updateHiddenShapes(Handle(ModuleBase_ResultPrs) thePrs, const TopoDS_ListOfShape& theShapes)
67 {
68   TopoDS_ListOfShape aAlreadyHidden = thePrs->hiddenSubShapes();
69   TopoDS_ListOfShape::Iterator aShPIt(theShapes);
70   for (; aShPIt.More(); aShPIt.Next()) {
71     if (aAlreadyHidden.Contains(aShPIt.Value()))
72       aAlreadyHidden.Remove(aShPIt.Value());
73   }
74   thePrs->setSubShapeHidden(aAlreadyHidden);
75 }
76
77 //********************************************************************
78 void objectsMapFromPrs(ModuleBase_ViewerPrsPtr thePrs,
79   std::map<ObjectPtr, TopoDS_ListOfShape>& theObjectToShapes,
80   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs) >& theObjectToPrs)
81 {
82   ObjectPtr anObject = thePrs->object();
83   if (!anObject.get())
84     return;
85
86   // Process bodies
87   Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(
88     thePrs->interactive());
89   if (aResultPrs.IsNull())
90     return;
91
92   if (theObjectToShapes.find(anObject) != theObjectToShapes.end())
93     theObjectToShapes.at(anObject).Append(ModuleBase_Tools::getSelectedShape(thePrs));
94   else {
95     TopoDS_ListOfShape aListOfShapes;
96     aListOfShapes.Append(ModuleBase_Tools::getSelectedShape(thePrs));
97     theObjectToShapes[anObject] = aListOfShapes;
98     theObjectToPrs[anObject] = aResultPrs;
99   }
100 }
101
102 //********************************************************************
103 XGUI_FacesPanel::XGUI_FacesPanel(QWidget* theParent, XGUI_Workshop* theWorkshop)
104   : QDockWidget(theParent), myWorkshop(theWorkshop), myIsActive(false), myLastItemIndex(0)
105 {
106   setWindowTitle(tr("Hide Faces"));
107   setObjectName("Hide Faces");
108
109   MAYBE_UNUSED QAction* aViewAct = toggleViewAction();
110   setStyleSheet("::title { position: relative; padding-left: 5px; text-align: left center }");
111
112   QWidget* aContent = new QWidget(this);
113   QGridLayout* aMainLayout = new QGridLayout(aContent);
114   aMainLayout->setContentsMargins(LayoutMargin, LayoutMargin, LayoutMargin, LayoutMargin);
115   setWidget(aContent);
116
117   myHiddenOrTransparent = new QCheckBox(tr("Transparent"), aContent);
118   connect(myHiddenOrTransparent, SIGNAL(toggled(bool)), SLOT(onTransparencyChanged()));
119
120   myListView = new ModuleBase_ListView(aContent, "", "Hidden/transparent faces in 3D view");
121   connect(myListView, SIGNAL(deleteActionClicked()), SLOT(onDeleteItem()));
122
123   aMainLayout->addWidget(myHiddenOrTransparent, 0, 0);
124   aMainLayout->addWidget(myListView->getControl(), 1, 0);
125
126   myListView->getControl()->setFocusPolicy(Qt::StrongFocus);
127   myListView->getControl()->viewport()->installEventFilter(this);
128
129   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
130   connect(aDisplayer, SIGNAL(objectDisplayed(ObjectPtr, AISObjectPtr)),
131     SLOT(onObjectDisplay(ObjectPtr, AISObjectPtr)));
132 }
133
134 //********************************************************************
135 void XGUI_FacesPanel::reset(const bool isToFlushRedisplay)
136 {
137   if (myLastItemIndex == 0) // do nothing because there was no activity in the pane after reset
138     return;
139
140   std::map<ObjectPtr, TopoDS_ListOfShape> anObjectToShapes;
141   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs) > anObjectToPrs;
142   QMap<int, ModuleBase_ViewerPrsPtr >::const_iterator aIt;
143   for (aIt = myItems.cbegin(); aIt != myItems.cend(); aIt++) {
144     objectsMapFromPrs(aIt.value(), anObjectToShapes, anObjectToPrs);
145   }
146
147   std::set<ObjectPtr> aObjects;
148   TopoDS_ListOfShape anEmpty;
149   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs)>::const_iterator aPrsIt;
150   for (aPrsIt = anObjectToPrs.cbegin(); aPrsIt != anObjectToPrs.cend(); aPrsIt++) {
151     aObjects.insert(aPrsIt->first);
152     aPrsIt->second->setSubShapeHidden(anEmpty);
153   }
154
155   if (redisplayObjects(aObjects))
156     flushRedisplay();
157
158   // clear internal containers
159   myListView->getControl()->clear();
160   myItems.clear();
161   updateProcessedObjects(myItems, myItemObjects);
162   myLastItemIndex = 0; // it should be after redisplay as flag used in customize
163   myHiddenObjects.clear();
164 }
165
166 //********************************************************************
167 bool XGUI_FacesPanel::isEmpty() const
168 {
169   return myItems.size() == 0;
170 }
171
172 //********************************************************************
173 void XGUI_FacesPanel::selectionModes(QIntList& theModes)
174 {
175   theModes.append(TopAbs_FACE);
176 }
177
178 //********************************************************************
179 void XGUI_FacesPanel::selectionFilters(SelectMgr_ListOfFilter& theSelectionFilters)
180 {
181   ModuleBase_IModule* aModule = myWorkshop->module();
182   QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
183
184   // The global filter makes problem for groups selection when any operation is launched
185   // theSelectionFilters.Append(aModule->selectionFilter(SF_GlobalFilter));
186   theSelectionFilters.Append(aModule->selectionFilter(SF_FilterInfinite));
187   theSelectionFilters.Append(aModule->selectionFilter(SF_ResultGroupNameFilter));
188 }
189
190 //********************************************************************
191 bool XGUI_FacesPanel::eventFilter(QObject* theObject, QEvent *theEvent)
192 {
193   QWidget* aWidget = qobject_cast<QWidget*>(theObject);
194   if (theEvent->type() == QEvent::MouseButtonRelease)
195   {
196     if (myListView->getControl()->viewport() == aWidget)
197       setActivePanel(true);
198   }
199   // pass the event on to the parent class
200   return QObject::eventFilter(theObject, theEvent);
201 }
202
203 //********************************************************************
204 void XGUI_FacesPanel::setActivePanel(const bool theIsActive)
205 {
206   if (myIsActive == theIsActive)
207     return;
208
209   ModuleBase_Tools::setShadowEffect(myListView->getControl(), theIsActive);
210   myIsActive = theIsActive;
211
212   if (myIsActive) {
213     emit activated();
214     // selection should be cleared after emit of signal to do not process selection change
215     // event by the previous selector
216     // the selection is cleared by activating selection control
217     myWorkshop->selector()->clearSelection();
218   }
219   else{
220     emit deactivated();
221     myUndoList.clear();
222   }
223 }
224
225 //********************************************************************
226 bool XGUI_FacesPanel::useTransparency() const
227 {
228   return myHiddenOrTransparent->isChecked();
229 }
230
231 //********************************************************************
232 double XGUI_FacesPanel::transparency() const
233 {
234   return useTransparency() ?
235     Config_PropManager::real("Visualization", "hidden_face_transparency") : 1;
236 }
237
238
239 //********************************************************************
240 void XGUI_FacesPanel::restoreObjects(const std::set<ObjectPtr>& theHiddenObjects)
241 {
242   std::set<int> anIndicesToBeRemoved;
243   for (QMap<int, ModuleBase_ViewerPrsPtr>::const_iterator anItemsIt = myItems.begin();
244     anItemsIt != myItems.end(); anItemsIt++)
245   {
246     ModuleBase_ViewerPrsPtr aPrs = anItemsIt.value();
247     ObjectPtr anObject = aPrs->object();
248     if (theHiddenObjects.find(anObject) == theHiddenObjects.end()) // not found
249       continue;
250     anIndicesToBeRemoved.insert(anItemsIt.key());
251   }
252
253   // remove from myItes container
254   removeItems(anIndicesToBeRemoved);
255   if (!anIndicesToBeRemoved.empty()) // means that myItems has been changed
256     updateProcessedObjects(myItems, myItemObjects);
257
258   // remove from container of hidden objects
259   for (std::set<ObjectPtr>::const_iterator aHiddenIt = theHiddenObjects.begin();
260     aHiddenIt != theHiddenObjects.end(); aHiddenIt++)
261   {
262     if (myHiddenObjects.find(*aHiddenIt) != myHiddenObjects.end()) /// found objects
263       myHiddenObjects.erase(*aHiddenIt);
264   }
265 }
266
267 //********************************************************************
268 bool XGUI_FacesPanel::processAction(ModuleBase_ActionType theActionType)
269 {
270   switch (theActionType) {
271     //case ActionEnter:
272     //  return processEnter();
273     case ActionEscape:
274       setActivePanel(false);
275       return true;
276     case ActionDelete:
277       return processDelete();
278     //case ActionUndo:
279     //case ActionRedo:
280     default:
281       return false;
282   }
283 }
284
285
286 //********************************************************************
287 void XGUI_FacesPanel::processSelection()
288 {
289   QList<ModuleBase_ViewerPrsPtr> aSelected =
290     myWorkshop->selector()->selection()->getSelected(ModuleBase_ISelection::Viewer);
291
292   if (aSelected.size() == 0)
293     return;
294
295   bool isModified = false;
296   static Events_ID aDispEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
297
298   std::map<ObjectPtr, TopoDS_ListOfShape> anObjectToShapes;
299   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs) > anObjectToPrs;
300   std::set<int> aToRemove;
301
302   for (int i = 0; i < aSelected.size(); i++) {
303     ModuleBase_ViewerPrsPtr aPrs = aSelected[i];
304     ObjectPtr anObject = aPrs->object();
305     if (!anObject.get())
306       continue;
307
308     GeomShapePtr aShapePtr = aPrs->shape();
309     if (!aShapePtr.get() || !aShapePtr->isFace())
310       continue;
311
312     QString aItemName = XGUI_Tools::generateName(aPrs);
313     if (myListView->hasItem(aItemName))
314       continue;
315
316     objectsMapFromPrs(aPrs, anObjectToShapes, anObjectToPrs);
317
318     // The code is dedicated to remove already selected items if they are selected twice
319     // It can happen in case of groups selection
320     QMap<int, ModuleBase_ViewerPrsPtr>::const_iterator aIt;
321     for (aIt = myItems.cbegin(); aIt != myItems.cend(); aIt++) {
322       ModuleBase_ViewerPrsPtr aCurPrs = aIt.value();
323       ObjectPtr aObject = aCurPrs->object();
324       if (anObjectToShapes.find(aObject) != anObjectToShapes.end()) {
325         TopoDS_ListOfShape aShapes = anObjectToShapes[aObject];
326         GeomShapePtr aShapePtr = aCurPrs->shape();
327         if (aShapes.Contains(aShapePtr->impl<TopoDS_Shape>())) {
328           aToRemove.insert(aIt.key());
329         }
330       }
331     }
332
333     myItems.insert(myLastItemIndex, aPrs);
334     myListView->addItem(aItemName, myLastItemIndex);
335     // add in undo list
336     myUndoList.push_back(myLastItemIndex);
337     myLastItemIndex++;
338     isModified = true;
339   }
340
341   // Hide fully hidden shapes
342   std::map<ObjectPtr, TopoDS_ListOfShape>::const_iterator anIt;
343   for (anIt = anObjectToShapes.begin(); anIt != anObjectToShapes.end(); anIt++) {
344     ObjectPtr anObject = anIt->first;
345     if (!anObject.get() || anObjectToPrs.find(anObject) == anObjectToPrs.end())
346       continue;
347     Handle(ModuleBase_ResultPrs) aResultPrs = anObjectToPrs.at(anObject);
348
349     if (!aResultPrs->hasSubShapeVisible(anIt->second)) { // redisplay
350       // erase object because it is entirely hidden
351       anObject->setDisplayed(false);
352       myHiddenObjects.insert(anObject);
353     }
354     ModelAPI_EventCreator::get()->sendUpdated(anObject, aDispEvent);
355   }
356
357   // Process selected presentations
358   double aTransp = transparency();
359   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs)>::iterator aPrsIt;
360   for (aPrsIt = anObjectToPrs.begin(); aPrsIt != anObjectToPrs.end(); aPrsIt++) {
361     ObjectPtr anObject = aPrsIt->first;
362     Handle(ModuleBase_ResultPrs) aPrs = aPrsIt->second;
363     TopoDS_ListOfShape aAlreadyHidden = aPrs->hiddenSubShapes();
364     TopoDS_ListOfShape aListOfShapes = anObjectToShapes[anObject];
365     TopoDS_ListOfShape::Iterator aShapesIt(aListOfShapes);
366     for (; aShapesIt.More(); aShapesIt.Next()) {
367       if (!aAlreadyHidden.Contains(aShapesIt.Value()))
368         aAlreadyHidden.Append(aShapesIt.Value());
369     }
370     aPrs->setSubShapeHidden(aAlreadyHidden);
371     aPrs->setHiddenSubShapeTransparency(aTransp);
372   }
373
374   // Remove duplicate items
375   removeItems(aToRemove);
376   myWorkshop->selector()->clearSelection();
377   if (isModified) {
378     updateProcessedObjects(myItems, myItemObjects);
379     flushRedisplay();
380   }
381 }
382
383 //********************************************************************
384 bool XGUI_FacesPanel::processDelete()
385 {
386   //appendFirstSelectionInHistory();
387   //QModelIndexList anIndices = myListView->getControl()->selectionModel()->selectedIndexes();
388
389   std::set<int> aSelectedIds;
390   myListView->getSelectedIndices(aSelectedIds);
391   if (aSelectedIds.empty())
392     return false;
393
394   std::set<ModuleBase_ViewerPrsPtr> aRestored;
395   std::set<int>::const_iterator anIt;
396   for (anIt = aSelectedIds.begin(); anIt != aSelectedIds.end(); anIt++) {
397     ModuleBase_ViewerPrsPtr aPrs = myItems[*anIt];
398     if (aRestored.find(aPrs) == aRestored.end()) {
399       aRestored.insert(aPrs);
400       myItems.remove(*anIt);
401     }
402   }
403   std::map<ObjectPtr, TopoDS_ListOfShape> anObjectToShapes;
404   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs) > anObjectToPrs;
405
406   std::set<ModuleBase_ViewerPrsPtr>::const_iterator aIt;
407   for (aIt = aRestored.cbegin(); aIt != aRestored.cend(); aIt++) {
408     objectsMapFromPrs((*aIt), anObjectToShapes, anObjectToPrs);
409   }
410
411   std::set<ObjectPtr> aRestoredObjects;
412   std::map<ObjectPtr, TopoDS_ListOfShape>::const_iterator aShapesIt;
413   for (aShapesIt = anObjectToShapes.begin(); aShapesIt != anObjectToShapes.end(); aShapesIt++) {
414     TopoDS_ListOfShape aShapes = aShapesIt->second;
415     aRestoredObjects.insert(aShapesIt->first);
416     Handle(ModuleBase_ResultPrs) aPrs = anObjectToPrs[aShapesIt->first];
417     TopoDS_ListOfShape aHiddenShapes = aPrs->hiddenSubShapes();
418     TopoDS_ListOfShape::Iterator aSubShapesIt(aShapes);
419     for (; aSubShapesIt.More(); aSubShapesIt.Next()) {
420       if (aHiddenShapes.Contains(aSubShapesIt.Value()))
421         aHiddenShapes.Remove(aSubShapesIt.Value());
422     }
423     aPrs->setSubShapeHidden(aHiddenShapes);
424   }
425   if (redisplayObjects(aRestoredObjects))
426     flushRedisplay();
427
428   myListView->removeSelectedItems();
429   return true;
430 }
431
432 //********************************************************************
433 bool XGUI_FacesPanel::redisplayObjects(
434   const std::set<ObjectPtr >& theObjects)
435 {
436   if (theObjects.empty())
437     return false;
438
439   bool isModified = false;
440   static Events_ID aDispEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
441   for (std::set<ObjectPtr>::const_iterator anIt = theObjects.begin(); anIt != theObjects.end();
442        anIt++)
443   {
444     ObjectPtr anObject = *anIt;
445     if (!anObject->isDisplayed())
446       continue;
447     ModelAPI_EventCreator::get()->sendUpdated(anObject, aDispEvent);
448     isModified = true;
449   }
450   return isModified;
451 }
452
453 //********************************************************************
454 void XGUI_FacesPanel::updateProcessedObjects(QMap<int, ModuleBase_ViewerPrsPtr> theItems,
455                                              std::set<ObjectPtr>& theObjects)
456 {
457   theObjects.clear();
458   for (QMap<int, ModuleBase_ViewerPrsPtr>::const_iterator anIt = theItems.begin();
459        anIt != theItems.end(); anIt++) {
460     ModuleBase_ViewerPrsPtr aPrs = anIt.value();
461     if (theObjects.find(aPrs->object()) == theObjects.end())
462       theObjects.insert(aPrs->object());
463   }
464 }
465
466 //********************************************************************
467 void XGUI_FacesPanel::closeEvent(QCloseEvent* theEvent)
468 {
469   QDockWidget::closeEvent(theEvent);
470   emit closed();
471 }
472
473 //********************************************************************
474 void XGUI_FacesPanel::onDeleteItem()
475 {
476   processDelete();
477 }
478
479 //********************************************************************
480 void XGUI_FacesPanel::onTransparencyChanged()
481 {
482   std::map<ObjectPtr, TopoDS_ListOfShape> anObjectToShapes;
483   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs) > anObjectToPrs;
484   QMap<int, ModuleBase_ViewerPrsPtr >::const_iterator aIt;
485   for (aIt = myItems.cbegin(); aIt != myItems.cend(); aIt++) {
486     objectsMapFromPrs(aIt.value(), anObjectToShapes, anObjectToPrs);
487   }
488
489   double aTransp = Config_PropManager::real("Visualization", "hidden_face_transparency");
490   std::set<ObjectPtr> aObjects;
491   std::map<ObjectPtr, Handle(ModuleBase_ResultPrs)>::const_iterator aPrsIt;
492   for (aPrsIt = anObjectToPrs.cbegin(); aPrsIt != anObjectToPrs.cend(); aPrsIt++) {
493     aObjects.insert(aPrsIt->first);
494     aPrsIt->second->setHiddenSubShapeTransparency(useTransparency()? aTransp : 1);
495   }
496   if (redisplayObjects(aObjects))
497     flushRedisplay();
498 }
499
500 //********************************************************************
501 void XGUI_FacesPanel::onClosed()
502 {
503   setActivePanel(false);
504   reset(true);
505 }
506
507 //********************************************************************
508
509 void XGUI_FacesPanel::processUndo()
510 {
511  if(!myUndoList.size())
512    return;
513
514  myListView->selectIndices({myUndoList.back()});
515  processDelete();
516  myUndoList.pop_back();
517 }
518
519 //********************************************************************
520 void XGUI_FacesPanel::flushRedisplay() const
521 {
522   Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
523   // Necessary for update visibility icons in ObjectBrowser
524   XGUI_ObjectsBrowser* anObjectBrowser = myWorkshop->objectBrowser();
525   if (anObjectBrowser)
526     anObjectBrowser->updateAllIndexes();
527   myWorkshop->viewer()->update();
528 }
529
530
531 //********************************************************************
532 void XGUI_FacesPanel::onObjectDisplay(ObjectPtr theObject, AISObjectPtr theAIS)
533 {
534   bool aContains = false;
535   QMap<int, ModuleBase_ViewerPrsPtr>::iterator aIt;
536   for (aIt = myItems.begin(); aIt != myItems.end(); aIt++) {
537     ModuleBase_ViewerPrsPtr aPrs = aIt.value();
538     if (aPrs->object() == theObject) {
539       aContains = true;
540       break;
541     }
542   }
543   if (aContains) {
544     std::map<ObjectPtr, TopoDS_ListOfShape> aObjectToShapes;
545     std::map<ObjectPtr, Handle(ModuleBase_ResultPrs)> aObjectToPrs;
546     std::set<ObjectPtr> aObjects;
547     std::set<int> aIdsToRem;
548
549     TopoDS_ListOfShape aHideShapes;
550     std::map<ObjectPtr, TopoDS_ListOfShape>::const_iterator aSIt;
551     for (aIt = myItems.begin(); aIt != myItems.end(); aIt++) {
552       ModuleBase_ViewerPrsPtr aPrs = aIt.value();
553       if (aPrs->object() == theObject) {
554         TopoDS_Shape aShape = aPrs->shape()->impl<TopoDS_Shape>();
555         if (!aShape.IsNull())
556           aHideShapes.Append(aShape);
557         aPrs->setInteractive(theAIS->impl<Handle(AIS_InteractiveObject)>());
558       }
559     }
560     double aTransp = transparency();
561     if (aHideShapes.Size() > 0) {
562       Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(
563         theAIS->impl<Handle(AIS_InteractiveObject)>());
564       if (!aResultPrs.IsNull()) {
565         aResultPrs->setSubShapeHidden(aHideShapes);
566         aResultPrs->setHiddenSubShapeTransparency(aTransp);
567         aObjects.insert(theObject);
568       }
569     }
570     removeItems(aIdsToRem);
571     myWorkshop->selector()->clearSelection();
572     if (redisplayObjects(aObjects))
573       QTimer::singleShot(50, this, SLOT(flushRedisplay()));
574   }
575 }
576
577 void XGUI_FacesPanel::removeItems(std::set<int> theIds)
578 {
579   if (theIds.empty())
580     return;
581   myListView->removeItems(theIds);
582   std::set<int>::const_iterator aRIt;
583   for (aRIt = theIds.begin(); aRIt != theIds.end(); aRIt++)
584     myItems.remove(*aRIt);
585 }