Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vtkInteractorStyleUser Class Reference

provides customizable interaction routines. More...

#include <vtkInteractorStyleUser.h>

Inheritance diagram for vtkInteractorStyleUser:

Inheritance graph
[legend]
Collaboration diagram for vtkInteractorStyleUser:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void SetMouseMoveMethod (void(*f)(void *), void *arg)
void SetMouseMoveMethodArgDelete (void(*f)(void *))
void SetButtonPressMethod (void(*f)(void *), void *arg)
void SetButtonPressMethodArgDelete (void(*f)(void *))
void SetButtonReleaseMethod (void(*f)(void *), void *arg)
void SetButtonReleaseMethodArgDelete (void(*f)(void *))
void SetKeyPressMethod (void(*f)(void *), void *arg)
void SetKeyPressMethodArgDelete (void(*f)(void *))
void SetKeyReleaseMethod (void(*f)(void *), void *arg)
void SetKeyReleaseMethodArgDelete (void(*f)(void *))
void SetCharMethod (void(*f)(void *), void *arg)
void SetCharMethodArgDelete (void(*f)(void *))
void SetConfigureMethod (void(*f)(void *), void *arg)
void SetConfigureMethodArgDelete (void(*f)(void *))
void SetEnterMethod (void(*f)(void *), void *arg)
void SetEnterMethodArgDelete (void(*f)(void *))
void SetLeaveMethod (void(*f)(void *), void *arg)
void SetLeaveMethodArgDelete (void(*f)(void *))
void SetTimerMethod (void(*f)(void *), void *arg)
void SetTimerMethodArgDelete (void(*f)(void *))
virtual int * GetLastPos ()
virtual void GetLastPos (int &, int &)
virtual void GetLastPos (int[2])
virtual int * GetOldPos ()
virtual void GetOldPos (int &, int &)
virtual void GetOldPos (int[2])
virtual int GetShiftKey ()
virtual int GetCtrlKey ()
virtual int GetChar ()
virtual char * GetKeySym ()
virtual int GetButton ()
void SetUserInteractionMethod (void(*f)(void *), void *arg)
void SetUserInteractionMethodArgDelete (void(*f)(void *))
void StartUserInteraction ()
void EndUserInteraction ()

Static Public Methods

vtkInteractorStyleUser * New ()
int IsTypeOf (const char *type)
vtkInteractorStyleUser * SafeDownCast (vtkObject *o)

Protected Methods

 vtkInteractorStyleUser ()
 ~vtkInteractorStyleUser ()
void OnChar (int ctrl, int shift, char keycode, int repeatcount)
void OnKeyPress (int ctrl, int shift, char keycode, char *keysym, int repeatcount)
void OnKeyRelease (int ctrl, int shift, char keycode, char *keysym, int repeatcount)
void OnLeftButtonDown (int ctrl, int shift, int X, int Y)
void OnLeftButtonUp (int ctrl, int shift, int X, int Y)
void OnMiddleButtonDown (int ctrl, int shift, int X, int Y)
void OnMiddleButtonUp (int ctrl, int shift, int X, int Y)
void OnRightButtonDown (int ctrl, int shift, int X, int Y)
void OnRightButtonUp (int ctrl, int shift, int X, int Y)
void OnMouseMove (int ctrl, int shift, int X, int Y)
void OnConfigure (int width, int height)
void OnEnter (int ctrl, int shift, int X, int Y)
void OnLeave (int ctrl, int shift, int X, int Y)
void OnTimer (void)
void vtkSetOldCallback (unsigned long &tag, unsigned long event, void(*f)(void *), void *arg)
void vtkSetOldDelete (unsigned long tag, void(*f)(void *))

Protected Attributes

int OldPos [2]
int Char
char * KeySym
int Button
unsigned long MouseMoveTag
unsigned long KeyPressTag
unsigned long KeyReleaseTag
unsigned long CharTag
unsigned long EnterTag
unsigned long LeaveTag
unsigned long ConfigureTag
unsigned long TimerTag
unsigned long UserTag

Detailed Description

provides customizable interaction routines.

Date:
2001/11/13 14:17:21
Revision:
1.20

The most common way to customize user interaction is to write a subclass of vtkInteractorStyle: vtkInteractorStyleUser allows you to customize the interaction to without subclassing vtkInteractorStyle. This is particularly useful for setting up custom interaction modes in scripting languages such as Tcl and Python. This class allows you to hook into the MouseMove, ButtonPress/Release, KeyPress/Release, etc. events. If you want to hook into just a single mouse button, but leave the interaction modes for the others unchanged, you must use e.g. SetMiddleButtonPressMethod() instead of the more general SetButtonPressMethod().

