//#define DEBUG_OCCT_SHAPE_SELECTION
-//#define DEBUG_OCCT_26172
-
void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList)
{
// Get from null point
return anInfo.join(theSeparator);
}
+void deselectPresentation(const Handle(AIS_InteractiveObject) theObject,
+ const Handle(AIS_InteractiveContext)& theContext)
+{
+ NCollection_List<Handle(SelectBasics_EntityOwner)> aResultOwners;
+
+ for (theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected()) {
+ Handle(SelectMgr_EntityOwner) anOwner = theContext->SelectedOwner();
+ if (anOwner.IsNull()) // TODO: check why it is possible
+ continue;
+ if (anOwner->Selectable() == theObject && anOwner->IsSelected())
+ aResultOwners.Append(anOwner);
+
+ aResultOwners.Append(anOwner);
+ }
+ NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (aResultOwners);
+ Handle(SelectMgr_EntityOwner) anOwner;
+ for (; anOwnersIt.More(); anOwnersIt.Next()) {
+ anOwner = Handle(SelectMgr_EntityOwner)::DownCast(anOwnersIt.Value());
+ if (!anOwner.IsNull())
+ theContext->AddOrRemoveSelected(anOwner, false);
+ }
+}
+
XGUI_Displayer::XGUI_Displayer(XGUI_Workshop* theWorkshop)
: myWorkshop(theWorkshop), myNeedUpdate(false),
myIsTrihedronActive(true), myViewerBlockedRecursiveCount(0),
if (aNeedToRestoreSelection)
myWorkshop->module()->storeSelection();
+ deselectPresentation(aAISIO, aContext);
aContext->Redisplay(aAISIO, false);
#ifdef VINSPECTOR
}
}
if (isDeactivated) {
-#ifdef DEBUG_OCCT_26172
- // the selection from the previous activation modes should be cleared manually (#26172)
- theIO->ClearSelected();
- #ifdef VINSPECTOR
- if (getCallBack()) getCallBack()->ClearSelected(theIO);
- #endif
-#endif
// For performance issues
//if (theUpdateViewer)
// updateViewer();