XGUI_Displayer* aDisplayer = myWorkshop->displayer();
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (aContext.IsNull())
+ return aPresentations;
+
if (aContext->HasOpenedContext()) {
for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
ModuleBase_ViewerPrs aPrs;
QObjectPtrList aSelectedList;
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
- Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
- ObjectPtr aResult = myWorkshop->displayer()->getObject(anIO);
- if (aResult)
- aSelectedList.append(aResult);
+ if (!aContext.IsNull()) {
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+ Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
+ ObjectPtr aResult = myWorkshop->displayer()->getObject(anIO);
+ if (aResult)
+ aSelectedList.append(aResult);
+ }
}
return aSelectedList;
}
}
}
+//**************************************************************
+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()) {