Commit 90ee1cca authored by Sebastien Jourdain's avatar Sebastien Jourdain Committed by Kitware Robot
Browse files

Merge topic 'fix-pvw-protocols'

dfaf183c VTKWeb update to allow server side notification to client
8f0c2934 Merge topic 'release-fix-interactor-pyqt5-compatibility' into release
6b1d302f

 Fix mouse wheel zooming in PyQt interactor
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1212
parents a8b44883 dfaf183c
Pipeline #7072 canceled with stage
......@@ -102,6 +102,7 @@ class ServerProtocol(ApplicationSession):
imageCapture.setApplication(self.Application)
def registerVtkWebProtocol(self, protocol):
protocol.coreServer = self
protocol.setApplication(self.Application)
self.vtkWebProtocols.append(protocol)
......
......@@ -209,6 +209,7 @@ class QVTKRenderWindowInteractor(QVTKRWIBaseClass):
self.__saveY = 0
self.__saveModifiers = Qt.NoModifier
self.__saveButtons = Qt.NoButton
self.__wheelDelta = 0
# do special handling of some keywords:
# stereo, rw
......@@ -456,10 +457,17 @@ class QVTKRenderWindowInteractor(QVTKRWIBaseClass):
self._Iren.KeyReleaseEvent()
def wheelEvent(self, ev):
if ev.delta() >= 0:
self._Iren.MouseWheelForwardEvent()
if hasattr(ev, 'delta'):
self.__wheelDelta += ev.delta()
else:
self.__wheelDelta += ev.angleDelta().y()
if self.__wheelDelta >= 120:
self._Iren.MouseWheelForwardEvent()
self.__wheelDelta = 0
elif self.__wheelDelta <= -120:
self._Iren.MouseWheelBackwardEvent()
self.__wheelDelta = 0
def GetRenderWindow(self):
return self._RenderWindow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment