X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_SelectionMgr.cpp;h=b0d22089f8c3da6c6c7fe48836be2822bbe9225d;hb=6958dab7cbbaf443a39b04a609c5f33573c73f9e;hp=e7818bd9133b28d317c92834bedf839d17f4c0ec;hpb=43038cf5895f661133b3a21176d80a97d67c357e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index e7818bd91..b0d22089f 100644 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> + #include "XGUI_SelectionMgr.h" #include "XGUI_Workshop.h" @@ -38,6 +40,23 @@ void XGUI_SelectionMgr::connectViewers() connect(myWorkshop->viewer(), SIGNAL(selectionChanged()), this, SLOT(onViewerSelection())); } +//************************************************************** +void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& theSelectedOwners, + bool isUpdateViewer) +{ + SelectMgr_IndexedMapOfOwner aSelectedOwners; + selection()->selectedOwners(aSelectedOwners); + + Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); + for (Standard_Integer i = 1, n = theSelectedOwners.Extent(); i <= n; i++) { + Handle(SelectMgr_EntityOwner) anOwner = theSelectedOwners(i); + if (aSelectedOwners.FindIndex(anOwner) > 0) + continue; + + aContext->AddOrRemoveSelected(anOwner, isUpdateViewer); + } +} + //************************************************************** void XGUI_SelectionMgr::onObjectBrowserSelection() {