From 1c1872b6ce75bd426cf3ff00fda1c5cdd04a6e48 Mon Sep 17 00:00:00 2001 From: mbs Date: Tue, 4 Apr 2023 17:07:24 +0100 Subject: [PATCH] allow to use view cube during feature creation/edition --- src/OCCViewer/OCCViewer_ViewModel.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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(); } -- 2.39.2