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

# vtkInteractorObserver Class Reference

`#include <vtkInteractorObserver.h>`

Inheritance diagram for vtkInteractorObserver:

[legend]
Collaboration diagram for vtkInteractorObserver:

[legend]
List of all members.

## Detailed Description

an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor

Date:
  2003/01/16 19:54:30

Revision:
  1.14

vtkInteractorObserver is an abstract superclass for subclasses that observe events invoked by vtkRenderWindowInteractor. These subclasses are typically things like 3D widgets; objects that interact with actors in the scene, or interactively probe the scene for information.

vtkInteractorObserver defines the method SetInteractor() and enables and disables the processing of events by the vtkInteractorObserver. Use the methods EnabledOn() or SetEnabled(1) to turn on the interactor observer, and the methods EnabledOff() or SetEnabled(0) to turn off the interactor.

To support interactive manipulation of objects, this class (and subclasses) invoke the events StartInteractionEvent, InteractionEvent, and EndInteractionEvent. These events are invoked when the vtkInteractorObserver enters a state where rapid response is desired: mouse motion, etc. The events can be used, for example, to set the desired update frame rate (StartInteractionEvent), operate on data or update a pipeline (InteractionEvent), and set the desired frame rate back to normal values (EndInteractionEvent). Two other events, EnableEvent and DisableEvent, are invoked when the interactor observer is enabled or disabled.

See also:
  vtk3DWidget vtkBoxWidget vtkLineWidget

Created by:
  - Schroeder, Will

CVS contributions (if > 5%):
  - Schroeder, Will (70%)
  - Barre, Sebastien (23%)
  - Cedilnik, Andy (5%)