Events:
vtkCommand::LeftButtonReleaseEvent vtkCommand::RightButtonPressEvent vtkCommand::UserEvent vtkCommand::MouseMoveEvent vtkCommand::MiddleButtonReleaseEvent vtkCommand::EnterEvent vtkCommand::TimerEvent vtkCommand::ConfigureEvent vtkCommand::KeyPressEvent vtkCommand::RightButtonReleaseEvent vtkCommand::MiddleButtonPressEvent vtkCommand::CharEvent vtkCommand::LeaveEvent vtkCommand::LeftButtonPressEvent vtkCommand::KeyReleaseEvent

Definition at line 71 of file vtkInteractorStyleUser.h.


Constructor & Destructor Documentation

vtkInteractorStyleUser::vtkInteractorStyleUser   [protected]
 

vtkInteractorStyleUser::~vtkInteractorStyleUser   [protected]
 


Member Function Documentation

vtkInteractorStyleUser* vtkInteractorStyleUser::New   [static]
 

This class must be supplied with a vtkRenderWindowInteractor wrapper or parent. This class should not normally be instantiated by application programmers.

Reimplemented from vtkInteractorStyleSwitch.

virtual const char* vtkInteractorStyleUser::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkInteractorStyleSwitch.

int vtkInteractorStyleUser::IsTypeOf const char *    type [static]
 

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkInteractorStyleSwitch.

virtual int vtkInteractorStyleUser::IsA const char *    type [virtual]
 

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkInteractorStyleSwitch.

vtkInteractorStyleUser* vtkInteractorStyleUser::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::PrintSelf ostream &    os,
vtkIndent    indent
[virtual]
 

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkInteractorStyle.

void vtkInteractorStyleUser::SetMouseMoveMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called every time the mouse is moved. You can use GetLastPos() to determine the position of the cursor in display coordinates, and GetOldPos() to determine the previous position. Use GetButton() to query which mouse button is being held down. This should be used in conjunction with SetButtonPressMethod()/SetButtonReleaseMethod() or with the individual SetXXButtonPressMethods in vtkInteractorStyle.

void vtkInteractorStyleUser::SetMouseMoveMethodArgDelete void(*    f)(void *)
 

Set a method that will be called every time the mouse is moved. You can use GetLastPos() to determine the position of the cursor in display coordinates, and GetOldPos() to determine the previous position. Use GetButton() to query which mouse button is being held down. This should be used in conjunction with SetButtonPressMethod()/SetButtonReleaseMethod() or with the individual SetXXButtonPressMethods in vtkInteractorStyle.

void vtkInteractorStyleUser::SetButtonPressMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called whenever a mouse button is pressed. Use GetButton() to query which button was pressed. This simply calls SetLeftButtonPressMethod(method), SetMiddleButtonPressMethod(method), SetRightButtonPressMethod(method).

void vtkInteractorStyleUser::SetButtonPressMethodArgDelete void(*    f)(void *)
 

Set a method that will be called whenever a mouse button is pressed. Use GetButton() to query which button was pressed. This simply calls SetLeftButtonPressMethod(method), SetMiddleButtonPressMethod(method), SetRightButtonPressMethod(method).

void vtkInteractorStyleUser::SetButtonReleaseMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called whenever a mouse button is released. Use GetButton() to query which button was released. This simply calls SetLeftButtonReleaseMethod(method), SetMiddleButtonReleaseMethod(method), SetRightButtonReleaseMethod(method).

void vtkInteractorStyleUser::SetButtonReleaseMethodArgDelete void(*    f)(void *)
 

Set a method that will be called whenever a mouse button is released. Use GetButton() to query which button was released. This simply calls SetLeftButtonReleaseMethod(method), SetMiddleButtonReleaseMethod(method), SetRightButtonReleaseMethod(method).

void vtkInteractorStyleUser::SetKeyPressMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called every time a key is pressed. Use GetKeySym() to find out which key was pressed. They keystroke is also converted into a character, which can be retrieved using GetChar().

void vtkInteractorStyleUser::SetKeyPressMethodArgDelete void(*    f)(void *)
 

Set a method that will be called every time a key is pressed. Use GetKeySym() to find out which key was pressed. They keystroke is also converted into a character, which can be retrieved using GetChar().

void vtkInteractorStyleUser::SetKeyReleaseMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called every time a key is released. Use GetKeySym to find out which key was released. They keystroke is also converted into a character, which can be retrieved using GetChar().

