Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / XGUI / XGUI_Selection.cpp
index 7b4bb5ff1601e0c22f1ca481dd0fcc3c9969bd38..23b11c9fbeeb83e81414bc31e2b1a1c2cef6a3e7 100644 (file)
@@ -157,16 +157,27 @@ void XGUI_Selection::selectedShapes(NCollection_List<TopoDS_Shape>& theList,
   }
 }
 
+//**************************************************************
+void XGUI_Selection::selectedOwners(SelectMgr_IndexedMapOfOwner& theSelectedOwners) const
+{
+  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+
+  for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+    theSelectedOwners.Add(aContext->SelectedOwner());
+  }
+}
+
 //**************************************************************
 void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject,
-                                  const Handle(AIS_InteractiveContext)& theContext,
-                                  SelectMgr_IndexedMapOfOwner& theOwners)
+                                  SelectMgr_IndexedMapOfOwner& theOwners) const
 {
-    if (theObject.IsNull() || theContext.IsNull())
+  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+
+  if (theObject.IsNull() || aContext.IsNull())
     return;
 
   TColStd_ListOfInteger aModes;
-  theContext->ActivatedModes(theObject, aModes);
+  aContext->ActivatedModes(theObject, aModes);
 
   TColStd_ListIteratorOfListOfInteger anIt(aModes);
   for (; anIt.More(); anIt.Next()) {