Documentation for vtkRenderWindowInteractor

vtkRenderWindowInteractor - provide event driven interface to rendering window

Super Class: vtkObject

Description:

vtkRenderWindowInteractor is a convenience object that provides event bindings to common graphics functions. For example, camera or actor zoom-in/zoom-out, pan, rotate, spin, dolly, scale, resetting in either trackball or joystick mode; picking of actors, points, or cells; switching in/out of stereo mode; property changes such as wireframe and surface; and a toggle to force the light to be placed at camera viewpoint (pointing in view direction).

 Mouse bindings:
    camera: Button 1 - rotate
            Button 2 - pan
            Button 3 - zoom
            ctrl-Button 1 - spin
    actor:  Button 1 - rotate
            Button 2 - pan
            Button 3 - uniform scale
            ctrl-Button 1 - spin
            ctrl-Button 2 - dolly.

 Keyboard bindings (upper or lower case):
    j - joystick like mouse interactions
    t - trackball like mouse interactions
    o - object/ actor interaction
    c - camera interaction
    r - reset camera view
    w - turn all actors wireframe
    s - turn all actors surface
    u - execute user defined function
    p - pick actor under mouse pointer (if pickable)
    3 - toggle in/out of 3D mode (if supported by renderer)
    e - exit
    q - exit
Camera mode and joystick mode are the default modes for compatibility. When "j" is pressed, the interaction models after a joystick. The distance from the center of the renderer viewport determines how quickly to rotate, pan, zoom, spin, and dolly. This is the default mode for compatiblity reasons. This is also known as position sensitive motion. When "t" is pressed, the interaction models after a trackball. Each mouse movement is used to move the actor or camera. When the mouse stops, the camera or actor motion is also stopped. This is also known as motion sensitive motion. Rotate, pan, and zoom work the same way as before. Spin has two different interfaces depending on whether the interactor is in trackball or joystick mode. In trackball mode, by moving the mouse around the camera or actor center in a circular motion, the camera or actor is spun. In joystick mode by moving the mouse in the y direction, the actor or camera is spun. Scale dolly, and zoom all work in the same manner, that motion of mouse in y direction generates the transformation. The event bindings for Camera mode and Actor mode are very similar, with the exception of zoom (Camera only), and scale and dolly (Actor only). The same user events elicit the same responses from the interactor. When the "p" key is pressed, an actor is selected using the user supplied picker if one exist, or the default picker if one does not. The picked actor is NOT used for actor mode interactions. To interact with an actor, click on the actor with the pointer in Actor mode, and an internal picker will select the appropriate actor. Since the selections of the actors are for different purposes, and handled by two different pickers, the previously selected actor will be unselected when the interaction mode has been switched between Actor mode and Camera mode. Interactors for a particular platform may have additional, specific event bindings. Please see the documentation for the subclasses.

 

See Also:

vtkXRenderWindowInteractor vtkWin32RenderWindowInteractor vtkPicker

 

Methods:

