From b9bb8584631e27043dec2f10e7fce396d0fed4b7 Mon Sep 17 00:00:00 2001 From: san Date: Sat, 21 Feb 2009 10:35:52 +0000 Subject: [PATCH] Local selection was broken after rotation due to incorrect myPoint and myOtherPoint values --- src/SVTK/SVTK_InteractorStyle.cxx | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index 56e56467b..199c3729d 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -555,16 +555,24 @@ void SVTK_InteractorStyle ::OnLeftButtonUp(int vtkNotUsed(ctrl), int shift, - int vtkNotUsed(x), - int vtkNotUsed(y)) -{ + int x, + int y) +{ + // san (21.02.2009): State == VTK_INTERACTOR_STYLE_CAMERA_NONE when the left button is released + // and single selection is enabled means a selection event + if ( State == VTK_INTERACTOR_STYLE_CAMERA_NONE ) { + if ( isSelectionEnabled() && !isMultiSelectionEnabled() ) { + myOtherPoint = myPoint = QPoint(x, y); + startOperation(VTK_INTERACTOR_STYLE_CAMERA_SELECT); + } + } + myShiftState = shift; // finishing current viewer operation - // san (20.02.2009): State == VTK_INTERACTOR_STYLE_CAMERA_NONE is also processed - // by onFinishOperation(), it might mean that the left button was pressed when - // no multi-selection is allowed - onFinishOperation(); - startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE); + if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) { + onFinishOperation(); + startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE); + } } /*! @@ -1053,11 +1061,6 @@ SVTK_InteractorStyle SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY(); switch (State) { - case VTK_INTERACTOR_STYLE_CAMERA_NONE: - // san (19.02.2009): If we are here, and single selection is enabled, - // then we should process the mouse click - and break otherwise - if ( !isSelectionEnabled() || isMultiSelectionEnabled() ) - break; case VTK_INTERACTOR_STYLE_CAMERA_SELECT: case VTK_INTERACTOR_STYLE_CAMERA_FIT: { -- 2.39.2