]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
allow to use view cube during feature creation/edition mbs/viewcube
authormbs <martin.bernhard@opencascade.com>
Tue, 4 Apr 2023 16:07:24 +0000 (17:07 +0100)
committermbs <martin.bernhard@opencascade.com>
Tue, 4 Apr 2023 16:07:24 +0000 (17:07 +0100)
src/OCCViewer/OCCViewer_ViewModel.cxx

index f5711547926e9ccb7ef73daa14b7d4997299e080..33503afc444d1d7263b6a8c2a865d8e3f90b840d 100644 (file)
@@ -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();
   }