void vtkInteractorStyleUser::SetKeyReleaseMethodArgDelete void(*    f)(void *)
 

Set a method that will be called every time a key is released. Use GetKeySym to find out which key was released. They keystroke is also converted into a character, which can be retrieved using GetChar().

void vtkInteractorStyleUser::SetCharMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called every time a character is received. This is not the same as the KeyPress method, which is called when any key (including shift or control) is pressed. Use GetChar() to find out which char was received.

void vtkInteractorStyleUser::SetCharMethodArgDelete void(*    f)(void *)
 

Set a method that will be called every time a character is received. This is not the same as the KeyPress method, which is called when any key (including shift or control) is pressed. Use GetChar() to find out which char was received.

void vtkInteractorStyleUser::SetConfigureMethod void(*    f)(void *),
void *    arg
 

Set methods that will be called when the size of the render window changes (this method is called just before the window re-renders after the size change). Call GetSize() on the interactor to find out the new size.

void vtkInteractorStyleUser::SetConfigureMethodArgDelete void(*    f)(void *)
 

Set methods that will be called when the size of the render window changes (this method is called just before the window re-renders after the size change). Call GetSize() on the interactor to find out the new size.

void vtkInteractorStyleUser::SetEnterMethod void(*    f)(void *),
void *    arg
 

Set methods to be called when the mouse enters or leaves the window. Use GetLastPos() to determine where the mouse pointer was when the event occurred.

void vtkInteractorStyleUser::SetEnterMethodArgDelete void(*    f)(void *)
 

Set methods to be called when the mouse enters or leaves the window. Use GetLastPos() to determine where the mouse pointer was when the event occurred.

void vtkInteractorStyleUser::SetLeaveMethod void(*    f)(void *),
void *    arg
 

Set methods to be called when the mouse enters or leaves the window. Use GetLastPos() to determine where the mouse pointer was when the event occurred.

void vtkInteractorStyleUser::SetLeaveMethodArgDelete void(*    f)(void *)
 

Set methods to be called when the mouse enters or leaves the window. Use GetLastPos() to determine where the mouse pointer was when the event occurred.

void vtkInteractorStyleUser::SetTimerMethod void(*    f)(void *),
void *    arg
 

Set a method that will be called continuously at a fairly rapid rate (fast enough to be used for interaction). For this method to work, it must be called after the RenderWindowInteractor has been Initialized.

void vtkInteractorStyleUser::SetTimerMethodArgDelete void(*    f)(void *)
 

Set a method that will be called continuously at a fairly rapid rate (fast enough to be used for interaction). For this method to work, it must be called after the RenderWindowInteractor has been Initialized.

virtual int* vtkInteractorStyleUser::GetLastPos   [virtual]
 

Get the most recent mouse position during mouse motion. In your user interaction method, you must use this to track the mouse movement. Do not use GetEventPosition(), which records the last position where a mouse button was pressed.

virtual void vtkInteractorStyleUser::GetLastPos int &   ,
int &   
[virtual]
 

Get the most recent mouse position during mouse motion. In your user interaction method, you must use this to track the mouse movement. Do not use GetEventPosition(), which records the last position where a mouse button was pressed.

virtual void vtkInteractorStyleUser::GetLastPos int   [2] [virtual]
 

Get the most recent mouse position during mouse motion. In your user interaction method, you must use this to track the mouse movement. Do not use GetEventPosition(), which records the last position where a mouse button was pressed.

virtual int* vtkInteractorStyleUser::GetOldPos   [virtual]
 

Get the previous mouse position during mouse motion, or after a key press. This can be used to calculate the relative displacement of the mouse.

virtual void vtkInteractorStyleUser::GetOldPos int &   ,
int &   
[virtual]
 

Get the previous mouse position during mouse motion, or after a key press. This can be used to calculate the relative displacement of the mouse.

virtual void vtkInteractorStyleUser::GetOldPos int   [2] [virtual]
 

Get the previous mouse position during mouse motion, or after a key press. This can be used to calculate the relative displacement of the mouse.

virtual int vtkInteractorStyleUser::GetShiftKey   [virtual]
 

Test whether modifiers were held down when mouse button or key was pressed

virtual int vtkInteractorStyleUser::GetCtrlKey   [virtual]
 

Test whether modifiers were held down when mouse button or key was pressed

virtual int vtkInteractorStyleUser::GetChar   [virtual]
 

Get the character for a Char event.

virtual char* vtkInteractorStyleUser::GetKeySym   [virtual]
 