CVS logs (CVSweb):
  - .`cxx` (`/Rendering/vtkInteractorObserver.cxx)`
  - .`h` (`/Rendering/vtkInteractorObserver.h)`

Definition at line 68 of file vtkInteractorObserver.h.

## Public Types
typedef vtkObject | Superclass
## Public Methods
virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
virtual void | OnChar ()
virtual void | SetEnabled (int)=0
int | GetEnabled ()
void | EnabledOn ()
void | EnabledOff ()
void | On ()
void | Off ()
virtual void | SetInteractor (vtkRenderWindowInteractor *iren)
virtual vtkRenderWindowInteractor * | GetInteractor ()
virtual void | SetPriority (float)
virtual float | GetPriority ()
virtual void | SetKeyPressActivation (int)
virtual int | GetKeyPressActivation ()
virtual void | KeyPressActivationOn ()
virtual void | KeyPressActivationOff ()
virtual void | SetKeyPressActivationValue (char)
virtual char | GetKeyPressActivationValue ()
virtual void | SetCurrentRenderer (vtkRenderer *)
virtual vtkRenderer * | GetCurrentRenderer ()
## Static Public Methods
int | IsTypeOf (const char *type)
vtkInteractorObserver * | SafeDownCast (vtkObject *o)
## Protected Methods
| vtkInteractorObserver ()
| ~vtkInteractorObserver ()
virtual void | StartInteraction ()
virtual void | EndInteraction ()
void | ComputeDisplayToWorld (double x, double y, double z, double worldPt[4])
void | ComputeDisplayToWorld (double x, double y, double z, float worldPt[4])
void | ComputeWorldToDisplay (double x, double y, double z, double displayPt[3])
void | ComputeWorldToDisplay (double x, double y, double z, float displayPt[3])
## Static Protected Methods
void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
## Protected Attributes
int | Enabled
vtkCallbackCommand * | EventCallbackCommand
vtkCallbackCommand * | KeyPressCallbackCommand
float | Priority
int | KeyPressActivation
char | KeyPressActivationValue
vtkRenderWindowInteractor * | Interactor
vtkRenderer * | CurrentRenderer

## Member Typedef Documentation

typedef vtkObject vtkInteractorObserver::Superclass

| Reimplemented from vtkObject. Reimplemented in vtk3DWidget, vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkPolyDataSourceWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, vtkInteractorStyleTrackball, vtkInteractorStyleTrackballActor, vtkInteractorStyleTrackballCamera, vtkInteractorStyleUnicam, and vtkInteractorStyleUser. Definition at line 71 of file vtkInteractorObserver.h.

## Constructor & Destructor Documentation

vtkInteractorObserver::vtkInteractorObserver | ( |  | ) | `[protected]`

vtkInteractorObserver::~vtkInteractorObserver | ( |  | ) | `[protected]`

## Member Function Documentation

virtual const char* vtkInteractorObserver::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkObject. Reimplemented in vtk3DWidget, vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkPolyDataSourceWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, vtkInteractorStyleTrackball, vtkInteractorStyleTrackballActor, vtkInteractorStyleTrackballCamera, vtkInteractorStyleUnicam, and vtkInteractorStyleUser.

int vtkInteractorObserver::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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkObject. Reimplemented in vtk3DWidget, vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkPolyDataSourceWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, vtkInteractorStyleTrackball, vtkInteractorStyleTrackballActor, vtkInteractorStyleTrackballCamera, vtkInteractorStyleUnicam, and vtkInteractorStyleUser.

virtual int vtkInteractorObserver::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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkObject. Reimplemented in vtk3DWidget, vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkPolyDataSourceWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, vtkInteractorStyleTrackball, vtkInteractorStyleTrackballActor, vtkInteractorStyleTrackballCamera, vtkInteractorStyleUnicam, and vtkInteractorStyleUser.

vtkInteractorObserver* vtkInteractorObserver::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkObject. Reimplemented in vtk3DWidget, vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkPolyDataSourceWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, vtkInteractorStyleTrackball, vtkInteractorStyleTrackballActor, vtkInteractorStyleTrackballCamera, vtkInteractorStyleUnicam, and vtkInteractorStyleUser.

void vtkInteractorObserver::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 vtkObject. Reimplemented in vtk3DWidget, vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkPolyDataSourceWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, vtkInteractorStyleTrackball, vtkInteractorStyleTrackballActor, vtkInteractorStyleTrackballCamera, vtkInteractorStyleUnicam, and vtkInteractorStyleUser.

virtual void vtkInteractorObserver::SetEnabled | ( | int |  | ) | `[pure virtual]`

| Methods for turning the interactor observer on and off, and determining its state. All subclasses must provide the SetEnabled() method. Enabling a vtkInteractorObserver has the side effect of adding observers; disabling it removes the observers. Prior to enabling the vtkInteractorObserver you must set the render window interactor (via SetInteractor()). Implemented in vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, and vtkInteractorStyle.

int vtkInteractorObserver::GetEnabled | ( |  | ) | `[inline]`

| Methods for turning the interactor observer on and off, and determining its state. All subclasses must provide the SetEnabled() method. Enabling a vtkInteractorObserver has the side effect of adding observers; disabling it removes the observers. Prior to enabling the vtkInteractorObserver you must set the render window interactor (via SetInteractor()). Definition at line 82 of file vtkInteractorObserver.h.

void vtkInteractorObserver::EnabledOn | ( |  | ) | `[inline]`

| Methods for turning the interactor observer on and off, and determining its state. All subclasses must provide the SetEnabled() method. Enabling a vtkInteractorObserver has the side effect of adding observers; disabling it removes the observers. Prior to enabling the vtkInteractorObserver you must set the render window interactor (via SetInteractor()). Definition at line 83 of file vtkInteractorObserver.h.

void vtkInteractorObserver::EnabledOff | ( |  | ) | `[inline]`

| Methods for turning the interactor observer on and off, and determining its state. All subclasses must provide the SetEnabled() method. Enabling a vtkInteractorObserver has the side effect of adding observers; disabling it removes the observers. Prior to enabling the vtkInteractorObserver you must set the render window interactor (via SetInteractor()). Definition at line 84 of file vtkInteractorObserver.h.

void vtkInteractorObserver::On | ( |  | ) | `[inline]`

| Methods for turning the interactor observer on and off, and determining its state. All subclasses must provide the SetEnabled() method. Enabling a vtkInteractorObserver has the side effect of adding observers; disabling it removes the observers. Prior to enabling the vtkInteractorObserver you must set the render window interactor (via SetInteractor()). Definition at line 85 of file vtkInteractorObserver.h.

void vtkInteractorObserver::Off | ( |  | ) | `[inline]`

| Methods for turning the interactor observer on and off, and determining its state. All subclasses must provide the SetEnabled() method. Enabling a vtkInteractorObserver has the side effect of adding observers; disabling it removes the observers. Prior to enabling the vtkInteractorObserver you must set the render window interactor (via SetInteractor()). Definition at line 86 of file vtkInteractorObserver.h.

virtual void vtkInteractorObserver::SetInteractor | ( | vtkRenderWindowInteractor * | iren | ) | `[virtual]`

| This method is used to associate the widget with the render window interactor. Observers of the appropriate events invoked in the render window interactor are set up as a result of this method invocation. The SetInteractor() method must be invoked prior to enabling the vtkInteractorObserver. Reimplemented in vtkInteractorEventRecorder, vtkInteractorStyle, and vtkInteractorStyleSwitch.

virtual vtkRenderWindowInteractor* vtkInteractorObserver::GetInteractor | ( |  | ) | `[virtual]`

| This method is used to associate the widget with the render window interactor. Observers of the appropriate events invoked in the render window interactor are set up as a result of this method invocation. The SetInteractor() method must be invoked prior to enabling the vtkInteractorObserver.

virtual void vtkInteractorObserver::SetPriority | ( | float |  | ) | `[virtual]`

| Set/Get the priority at which events are processed. This is used when multiple interactor observers are used simultaneously. The default value is 0.0 (lowest priority.) Note that when multiple interactor observer have the same priority, then the last observer added will process the event first. (Note: once the SetInteractor() method has been called, changing the priority does not effect event processing. You will have to SetInteractor(NULL), change priority, and then SetInteractor(iren) to have the priority take effect.)

virtual float vtkInteractorObserver::GetPriority | ( |  | ) | `[virtual]`

| Set/Get the priority at which events are processed. This is used when multiple interactor observers are used simultaneously. The default value is 0.0 (lowest priority.) Note that when multiple interactor observer have the same priority, then the last observer added will process the event first. (Note: once the SetInteractor() method has been called, changing the priority does not effect event processing. You will have to SetInteractor(NULL), change priority, and then SetInteractor(iren) to have the priority take effect.)

virtual void vtkInteractorObserver::SetKeyPressActivation | ( | int |  | ) | `[virtual]`

| Enable/Disable of the use of a keypress to turn on and off the interactor observer. (By default, the keypress is 'i' for "interactor observer".) Set the KeyPressActivationValue to change which key activates the widget.)

virtual int vtkInteractorObserver::GetKeyPressActivation | ( |  | ) | `[virtual]`

| Enable/Disable of the use of a keypress to turn on and off the interactor observer. (By default, the keypress is 'i' for "interactor observer".) Set the KeyPressActivationValue to change which key activates the widget.)

