X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Selection.cpp;h=1b91cb3dccad3b2dc905d617c40f91ebf8b16474;hb=4fcd5da2d972334e887716499b0ea75d9d6c51c2;hp=b42f8c4b9926c24334bde2944e658ebb099a8fe6;hpb=db1bdf5481826c868b2c92c6cbc9afe8c5ad337c;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index b42f8c4b9..1b91cb3dc 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -14,9 +14,8 @@ #include - XGUI_Selection::XGUI_Selection(XGUI_Workshop* theWorkshop) -: myWorkshop(theWorkshop) + : myWorkshop(theWorkshop) { } @@ -81,7 +80,7 @@ QList XGUI_Selection::selectedObjects() const { return myWorkshop->objectBrowser()->selectedObjects(); } - + QList XGUI_Selection::selectedPresentations() const { QList aSelectedList; @@ -96,10 +95,9 @@ QList XGUI_Selection::selectedPresentations() const return aSelectedList; } - //************************************************************** -QModelIndexList XGUI_Selection::selectedIndexes() const -{ +QModelIndexList XGUI_Selection::selectedIndexes() const +{ return myWorkshop->objectBrowser()->selectedIndexes(); } @@ -113,13 +111,20 @@ void XGUI_Selection::selectedAISObjects(AIS_ListOfInteractive& theList) const } //************************************************************** -void XGUI_Selection::selectedShapes(NCollection_List& theList) const +void XGUI_Selection::selectedShapes(NCollection_List& theList, + std::list& theOwners) const { theList.Clear(); Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) { TopoDS_Shape aShape = aContext->SelectedShape(); - if (!aShape.IsNull()) + if (!aShape.IsNull()) { theList.Append(aShape); + Handle(SelectMgr_EntityOwner) aEO = aContext->SelectedOwner(); + Handle(AIS_InteractiveObject) anObj = + Handle(AIS_InteractiveObject)::DownCast(aEO->Selectable()); + ObjectPtr anObject = myWorkshop->displayer()->getObject(anObj); + theOwners.push_back(anObject); + } } }