X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_SelectionMgr.cpp;h=ad92b420b0568a91ebf1e53bfbf049e71a6a6231;hb=1cef78af4c4328ecf99a3ced86bda38e6e82e15c;hp=6136e93f80f3550866ef9e587f4f19c4713e7715;hpb=c3ae28ba30027cc4a6a757ef623f40adaae96ead;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index 6136e93f8..ad92b420b 100644 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -107,11 +107,10 @@ void XGUI_SelectionMgr::onViewerSelection() QObjectPtrList aFeatures; Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); if (!aContext.IsNull()) { - for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) { - Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive(); - ObjectPtr aResult = myWorkshop->displayer()->getObject(anIO); - if (aResult) - aFeatures.append(aResult); + QList aPresentations = selection()->getSelected(ModuleBase_ISelection::Viewer); + foreach(ModuleBase_ViewerPrs aPrs, aPresentations) { + if (aPrs.object().get()) + aFeatures.append(aPrs.object()); } } bool aBlocked = myWorkshop->objectBrowser()->blockSignals(true); @@ -121,6 +120,17 @@ void XGUI_SelectionMgr::onViewerSelection() emit selectionChanged(); } +//************************************************************** +void XGUI_SelectionMgr::updateSelectionBy(const ModuleBase_ISelection::SelectionPlace& thePlace) +{ + QList aSelectedPrs = + myWorkshop->selector()->selection()->getSelected(thePlace); + if (thePlace == ModuleBase_ISelection::Browser) { + XGUI_Displayer* aDisplayer = myWorkshop->displayer(); + aDisplayer->setSelected(aSelectedPrs); + } + +} //************************************************************** void XGUI_SelectionMgr::clearSelection() {