virtual void vtkInteractorObserver::KeyPressActivationOn | ( |  | ) | `[virtual]`

| Enable/Disable of the use of a keypress to turn on and off the interactor observer. (By default, the keypress is 'i' for "interactor observer".) Set the KeyPressActivationValue to change which key activates the widget.)

virtual void vtkInteractorObserver::KeyPressActivationOff | ( |  | ) | `[virtual]`

| Enable/Disable of the use of a keypress to turn on and off the interactor observer. (By default, the keypress is 'i' for "interactor observer".) Set the KeyPressActivationValue to change which key activates the widget.)

virtual void vtkInteractorObserver::SetKeyPressActivationValue | ( | char |  | ) | `[virtual]`

| Specify which key press value to use to activate the interactor observer (if key press activation is enabled). By default, the key press activation value is 'i'. Note: once the SetInteractor() method is invoked, changing the key press activation value will not affect the key press until SetInteractor(NULL)/SetInteractor(iren) is called.

virtual char vtkInteractorObserver::GetKeyPressActivationValue | ( |  | ) | `[virtual]`

| Specify which key press value to use to activate the interactor observer (if key press activation is enabled). By default, the key press activation value is 'i'. Note: once the SetInteractor() method is invoked, changing the key press activation value will not affect the key press until SetInteractor(NULL)/SetInteractor(iren) is called.

