From a355dbeae535bb8f95ed4cb18d3ae065d3df4c19 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 5 Aug 2008 13:15:32 +0000 Subject: [PATCH] VISU 2008 - Unification of the VISU selection functionality (debug) --- src/OBJECT/VISU_Actor.cxx | 19 +++++++++---------- src/OBJECT/VISU_GaussPtsAct.cxx | 2 +- src/VISUGUI/VisuGUI.cxx | 5 +++++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 2f6fb847..21051484 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -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); diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 8660ff35..4dad7b29 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -952,7 +952,7 @@ VISU_GaussPtsAct myIsSubElementsHighlighted = aCurrentHasIndex; // Zoom if necessary - if( anIsVisible && aPickingSettings->GetCameraMovementEnabled() ) + if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() ) { ChangeZoom(aPickingSettings, GetRenderer(), diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 958c33bb..ccc7be10 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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 ); } //---------------------------------------------------------------------------- -- 2.39.2