]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
VISU 2008 - Unification of the VISU selection functionality (debug)
authorouv <ouv@opencascade.com>
Tue, 5 Aug 2008 13:15:32 +0000 (13:15 +0000)
committerouv <ouv@opencascade.com>
Tue, 5 Aug 2008 13:15:32 +0000 (13:15 +0000)
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_GaussPtsAct.cxx
src/VISUGUI/VisuGUI.cxx

index 2f6fb847eb4c7b4d62f9f85d3c464fdf88a63395..210514848cd92e54cc2aa43287a0308f7af233d1 100644 (file)
@@ -701,20 +701,19 @@ VISU_Actor
   bool anInitialHasIndex = isHighlighted();
   bool aCurrentHasIndex = theIsHighlight;
 
-  vtkFloatingPointType aZoomFactor = aPickingSettings->GetZoomFactor();
   if( !theIsHighlight && mySelectionMode == ActorSelection && isSubElementsHighlighted() )
   {
-    aZoomFactor *= aZoomFactor;
     myIsSubElementsHighlighted = false;
-  }
 
-  // Zoom
-  if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
-  {
-    ChangeZoom(aZoomFactor,
-              GetRenderer(),
-              anInitialHasIndex,
-              aCurrentHasIndex);
+    // Zoom
+    if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
+    {
+      vtkFloatingPointType aZoomFactor = aPickingSettings->GetZoomFactor();
+      ChangeZoom(aZoomFactor,
+                GetRenderer(),
+                anInitialHasIndex,
+                aCurrentHasIndex);
+    }
   }
 
   Superclass::highlight(theIsHighlight);
index 8660ff35ed4a4dd03e2c1e1c1db6a91f56dbf61f..4dad7b29702b403a69685f65de0f8d97ca3061a2 100644 (file)
@@ -952,7 +952,7 @@ VISU_GaussPtsAct
   myIsSubElementsHighlighted = aCurrentHasIndex;
 
   // Zoom if necessary
-  if( anIsVisible && aPickingSettings->GetCameraMovementEnabled() )
+  if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
   {
     ChangeZoom(aPickingSettings,
               GetRenderer(),
index 958c33bb3f7fb8e8e6e4f5f7c8ed6f2137db4aff..ccc7be10de5ae6c49adb9eed1d981be8d161c664 100644 (file)
@@ -1847,9 +1847,11 @@ VisuGUI
   if( !anAction )
     return;
 
+  bool isAnyChecked = false;
   for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
   {
     QAction* aRefAction = action( anId );
+    isAnyChecked |= aRefAction->isChecked();
     if( anAction != aRefAction )
       aRefAction->setChecked( false );
     else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
@@ -1859,6 +1861,9 @@ VisuGUI
        aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
     }
   }
+  // At least one action must be checked
+  if( !isAnyChecked )
+    anAction->setChecked( true );
 }
 
 //----------------------------------------------------------------------------