vtkRenderWindowInteractor Class Reference
#include <vtkRenderWindowInteractor.h>
Inheritance diagram for vtkRenderWindowInteractor:
[legend]Collaboration diagram for vtkRenderWindowInteractor:
[legend]List of all members.
Detailed Description
platform-independent render window interaction including picking and frame rate control.
vtkRenderWindowInteractor provides a platform-independent interaction mechanism for mouse/key/time events. It serves as a base class for platform-dependent implementations that handle routing of mouse/key/timer messages to vtkInteractorStyle and its subclasses. vtkRenderWindowInteractor also provides controls for picking, rendering frame rate, and headlights.
vtkRenderWindowInteractor has changed from previous implementations and now serves only as a shell to hold user preferences and route messages to vtkInteractorStyle. Callbacks are available for many Events. Platform specific subclasses should provide methods for CreateTimer/DestroyTimer, TerminateApp, and an event loop if required via Initialize/Start/Enable/Disable.
- Events:
- vtkCommand::UserEvent vtkCommand::EndPickEvent vtkCommand::StartPickEvent vtkCommand::ExitEvent
- Examples:
- vtkRenderWindowInteractor (Examples)
- Tests:
- vtkRenderWindowInteractor (Tests)
Definition at line 59 of file vtkRenderWindowInteractor.h.
|
Public Types |
typedef vtkObject | Superclass |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | Initialize () |
void | ReInitialize () |
virtual void | UnRegister (vtkObjectBase *o) |
virtual void | Start () |
virtual void | Enable () |
virtual void | Disable () |
virtual int | GetEnabled () |
void | SetRenderWindow (vtkRenderWindow *aren) |
virtual vtkRenderWindow * | GetRenderWindow () |
virtual void | UpdateSize (int x, int y) |
virtual int | CreateTimer (int) |
virtual int | DestroyTimer () |
virtual void | TerminateApp (void) |
virtual void | SetInteractorStyle (vtkInteractorObserver *) |
virtual vtkInteractorObserver * | GetInteractorStyle () |
virtual void | SetLightFollowCamera (int) |
virtual int | GetLightFollowCamera () |
virtual void | LightFollowCameraOn () |
virtual void | LightFollowCameraOff () |
virtual void | SetDesiredUpdateRate (double) |
virtual double | GetDesiredUpdateRate () |
virtual void | SetStillUpdateRate (double) |
virtual double | GetStillUpdateRate () |
virtual int | GetInitialized () |
virtual void | SetPicker (vtkAbstractPicker *) |
virtual vtkAbstractPicker * | GetPicker () |
virtual vtkAbstractPropPicker * | CreateDefaultPicker () |
virtual void | ExitCallback () |
virtual void | UserCallback () |
virtual void | StartPickCallback () |
virtual void | EndPickCallback () |
virtual void | GetMousePosition (int *x, int *y) |
void | HideCursor () |
void | ShowCursor () |
virtual void | Render () |
void | FlyTo (vtkRenderer *ren, double x, double y, double z) |
void | FlyTo (vtkRenderer *ren, double *x) |
void | FlyToImage (vtkRenderer *ren, double x, double y) |
void | FlyToImage (vtkRenderer *ren, double *x) |
virtual void | SetNumberOfFlyFrames (int) |
virtual int | GetNumberOfFlyFrames () |
virtual void | SetDolly (double) |
virtual double | GetDolly () |
virtual int * | GetEventPosition () |
virtual void | GetEventPosition (int &, int &) |
virtual void | GetEventPosition (int[2]) |
virtual int * | GetLastEventPosition () |
virtual void | GetLastEventPosition (int &, int &) |
virtual void | GetLastEventPosition (int[2]) |
virtual void | SetEventPosition (int x, int y) |
virtual void | SetEventPosition (int pos[2]) |
virtual void | SetEventPositionFlipY (int x, int y) |
virtual void | SetEventPositionFlipY (int pos[2]) |
virtual void | SetControlKey (int) |
virtual int | GetControlKey () |
virtual void | SetShiftKey (int) |
virtual int | GetShiftKey () |
virtual void | SetKeyCode (char) |
virtual char | GetKeyCode () |
virtual void | SetRepeatCount (int) |
virtual int | GetRepeatCount () |
virtual void | SetKeySym (const char *) |
virtual char * | GetKeySym () |
void | SetEventInformation (int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0) |
void | SetEventInformationFlipY (int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0) |
void | SetKeyEventInformation (int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0) |
virtual void | SetSize (int, int) |
void | SetSize (int[2]) |
virtual int * | GetSize () |
virtual void | GetSize (int &, int &) |
virtual void | GetSize (int[2]) |
virtual void | SetEventSize (int, int) |
void | SetEventSize (int[2]) |
virtual int * | GetEventSize () |
virtual void | GetEventSize (int &, int &) |
virtual void | GetEventSize (int[2]) |
vtkRenderer * | FindPokedRenderer (int, int) |
Static Public Member Functions |
static vtkRenderWindowInteractor * | New () |
static int | IsTypeOf (const char *type) |
static vtkRenderWindowInteractor * | SafeDownCast (vtkObject *o) |
Protected Member Functions |
| vtkRenderWindowInteractor () |
| ~vtkRenderWindowInteractor () |
Protected Attributes |
vtkRenderWindow * | RenderWindow |
vtkInteractorObserver * | InteractorStyle |
vtkAbstractPicker * | Picker |
int | Initialized |
int | Enabled |
int | Style |
int | LightFollowCamera |
int | ActorMode |
double | DesiredUpdateRate |
double | StillUpdateRate |
int | ControlKey |
int | ShiftKey |
char | KeyCode |
int | RepeatCount |
char * | KeySym |
int | EventPosition [2] |
int | LastEventPosition [2] |
int | EventSize [2] |
int | Size [2] |
int | NumberOfFlyFrames |
double | Dolly |
Member Typedef Documentation
Constructor & Destructor Documentation
vtkRenderWindowInteractor::vtkRenderWindowInteractor |
( |
|
) |
[protected] |
|
vtkRenderWindowInteractor::~vtkRenderWindowInteractor |
( |
|
) |
[protected] |
|
Member Function Documentation
virtual const char* vtkRenderWindowInteractor::GetClassName |
( |
|
) |
[virtual] |
|
static int vtkRenderWindowInteractor::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
virtual int vtkRenderWindowInteractor::IsA |
( |
const char * |
type |
) |
[virtual] |
|
void vtkRenderWindowInteractor::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::Initialize |
( |
|
) |
[virtual] |
|
void vtkRenderWindowInteractor::ReInitialize |
( |
|
) |
[inline] |
|
virtual void vtkRenderWindowInteractor::UnRegister |
( |
vtkObjectBase * |
o |
) |
[virtual] |
|
|
This Method detects loops of RenderWindow-Interactor, so objects are freed properly.
Reimplemented from vtkObject. |
virtual void vtkRenderWindowInteractor::Start |
( |
void |
|
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::Enable |
( |
|
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::Disable |
( |
|
) |
[inline, virtual] |
|
virtual int vtkRenderWindowInteractor::GetEnabled |
( |
|
) |
[virtual] |
|
|
Set/Get the rendering window being controlled by this object. |
virtual vtkRenderWindow* vtkRenderWindowInteractor::GetRenderWindow |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::UpdateSize |
( |
int |
x, |
|
|
int |
y |
|
) |
[virtual] |
|
virtual int vtkRenderWindowInteractor::CreateTimer |
( |
int |
|
) |
[inline, virtual] |
|
virtual int vtkRenderWindowInteractor::DestroyTimer |
( |
void |
|
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::TerminateApp |
( |
void |
|
) |
[inline, virtual] |
|
|
External switching between joystick/trackball/new? modes. |
virtual void vtkRenderWindowInteractor::SetLightFollowCamera |
( |
int |
|
) |
[virtual] |
|
|
Turn on/off the automatic repositioning of lights as the camera moves. |
virtual int vtkRenderWindowInteractor::GetLightFollowCamera |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::LightFollowCameraOn |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::LightFollowCameraOff |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetDesiredUpdateRate |
( |
double |
|
) |
[virtual] |
|
|
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. |
virtual double vtkRenderWindowInteractor::GetDesiredUpdateRate |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetStillUpdateRate |
( |
double |
|
) |
[virtual] |
|
|
Set/Get the desired update rate when movement has stopped. See the SetDesiredUpdateRate method. |
virtual double vtkRenderWindowInteractor::GetStillUpdateRate |
( |
|
) |
[virtual] |
|
virtual int vtkRenderWindowInteractor::GetInitialized |
( |
|
) |
[virtual] |
|
|
See whether interactor has been initialized yet. |
|
Set/Get the object used to perform pick operations. In order to pick instances of vtkProp, the picker must be a subclass of vtkAbstractPropPicker, meaning that it can identify a particular instance of vtkProp. |
|
Create default picker. Used to create one when none is specified. Default is an instance of vtkPropPicker. |
virtual void vtkRenderWindowInteractor::ExitCallback |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::UserCallback |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::StartPickCallback |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::EndPickCallback |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetMousePosition |
( |
int * |
x, |
|
|
int * |
y |
|
) |
[inline, virtual] |
|
void vtkRenderWindowInteractor::HideCursor |
( |
|
) |
|
|
|
Hide or show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to display a 3D cursor instead. |
void vtkRenderWindowInteractor::ShowCursor |
( |
|
) |
|
|
virtual void vtkRenderWindowInteractor::Render |
( |
|
) |
[virtual] |
|
|
Render the scene. Just pass the render call on to the associated vtkRenderWindow. |
void vtkRenderWindowInteractor::FlyTo |
( |
vtkRenderer * |
ren, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
|
|
|
Given a position x, move the current camera's focal point to x. The movement is animated over the number of frames specified in NumberOfFlyFrames. The LOD desired frame rate is used. |
void vtkRenderWindowInteractor::FlyTo |
( |
vtkRenderer * |
ren, |
|
|
double * |
x |
|
) |
[inline] |
|
void vtkRenderWindowInteractor::FlyToImage |
( |
vtkRenderer * |
ren, |
|
|
double |
x, |
|
|
double |
y |
|
) |
|
|
void vtkRenderWindowInteractor::FlyToImage |
( |
vtkRenderer * |
ren, |
|
|
double * |
x |
|
) |
[inline] |
|
virtual void vtkRenderWindowInteractor::SetNumberOfFlyFrames |
( |
int |
|
) |
[virtual] |
|
|
Set the number of frames to fly to when FlyTo is invoked. |
virtual int vtkRenderWindowInteractor::GetNumberOfFlyFrames |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetDolly |
( |
double |
|
) |
[virtual] |
|
|
Set the total Dolly value to use when flying to (FlyTo()) a specified point. Negative values fly away from the point. |
virtual double vtkRenderWindowInteractor::GetDolly |
( |
|
) |
[virtual] |
|
virtual int* vtkRenderWindowInteractor::GetEventPosition |
( |
|
) |
[virtual] |
|
|
Set/Get information about the current event. The current x,y position is in the EventPosition, and the previous event position is in LastEventPosition, updated automatically each time EventPosition is set using its Set() method. The other information is about key board input. |
virtual void vtkRenderWindowInteractor::GetEventPosition |
( |
int & |
, |
|
|
int & |
|
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetEventPosition |
( |
int |
[2] |
) |
[virtual] |
|
virtual int* vtkRenderWindowInteractor::GetLastEventPosition |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetLastEventPosition |
( |
int & |
, |
|
|
int & |
|
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetLastEventPosition |
( |
int |
[2] |
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetEventPosition |
( |
int |
x, |
|
|
int |
y |
|
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::SetEventPosition |
( |
int |
pos[2] |
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::SetEventPositionFlipY |
( |
int |
x, |
|
|
int |
y |
|
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::SetEventPositionFlipY |
( |
int |
pos[2] |
) |
[inline, virtual] |
|
virtual void vtkRenderWindowInteractor::SetControlKey |
( |
int |
|
) |
[virtual] |
|
virtual int vtkRenderWindowInteractor::GetControlKey |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetShiftKey |
( |
int |
|
) |
[virtual] |
|
virtual int vtkRenderWindowInteractor::GetShiftKey |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetKeyCode |
( |
char |
|
) |
[virtual] |
|
virtual char vtkRenderWindowInteractor::GetKeyCode |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetRepeatCount |
( |
int |
|
) |
[virtual] |
|
virtual int vtkRenderWindowInteractor::GetRepeatCount |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetKeySym |
( |
const char * |
|
) |
[virtual] |
|
virtual char* vtkRenderWindowInteractor::GetKeySym |
( |
|
) |
[virtual] |
|
void vtkRenderWindowInteractor::SetEventInformation |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
ctrl = 0 , |
|
|
int |
shift = 0 , |
|
|
char |
keycode = 0 , |
|
|
int |
repeatcount = 0 , |
|
|
const char * |
keysym = 0 |
|
) |
[inline] |
|
void vtkRenderWindowInteractor::SetEventInformationFlipY |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
ctrl = 0 , |
|
|
int |
shift = 0 , |
|
|
char |
keycode = 0 , |
|
|
int |
repeatcount = 0 , |
|
|
const char * |
keysym = 0 |
|
) |
[inline] |
|
|
Calls SetEventInformation, but flips the Y based on the current Size[1] value (i.e. y = this->Size[1] - y - 1).
Definition at line 290 of file vtkRenderWindowInteractor.h. |
void vtkRenderWindowInteractor::SetKeyEventInformation |
( |
int |
ctrl = 0 , |
|
|
int |
shift = 0 , |
|
|
char |
keycode = 0 , |
|
|
int |
repeatcount = 0 , |
|
|
const char * |
keysym = 0 |
|
) |
[inline] |
|
virtual void vtkRenderWindowInteractor::SetSize |
( |
int |
, |
|
|
int |
|
|
) |
[virtual] |
|
|
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. The current event width/height (if any) is in EventSize (Expose event, for example). |
void vtkRenderWindowInteractor::SetSize |
( |
int |
[2] |
) |
|
|
virtual int* vtkRenderWindowInteractor::GetSize |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetSize |
( |
int & |
, |
|
|
int & |
|
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetSize |
( |
int |
[2] |
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::SetEventSize |
( |
int |
, |
|
|
int |
|
|
) |
[virtual] |
|
void vtkRenderWindowInteractor::SetEventSize |
( |
int |
[2] |
) |
|
|
virtual int* vtkRenderWindowInteractor::GetEventSize |
( |
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetEventSize |
( |
int & |
, |
|
|
int & |
|
|
) |
[virtual] |
|
virtual void vtkRenderWindowInteractor::GetEventSize |
( |
int |
[2] |
) |
[virtual] |
|
vtkRenderer* vtkRenderWindowInteractor::FindPokedRenderer |
( |
int |
, |
|
|
int |
|
|
) |
|
|
|
When an event occurs, we must determine which Renderer the event occurred within, since one RenderWindow may contain multiple renderers. |
Member Data Documentation
The documentation for this class was generated from the following file: