RenderWindowInteractor
Introduction
vtkRenderWindowInteractor provides an interaction mechanism for mouse/key/time events. It handles routing of mouse/key/timer messages to vtkInteractorObserver and its subclasses. vtkRenderWindowInteractor also provides controls for picking, rendering frame rate.
vtkRenderWindowInteractor serves to hold user preferences and route messages to vtkInteractorStyle. Callbacks are available for many events. Platform specific subclasses should provide methods for manipulating timers, TerminateApp, and an event loop if required via
Initialize/Start/Enable/Disable.
Caveats
vtkRenderWindowInteractor routes events through VTK’s command/observer design pattern. That is, when vtkRenderWindowInteractor (actually, one of its subclasses) sees an event, it translates it into a VTK event using the InvokeEvent() method. Afterward, any vtkInteractorObservers registered for that event are expected to respond appropriately.
Methods
animationEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
button3DEvent
Triggers the 'Button3D' event.
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
cancelAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
requestor | Yes | ||
skipWarning | Boolean | No |
delete
Stop animating if the renderWindowInteractor is deleted.
disable
enable
Enable/Disable interactions. By default interactors are enabled when initialized. Initialize() must be called prior to enabling/disabling interaction. These methods are used when a window/widget is being shared by multiple renderers and interactors. This allows a "modal" display where one interactor is active when its data is to be displayed and all other interactors associated with the widget are disabled when their data is not displayed.
endAnimationEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endMouseMoveEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endMouseWheelEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endPanEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endPinchEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endPointerLockEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
endRotateEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
exitPointerLock
extend
Method use to decorate a given object (publicAPI+model) with vtkRenderWindowInteractor characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IRenderWindowInteractorInitialValues | No | (default: {}) |
findPokedRenderer
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | |
y | Number | Yes |
getContainer
getCurrentRenderer
getDesiredUpdateRate
getEnableRender
getEnabled
getFirstRenderer
getInitialized
getInteractorStyle
getLastFrameTime
getLightFollowCamera
getMouseScrollDebounceByPass
getPicker
getPreventDefaultOnPointerDown
getPreventDefaultOnPointerUp
getRecognizeGestures
getStillUpdateRate
getView
handleAnimation
handleKeyDown
| Argument | Type | Required | Description |
|---|---|---|---|
event | KeyboardEvent | Yes |
handleKeyPress
| Argument | Type | Required | Description |
|---|---|---|---|
event | KeyboardEvent | Yes |
handleKeyUp
| Argument | Type | Required | Description |
|---|---|---|---|
event | KeyboardEvent | Yes |
handleMouseDown
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handleMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handleMouseUp
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handlePointerCancel
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handlePointerDown
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handlePointerEnter
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handlePointerLeave
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handlePointerLockChange
handlePointerMove
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handlePointerUp
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handleTouchEnd
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handleTouchMove
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handleTouchStart
| Argument | Type | Required | Description |
|---|---|---|---|
event | PointerEvent | Yes |
handleVisibilityChange
handleWheel
| Argument | Type | Required | Description |
|---|---|---|---|
event | MouseEvent | Yes |
initialize
interactionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
invokeAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeButton3D
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndMouseWheel
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndPan
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndPinch
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndPointerLock
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeEndRotate
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeKeyDown
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeKeyPress
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeKeyUp
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeLeftButtonPress
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeLeftButtonRelease
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeMiddleButtonPress
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeMiddleButtonRelease
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeMouseEnter
invokeMouseLeave
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeMouseWheel
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeMove3D
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokePan
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokePinch
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokePointerEnter
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokePointerLeave
invokeRenderEvent
invokeRightButtonPress
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeRightButtonRelease
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeRotate
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartMouseWheel
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartPan
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartPinch
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartPointerLock
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
invokeStartRotate
| Argument | Type | Required | Description |
|---|---|---|---|
callData | IRenderWindowInteractorEvent | Yes |
isAnimating
isPointerLocked
keyDownEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
keyPressEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
keyUpEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
leftButtonPressEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
leftButtonReleaseEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
middleButtonPressEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
middleButtonReleaseEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
mouseEnterEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
mouseLeaveEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
mouseMoveEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
mouseWheelEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
move3DEvent
Triggers the 'Move3D' event.
| Argument | Type | Required | Description |
|---|---|---|---|
eventPayload | Yes |
newInstance
Method use to create a new instance of vtkRenderWindowInteractor
onAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onButton3D
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndMouseWheel
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndPan
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndPinch
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndPointerLock
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onEndRotate
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onKeyDown
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onKeyPress
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onKeyUp
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onLeftButtonPress
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onLeftButtonRelease
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onMiddleButtonPress
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onMiddleButtonRelease
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onMouseEnter
| Argument | Type | Required | Description |
|---|---|---|---|
cb | Yes | The callback to be called |
onMouseLeave
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onMouseWheel
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onMove3D
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onPan
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onPinch
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onPointerEnter
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onPointerLeave
| Argument | Type | Required | Description |
|---|---|---|---|
cb | Yes | The callback to be called |
onRenderEvent
| Argument | Type | Required | Description |
|---|---|---|---|
cb | Function | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onRightButtonPress
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onRightButtonRelease
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onRotate
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
cb | Yes | The callback to be called |
onStartInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartMouseMove
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartMouseWheel
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartPan
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartPinch
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartPointerLock
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
onStartRotate
| Argument | Type | Required | Description |
|---|---|---|---|
cb | InteractorEventCallback | Yes | The callback to be called. |
priority | Number | No | The priority of the event. |
panEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
pinchEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
recognizeGesture
we know we are in multitouch now, so start recognizing
| Argument | Type | Required | Description |
|---|---|---|---|
event | Yes | ||
positions | Yes |
render
only render if we are not animating. If we are animating then renders will happen naturally anyhow and we definitely do not want extra renders as the make the apparent interaction rate slower.
requestAnimation
| Argument | Type | Required | Description |
|---|---|---|---|
requestor | Yes |
requestPointerLock
returnFromVRAnimation
rightButtonPressEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
rightButtonReleaseEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
rotateEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
setContainer
Add an HTMLElement as the new container for the interactor. All events will be bound to this new container.
container will gain the tabIndex=0 attribute to catch keyboard events. container must have focus (manually via click or tab, or programmatically via .focus()) to receive keypress events Outline on focus can be customized with CSS :focus pseudo-class.
Any old container will be removed along with its listeners.
setCurrentRenderer
Manually sets the current renderer.
| Argument | Type | Required | Description |
|---|---|---|---|
ren | vtkRenderer | Yes |
setDesiredUpdateRate
Set the desired update rate.
| Argument | Type | Required | Description |
|---|---|---|---|
desiredUpdateRate | Yes |
setInteractorStyle
External switching between joystick/trackball/new? modes.
| Argument | Type | Required | Description |
|---|---|---|---|
style | Yes |
setLightFollowCamera
Turn on/off the automatic repositioning of lights as the camera moves.
| Argument | Type | Required | Description |
|---|---|---|---|
lightFollowCamera | Yes |
setMouseScrollDebounceByPass
Allow system to bypass scrolling debounce. This function must be called to allow the debounce to be bypassed
| Argument | Type | Required | Description |
|---|---|---|---|
mouseScrollDebounceByPass | Yes |
setPicker
Set the object used to perform pick operations.
| Argument | Type | Required | Description |
|---|---|---|---|
picker | Yes |
setPreventDefaultOnPointerDown
Set whether preventDefault is called on pointer down.
| Argument | Type | Required | Description |
|---|---|---|---|
preventDefault | Boolean | Yes |
setPreventDefaultOnPointerUp
Set whether preventDefault is called on pointer up.
If pointerup occurs without a preceeding pointerdown, then this does nothing.
| Argument | Type | Required | Description |
|---|---|---|---|
preventDefault | Boolean | Yes |
setRecognizeGestures
| Argument | Type | Required | Description |
|---|---|---|---|
recognizeGestures | Yes |
setRenderWindow
Set/Get the rendering window being controlled by this object.
| Argument | Type | Required | Description |
|---|---|---|---|
aren | Yes |
setStillUpdateRate
Set the desired update rate when movement has stopped.
| Argument | Type | Required | Description |
|---|---|---|---|
stillUpdateRate | Yes |
setView
| Argument | Type | Required | Description |
|---|---|---|---|
val | Yes |
start
Start the event loop. This is provided so that you do not have to implement your own event loop. You still can use your own event loop if you want.
startAnimationEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startEventLoop
startInteractionEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startMouseMoveEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startMouseWheelEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startPanEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startPinchEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startPointerLockEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
startRotateEvent
| Argument | Type | Required | Description |
|---|---|---|---|
args | Yes |
switchToVRAnimation
updateGamepads
| Argument | Type | Required | Description |
|---|---|---|---|
displayId | Number | Yes | The ID of the display. |