void vtkRenderWindowInteractor ()
void vtkRenderWindowInteractor ()
static vtkRenderWindowInteractor *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
void Initialize ()
void Start ()
void Enable ()
void Disable ()
int GetEnabled ()
void SetRenderWindow (vtkRenderWindow *)
vtkRenderWindow *GetRenderWindow ()
void SetLightFollowCamera (int )
int GetLightFollowCamera ()
void LightFollowCameraOn ()
void LightFollowCameraOff ()
void SetDesiredUpdateRate (float )
float GetDesiredUpdateRate ()
void SetStillUpdateRate (float )
float GetStillUpdateRate ()
int GetInitialized ()
void FindPokedCamera (int ,int )
void FindPokedRenderer (int ,int )
void HighlightActor (vtkActor *)
void SetStartPickMethod (const )
void SetStartPickMethodArgDelete (const )
void SetEndPickMethod (const )
void SetEndPickMethodArgDelete (const )
void SetStartInteractionPickMethod (const )
void SetStartInteractionPickMethodArgDelete (const )
void SetEndInteractionPickMethod (const )
void SetEndInteractionPickMethodArgDelete (const )
void SetPicker (vtkPicker *)
vtkPicker *GetPicker ()
vtkCellPicker *GetInteractionPicker ()
vtkPicker *CreateDefaultPicker ()
void SetUserMethod (const )
void SetUserMethodArgDelete (const )
void SetExitMethod (const )
void SetExitMethodArgDelete (const )
void SetTimerMethod (const )
void SetTimerMethodArgDelete (const )
void SetLeftButtonPressMethod (const )
void SetLeftButtonPressMethodArgDelete (const )
void SetLeftButtonReleaseMethod (const )
void SetLeftButtonReleaseMethodArgDelete (const )
void SetMiddleButtonPressMethod (const )
void SetMiddleButtonPressMethodArgDelete (const )
void SetMiddleButtonReleaseMethod (const )
void SetMiddleButtonReleaseMethodArgDelete (const )
void SetRightButtonPressMethod (const )
void SetRightButtonPressMethodArgDelete (const )
void SetRightButtonReleaseMethod (const )
void SetRightButtonReleaseMethodArgDelete (const )
void SetCameraModeMethod (const )
void SetCameraModeMethodArgDelete (const )
void SetActorModeMethod (const )
void SetActorModeMethodArgDelete (const )
void SetTrackballModeMethod (const )
void SetTrackballModeMethodArgDelete (const )
void SetJoystickModeMethod (const )
void SetJoystickModeMethodArgDelete (const )
void SetEventPosition (int ,int )
void SetEventPosition (int *)
int *GetEventPosition ()
void StartRotate ()
void EndRotate ()
void StartZoom ()
void EndZoom ()
void StartPan ()
void EndPan ()
void StartSpin ()
void EndSpin ()
void StartDolly ()
void EndDolly ()
void StartUniformScale ()
void EndUniformScale ()
void UnRegister (vtkObject *)
void SetPicker (vtkPicker &)
void SetActorModeToCamera ()
void SetActorModeToActor ()
int GetActorMode ()
void SetTrackballModeToTrackball ()
void SetTrackballModeToJoystick ()
int GetTrackballMode ()
void SetSize (int ,int )
void SetSize (int *)
int *GetSize ()
void ComputeDisplayToWorld (float ,float ,float ,float *)
void ComputeWorldToDisplay (float ,float ,float ,float *)
void ActorTransform (vtkActor * ,float * ,int ,float ,float *)
void JoystickRotateCamera (int ,int )
void JoystickSpinCamera (int ,int )
void JoystickPanCamera (int ,int )
void JoystickDollyCamera (int ,int )
void TrackballRotateCamera (int ,int )
void TrackballSpinCamera (int ,int )
void TrackballPanCamera (int ,int )
void TrackballDollyCamera (int ,int )
void JoystickRotateActor (int ,int )
void JoystickSpinActor (int ,int )
void JoystickPanActor (int ,int )
void JoystickDollyActor (int ,int )
void JoystickScaleActor (int ,int )
void TrackballRotateActor (int ,int )
void TrackballSpinActor (int ,int )
void TrackballPanActor (int ,int )
void TrackballDollyActor (int ,int )
void TrackballScaleActor (int ,int )

 

Detailed Method Descriptions:

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. Initialize should be called before Start.

void Initialize ()
void Start ()

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.

void Enable ()
void Disable ()
int GetEnabled ()

Set/Get the rendering window being controlled by this object.

void SetRenderWindow (vtkRenderWindow *)
vtkRenderWindow *GetRenderWindow ()

Turn on/off the automatic repositioning of lights as the camera moves.

void SetLightFollowCamera (int )
int GetLightFollowCamera ()
void LightFollowCameraOn ()
void LightFollowCameraOff ()

Set/Get the desired update rate. This is used by vtkLODActor's to tell them how quickly they need to render. This update is in effect only when the camera is being rotated, or zoomed. When the interactor is still, the StillUpdateRate is used instead.

void SetDesiredUpdateRate (float )
float GetDesiredUpdateRate ()

Set/Get the desired update rate when movement has stopped. See the SetDesiredUpdateRate method.

void SetStillUpdateRate (float )
float GetStillUpdateRate ()

See whether interactor has been initialized yet.

int GetInitialized ()