Get the KeySym (in the same format as Tk KeySyms) for a KeyPress or KeyRelease method.

virtual int vtkInteractorStyleUser::GetButton   [virtual]
 

Get the mouse button that was last pressed inside the window (returns zero when the button is released).

void vtkInteractorStyleUser::SetUserInteractionMethod void(*    f)(void *),
void *    arg
 

This method behaves just like OnTimer, but is only called if StartUserInteraction has been called. This method cannot be used in conjunction with SetMouseMoveMethod. Deprecated, do not use.

void vtkInteractorStyleUser::SetUserInteractionMethodArgDelete void(*    f)(void *)
 

This method behaves just like OnTimer, but is only called if StartUserInteraction has been called. This method cannot be used in conjunction with SetMouseMoveMethod. Deprecated, do not use.

void vtkInteractorStyleUser::StartUserInteraction  
 

Start/Stop user interaction mode. You must not call these methods before you have Initialized the vtkRenderWindowInteractor. Deprecated, do not use.

void vtkInteractorStyleUser::EndUserInteraction  
 

Start/Stop user interaction mode. You must not call these methods before you have Initialized the vtkRenderWindowInteractor. Deprecated, do not use.

void vtkInteractorStyleUser::OnChar int    ctrl,
int    shift,
char    keycode,
int    repeatcount
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnKeyPress int    ctrl,
int    shift,
char    keycode,
char *    keysym,
int    repeatcount
[protected, virtual]
 

OnChar implements keyboard functions, but subclasses can override this behavior

Reimplemented from vtkInteractorStyle.

void vtkInteractorStyleUser::OnKeyRelease int    ctrl,
int    shift,
char    keycode,
char *    keysym,
int    repeatcount
[protected, virtual]
 

OnChar implements keyboard functions, but subclasses can override this behavior

Reimplemented from vtkInteractorStyle.

void vtkInteractorStyleUser::OnLeftButtonDown int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnLeftButtonUp int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnMiddleButtonDown int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnMiddleButtonUp int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnRightButtonDown int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnRightButtonUp int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnMouseMove int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

Event bindings controlling the effects of pressing mouse buttons or moving the mouse. The correct subclass method is called depending on the current mode (trackball or joystick, camera or actor).

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::OnConfigure int    width,
int    height
[protected, virtual]
 

These are more esoteric events, but are useful in some cases.

Reimplemented from vtkInteractorStyle.

void vtkInteractorStyleUser::OnEnter int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

These are more esoteric events, but are useful in some cases.

Reimplemented from vtkInteractorStyle.

void vtkInteractorStyleUser::OnLeave int    ctrl,
int    shift,
int    X,
int    Y
[protected, virtual]
 

These are more esoteric events, but are useful in some cases.

Reimplemented from vtkInteractorStyle.

void vtkInteractorStyleUser::OnTimer void    [protected, virtual]
 

OnTimer calls RotateCamera, RotateActor etc which should be overridden by style subclasses.

Reimplemented from vtkInteractorStyleSwitch.

void vtkInteractorStyleUser::vtkSetOldCallback unsigned long &    tag,
unsigned long    event,
void(*    f)(void *),
void *    arg
[protected]
 

void vtkInteractorStyleUser::vtkSetOldDelete unsigned long    tag,
void(*    f)(void *)
[protected]
 


Member Data Documentation

int vtkInteractorStyleUser::OldPos[2] [protected]
 

Definition at line 244 of file vtkInteractorStyleUser.h.

int vtkInteractorStyleUser::Char [protected]
 

Definition at line 246 of file vtkInteractorStyleUser.h.

char* vtkInteractorStyleUser::KeySym [protected]
 

Definition at line 247 of file vtkInteractorStyleUser.h.

int vtkInteractorStyleUser::Button [protected]
 

Definition at line 248 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::MouseMoveTag [protected]
 

Definition at line 250 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::KeyPressTag [protected]
 

Definition at line 251 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::KeyReleaseTag [protected]
 

Definition at line 252 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::CharTag [protected]
 

Definition at line 253 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::EnterTag [protected]
 

Definition at line 254 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::LeaveTag [protected]
 

Definition at line 255 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::ConfigureTag [protected]
 

Definition at line 256 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::TimerTag [protected]
 

Definition at line 257 of file vtkInteractorStyleUser.h.

unsigned long vtkInteractorStyleUser::UserTag [protected]
 

Definition at line 258 of file vtkInteractorStyleUser.h.


The documentation for this class was generated from the following file:
Generated on Thu Mar 28 14:34:14 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001