Salome HOME
Porting to SALOME_8.2.0 : Selection with SHIFT in sketch, stayed selection of point...
[modules/shaper.git] / src / XGUI / XGUI_SelectionMgr.cpp
index d126f49ced8fd49a5cc3527160d5f2e8524560b3..059f3e2a19f27ea575d8cbde260ed8d69e606232 100755 (executable)
@@ -61,6 +61,10 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the
 
   Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
   if (!aContext.IsNull()) {
+    /// previous selection should be cleared, else there will be decomposition of selections:
+    /// as AddOrRemoveSelected inverts current selection
+    aContext->ClearSelected(false);
+
     for  (Standard_Integer i = 1, n = theSelectedOwners.Extent(); i <= n; i++)  {
       Handle(SelectMgr_EntityOwner) anOwner = theSelectedOwners(i);
       if (aSelectedOwners.FindIndex(anOwner) > 0)
@@ -75,33 +79,6 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the
   }
 }
 
-//**************************************************************
-void XGUI_SelectionMgr::updateSelectedOwners(bool isUpdateViewer)
-{
-  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
-  if (aContext.IsNull())
-    return;
-
-  const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
-
-  SelectMgr_IndexedMapOfOwner anOwnersToDeselect;
-
-  SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
-  for (; anIt.More(); anIt.Next()) {
-    Handle(SelectMgr_Filter) aFilter = anIt.Value();
-    for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
-      Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
-      if (!aFilter->IsOk(anOwner))
-        anOwnersToDeselect.Add(aContext->SelectedOwner());
-    }
-  }
-
-  setSelectedOwners(anOwnersToDeselect, false);
-
-  if (isUpdateViewer)
-    aContext->UpdateCurrentViewer();
-}
-
 //**************************************************************
 void XGUI_SelectionMgr::onObjectBrowserSelection()
 {