virtual void vtkInteractorObserver::SetCurrentRenderer | ( | vtkRenderer * |  | ) | `[virtual]`

| Specify the renderer to use when activiating the interactor observer. Normally when the widget is activated (SetEnabled(1) or when keypress activation takes place), the renderer over which the mouse pointer is positioned is used. Alternatively, you can specify the renderer to bind the interactor to when the interactor observer is activated.

virtual vtkRenderer* vtkInteractorObserver::GetCurrentRenderer | ( |  | ) | `[virtual]`

| Specify the renderer to use when activiating the interactor observer. Normally when the widget is activated (SetEnabled(1) or when keypress activation takes place), the renderer over which the mouse pointer is positioned is used. Alternatively, you can specify the renderer to bind the interactor to when the interactor observer is activated.

virtual void vtkInteractorObserver::OnChar | ( |  | ) | `[virtual]`

| Reimplemented in vtkInteractorStyle, vtkInteractorStyleFlight, vtkInteractorStyleImage, vtkInteractorStyleSwitch, vtkInteractorStyleTerrain, and vtkInteractorStyleUser.

virtual void vtkInteractorObserver::StartInteraction | ( |  | ) | `[protected, virtual]`

| Utility routines used to start and end interaction. For example, it switches the display update rate. It does not invoke the corresponding events.

virtual void vtkInteractorObserver::EndInteraction | ( |  | ) | `[protected, virtual]`

| Utility routines used to start and end interaction. For example, it switches the display update rate. It does not invoke the corresponding events.

void vtkInteractorObserver::ProcessEvents | ( | vtkObject * | object,
|  | unsigned long | event,
|  | void * | clientdata,
|  | void * | calldata
| ) | `[static, protected]`

| Handles the char widget activation event. Also handles the delete event. Reimplemented in vtkBoxWidget, vtkImagePlaneWidget, vtkImplicitPlaneWidget, vtkLineWidget, vtkPlaneWidget, vtkPointWidget, vtkScalarBarWidget, vtkSphereWidget, vtkSplineWidget, vtkXYPlotWidget, vtkInteractorEventRecorder, and vtkInteractorStyle.

void vtkInteractorObserver::ComputeDisplayToWorld | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | worldPt[4]
| ) | `[protected]`

| Helper method for subclasses

void vtkInteractorObserver::ComputeDisplayToWorld | ( | double | x,
|  | double | y,
|  | double | z,
|  | float | worldPt[4]
| ) | `[protected]`

| Helper method for subclasses

void vtkInteractorObserver::ComputeWorldToDisplay | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | displayPt[3]
| ) | `[protected]`

| Helper method for subclasses

void vtkInteractorObserver::ComputeWorldToDisplay | ( | double | x,
|  | double | y,
|  | double | z,
|  | float | displayPt[3]
| ) | `[protected]`

| Helper method for subclasses

## Member Data Documentation

int vtkInteractorObserver::Enabled`[protected]`

| Definition at line 180 of file vtkInteractorObserver.h.

vtkCallbackCommand* vtkInteractorObserver::EventCallbackCommand`[protected]`

| Definition at line 183 of file vtkInteractorObserver.h.

vtkCallbackCommand* vtkInteractorObserver::KeyPressCallbackCommand`[protected]`

| Definition at line 184 of file vtkInteractorObserver.h.

float vtkInteractorObserver::Priority`[protected]`

| Definition at line 187 of file vtkInteractorObserver.h.

int vtkInteractorObserver::KeyPressActivation`[protected]`

| Definition at line 190 of file vtkInteractorObserver.h.

char vtkInteractorObserver::KeyPressActivationValue`[protected]`

| Definition at line 191 of file vtkInteractorObserver.h.

vtkRenderWindowInteractor* vtkInteractorObserver::Interactor`[protected]`

| Definition at line 194 of file vtkInteractorObserver.h.

vtkRenderer* vtkInteractorObserver::CurrentRenderer`[protected]`

| Definition at line 197 of file vtkInteractorObserver.h.

The documentation for this class was generated from the following file:

- Rendering/vtkInteractorObserver.h