When an event occurs, we must determine which Renderer the event occurred within, since one RenderWindow may contain multiple renderers. We also need to know what camera to operate on. This is just the ActiveCamera of the poked renderer.

void FindPokedCamera (int ,int )
void FindPokedRenderer (int ,int )

When pick action successfully selects actor, this method highlights the actor appropriately. Currently this is done by placing a bounding box around the actor.

void HighlightActor (vtkActor *)

Specify a method to be executed prior to the pick operation.

void SetStartPickMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetStartPickMethodArgDelete (const )

Specify a method to be executed after the pick operation.

void SetEndPickMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetEndPickMethodArgDelete (const )

Specify a method to be executed prior to the pick operation.

void SetStartInteractionPickMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetStartInteractionPickMethodArgDelete (const )

Specify a method to be executed after the pick operation.

void SetEndInteractionPickMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetEndInteractionPickMethodArgDelete (const )

Set the object used to perform pick operations. You can use this to control what type of data is picked.

void SetPicker (vtkPicker *)

Get the object used to perform pick operations.

vtkPicker *GetPicker ()

Create default picker. Used to create one when none is specified.

vtkPicker *CreateDefaultPicker ()

Set the user method. This method is invoked on a "u" keypress.

void SetUserMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetUserMethodArgDelete (const )

Set the exit method. This method is invoked on a "e" or "q" keypress.

void SetExitMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetExitMethodArgDelete (const )

Set the timer method. This method is invoked during rotate/zoom/pan

void SetTimerMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetTimerMethodArgDelete (const )

Set the mouse event method, invoked on left mouse button press.

void SetLeftButtonPressMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetLeftButtonPressMethodArgDelete (const )

Set the mouse event method, invoked on left mouse button release.

void SetLeftButtonReleaseMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetLeftButtonReleaseMethodArgDelete (const )

Set the mouse event method, invoked on middle mouse button press.

void SetMiddleButtonPressMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetMiddleButtonPressMethodArgDelete (const )

Set the mouse event method, invoked on middle mouse button release.

void SetMiddleButtonReleaseMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetMiddleButtonReleaseMethodArgDelete (const )

Set the mouse event method, invoked on right mouse button press.

void SetRightButtonPressMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetRightButtonPressMethodArgDelete (const )

Set the mouse event method, invoked on right mouse button release.

void SetRightButtonReleaseMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetRightButtonReleaseMethodArgDelete (const )

This method is invoked on a "c" keypress

void SetCameraModeMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetCameraModeMethodArgDelete (const )

This method is invoked on a "a" keypress

void SetActorModeMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetActorModeMethodArgDelete (const )

This method is invoked on a "t" keypress

void SetTrackballModeMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetTrackballModeMethodArgDelete (const )

This method is invoked on a "j" keypress

void SetJoystickModeMethod (const )

Called when a void* argument is being discarded. Lets the user free it.

void SetJoystickModeMethodArgDelete (const )

This method can be used by user callbacks to get the x, y, coordinates of the current event.

void SetEventPosition (int ,int )
void SetEventPosition (int *)
int *GetEventPosition ()

Primarily internal methods used to start and stop interactions overridden in subclass to provide platform and hardware support

void StartRotate ()
void EndRotate ()
void StartZoom ()
void EndZoom ()
void StartPan ()
void EndPan ()
void StartSpin ()
void EndSpin ()
void StartDolly ()
void EndDolly ()
void StartUniformScale ()
void EndUniformScale ()

This Method detects loops of RenderWindow-Interactor, so objects are freed properly.

void UnRegister (vtkObject *)

For legacy compatibiltiy. Do not use.

void SetPicker (vtkPicker &)

External switching between actor and camera mode.

void SetActorModeToCamera ()
void SetActorModeToActor ()
int GetActorMode ()

External switching between joystick and trackball mode.

void SetTrackballModeToTrackball ()
void SetTrackballModeToJoystick ()
int GetTrackballMode ()

This methods sets the Size ivar of the interactor without actually changing the size of the window. Normally application programmers would use UpdateSize if anything. This is useful for letting someone else change the size of the rendering window and just letting the interactor know about the change.

void SetSize (int ,int )
void SetSize (int *)
int *GetSize ()