- Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- if (!aContext.IsNull()) {
- AIS_ListOfInteractive aList;
- aContext->DisplayedObjects(aList, true);
- AIS_ListIteratorOfListOfInteractive aIt;
- for (aIt.Initialize(aList); aIt.More(); aIt.Next()) {
- Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(aIt.Value());
- if (!aTrihedron.IsNull()) {
- aContext->Deactivate(aTrihedron);
- }
- }
+ if (!theObject.IsNull()) {
+ theContext->Deactivate(theObject);
+ //if (theClear) {
+ //theObject->ClearSelected();
+ // theContext->LocalContext()->ClearOutdatedSelection(theObject, true);
+ //}
+ }
+}
+
+void XGUI_Displayer::deactivateTrihedron(const bool theUpdateViewer) const
+{
+ Handle(AIS_InteractiveObject) aTrihedron = getTrihedron();
+ Handle(AIS_InteractiveContext) aContext = AISContext();
+ if (!aTrihedron.IsNull() && aContext->IsDisplayed(aTrihedron)) {
+ Handle(AIS_Trihedron) aTrie = Handle(AIS_Trihedron)::DownCast(aTrihedron);
+ deactivateObject(aContext, aTrie);
+
+ /// #1136 hidden axis are selected in sketch
+ /// workaround for Cascade: there is a crash in AIS_LocalContext::ClearOutdatedSelection
+ /// for Position AIS object in SelectionModes.
+ deactivateObject(aContext, aTrie->XAxis());
+ deactivateObject(aContext, aTrie->YAxis());
+ deactivateObject(aContext, aTrie->Axis());
+ deactivateObject(aContext, aTrie->Position());
+
+ deactivateObject(aContext, aTrie->XYPlane());
+ deactivateObject(aContext, aTrie->XZPlane());
+ deactivateObject(aContext, aTrie->YZPlane());
+
+ if (theUpdateViewer)
+ updateViewer();