From ed7d3bcedc4d353d2167b94252619e11f35bd1f6 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 6 Jun 2005 05:44:08 +0000 Subject: [PATCH] Improve popup management --- src/SVTK/SVTK_InteractorStyle.cxx | 8 ++++++++ src/SVTK/SVTK_InteractorStyle.h | 3 ++- src/SVTK/SVTK_RenderWindowInteractor.cxx | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index 2508794c3..77338f4b1 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -185,6 +185,14 @@ SVTK_InteractorStyle Superclass::SetInteractor(theInteractor); } +//---------------------------------------------------------------------------- +int +SVTK_InteractorStyle +::GetState() +{ + return State | ForcedState; +} + //---------------------------------------------------------------------------- void SVTK_InteractorStyle diff --git a/src/SVTK/SVTK_InteractorStyle.h b/src/SVTK/SVTK_InteractorStyle.h index 5d04a1318..c82b592d5 100644 --- a/src/SVTK/SVTK_InteractorStyle.h +++ b/src/SVTK/SVTK_InteractorStyle.h @@ -78,6 +78,8 @@ class SVTK_EXPORT SVTK_InteractorStyle : public QObject, void setViewWindow(SVTK_ViewWindow* theViewWindow); void setGUIWindow(QWidget* theWindow); + virtual int GetState(); + void setTriedron(VTKViewer_Trihedron* theTrihedron); void setPreselectionProp(const double& theRed = 0, const double& theGreen = 1, @@ -134,7 +136,6 @@ class SVTK_EXPORT SVTK_InteractorStyle : public QObject, const int left, const int top, const int right, const int bottom); - int State; float MotionFactor; float RadianToDegree; // constant: for conv from deg to rad double myScale; diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index a3ecadfc8..1b32fc424 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -436,7 +436,7 @@ SVTK_RenderWindowInteractor (event->state() & ShiftButton), event->x(), event->y() ) ; - if(myInteractorStyle->GetState() == VTK_INTERACTOR_STYLE_CAMERA_NONE){ + if(myInteractorStyle->GetState() == VTK_INTERACTOR_STYLE_CAMERA_NONE && !( event->state() & KeyButtonMask )){ QContextMenuEvent aEvent( QContextMenuEvent::Mouse, event->pos(), event->globalPos(), event->state() ); -- 2.39.2