Dear All,
I am working with VTK-based remote vis from this template and I have to implement a gesture support.
It seems that for this I have to extend code with rpcGestureEvent similarly to how it is done for rpcRemoteWheel in js code and python RPC implementation
However, I am not sure how to write a python part, what the event type and other data will be transferred and etc. Do I understand correctly that for this I should reference a vtkInteractorStyleRemoteMouse class ?
Is there any example of handling gestures in remote visualisation such as pinch, tap?
Thank you very much in advance,
Best regards,
Evgeniya
if 'StartPinch' in event["type"]:
self.getApplication().InvokeEvent('StartInteractionEvent')
renderWindow = self.getView(event['view'])
print("StartPinch")
camera = renderWindow.GetRenderers().GetFirstRenderer().GetActiveCamera()
self.fp = camera.GetFocalPoint()
self.pos = camera.GetPosition()
if 'Pinch' in event["type"]:
renderWindow = self.getView(event['view'])
if renderWindow and 'scale' in event:
scaleF=1.5
zoomFactor = event['scale']/scaleF;
camera = renderWindow.GetRenderers().GetFirstRenderer().GetActiveCamera()
camera.Zoom(zoomFactor)
renderWindow.Modified()
if 'EndPinch' in event["type"]:
self.getApplication().InvokeEvent('EndInteractionEvent')