From: mbs Date: Tue, 4 Apr 2023 16:07:24 +0000 (+0100) Subject: allow to use view cube during feature creation/edition X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1c1872b6ce75bd426cf3ff00fda1c5cdd04a6e48;p=modules%2Fgui.git allow to use view cube during feature creation/edition --- diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index f57115479..33503afc4 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -393,8 +393,20 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t if (aHasShift && myMultiSelectionEnabled) myAISContext->ShiftSelect( Standard_True ); - else - myAISContext->Select( Standard_True ); + else { + AIS_StatusOfPick sop = myAISContext->Select( Standard_True ); + if (sop == AIS_SOP_NothingSelected) { + // Check whether the ViewCube had been picked to change view orientation + // => in this case, we don't want any existing selection in the active widget + // been cleared + Handle(SelectMgr_EntityOwner) anOwner = myAISContext->DetectedOwner(); + if (!anOwner.IsNull() && anOwner->HasSelectable()) { + Handle(SelectMgr_SelectableObject) aSelObj = anOwner->Selectable(); + if (!aSelObj.IsNull() && aSelObj->IsKind(STANDARD_TYPE(AIS_ViewCube))) + return; + } + } + } emit selectionChanged(); }