provide event-driven interface to the rendering window (defines trackball mode)
More...
|
virtual vtkTypeBool | IsA (const char *type) |
| Return 1 if this class is the same type of (or a subclass of) the named class. More...
|
|
vtkInteractorStyle * | NewInstance () const |
|
void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
void | SetInteractor (vtkRenderWindowInteractor *interactor) override |
| Set/Get the Interactor wrapper being controlled by this object. More...
|
|
void | SetEnabled (int) override |
| Turn on/off this interactor. More...
|
|
virtual void | SetAutoAdjustCameraClippingRange (vtkTypeBool) |
| If AutoAdjustCameraClippingRange is on, then before each render the camera clipping range will be adjusted to "fit" the whole scene. More...
|
|
virtual vtkTypeBool | GetAutoAdjustCameraClippingRange () |
|
virtual void | AutoAdjustCameraClippingRangeOn () |
|
virtual void | AutoAdjustCameraClippingRangeOff () |
|
void | FindPokedRenderer (int, int) |
| When an event occurs, we must determine which Renderer the event occurred within, since one RenderWindow may contain multiple renderers. More...
|
|
virtual int | GetState () |
| Some useful information for interaction. More...
|
|
virtual vtkTypeBool | GetUseTimers () |
| Set/Get timer hint. More...
|
|
virtual void | SetUseTimers (vtkTypeBool) |
|
virtual void | UseTimersOn () |
|
virtual void | UseTimersOff () |
|
virtual void | SetTimerDuration (unsigned long) |
| If using timers, specify the default timer interval (in milliseconds). More...
|
|
virtual unsigned long | GetTimerDuration () |
|
virtual void | SetHandleObservers (vtkTypeBool) |
| Does ProcessEvents handle observers on this class or not. More...
|
|
virtual vtkTypeBool | GetHandleObservers () |
|
virtual void | HandleObserversOn () |
|
virtual void | HandleObserversOff () |
|
virtual void | OnMouseMove () |
| Generic event bindings can be overridden in subclasses. More...
|
|
virtual void | OnLeftButtonDown () |
|
virtual void | OnLeftButtonUp () |
|
virtual void | OnMiddleButtonDown () |
|
virtual void | OnMiddleButtonUp () |
|
virtual void | OnRightButtonDown () |
|
virtual void | OnRightButtonUp () |
|
virtual void | OnLeftButtonDoubleClick () |
|
virtual void | OnMiddleButtonDoubleClick () |
|
virtual void | OnRightButtonDoubleClick () |
|
virtual void | OnMouseWheelForward () |
|
virtual void | OnMouseWheelBackward () |
|
virtual void | OnMouseWheelLeft () |
|
virtual void | OnMouseWheelRight () |
|
virtual void | OnFourthButtonDown () |
|
virtual void | OnFourthButtonUp () |
|
virtual void | OnFifthButtonDown () |
|
virtual void | OnFifthButtonUp () |
|
virtual void | OnMove3D (vtkEventData *) |
| Generic 3D event bindings can be overridden in subclasses. More...
|
|
virtual void | OnButton3D (vtkEventData *) |
|
void | OnChar () override |
| OnChar is triggered when an ASCII key is pressed. More...
|
|
virtual void | OnKeyDown () |
|
virtual void | OnKeyUp () |
|
virtual void | OnKeyPress () |
|
virtual void | OnKeyRelease () |
|
virtual void | OnExpose () |
| These are more esoteric events, but are useful in some cases. More...
|
|
virtual void | OnConfigure () |
|
virtual void | OnEnter () |
|
virtual void | OnLeave () |
|
virtual void | OnTimer () |
| OnTimer calls Rotate, Rotate etc which should be overridden by style subclasses. More...
|
|
virtual void | Rotate () |
| These methods for the different interactions in different modes are overridden in subclasses to perform the correct motion. More...
|
|
virtual void | Spin () |
|
virtual void | Pan () |
|
virtual void | Dolly () |
|
virtual void | Zoom () |
|
virtual void | UniformScale () |
|
virtual void | EnvironmentRotate () |
|
virtual void | OnStartSwipe () |
| gesture based events More...
|
|
virtual void | OnSwipe () |
|
virtual void | OnEndSwipe () |
|
virtual void | OnStartPinch () |
|
virtual void | OnPinch () |
|
virtual void | OnEndPinch () |
|
virtual void | OnStartRotate () |
|
virtual void | OnRotate () |
|
virtual void | OnEndRotate () |
|
virtual void | OnStartPan () |
|
virtual void | OnPan () |
|
virtual void | OnEndPan () |
|
virtual void | OnTap () |
|
virtual void | OnLongTap () |
|
virtual void | StartState (int newstate) |
| utility routines used by state changes More...
|
|
virtual void | StopState () |
|
virtual void | StartAnimate () |
| Interaction mode entry points used internally. More...
|
|
virtual void | StopAnimate () |
|
virtual void | StartRotate () |
|
virtual void | EndRotate () |
|
virtual void | StartZoom () |
|
virtual void | EndZoom () |
|
virtual void | StartPan () |
|
virtual void | EndPan () |
|
virtual void | StartSpin () |
|
virtual void | EndSpin () |
|
virtual void | StartDolly () |
|
virtual void | EndDolly () |
|
virtual void | StartUniformScale () |
|
virtual void | EndUniformScale () |
|
virtual void | StartTimer () |
|
virtual void | EndTimer () |
|
virtual void | StartTwoPointer () |
|
virtual void | EndTwoPointer () |
|
virtual void | StartGesture () |
|
virtual void | EndGesture () |
|
virtual void | StartEnvRotate () |
|
virtual void | EndEnvRotate () |
|
virtual void | OnDropLocation (double *vtkNotUsed(position)) |
| When the mouse location is updated while dragging files. More...
|
|
virtual void | OnDropFiles (vtkStringArray *vtkNotUsed(filePaths)) |
| When files are dropped on the render window. More...
|
|
virtual void | HighlightProp (vtkProp *prop) |
| When picking successfully selects an actor, this method highlights the picked prop appropriately. More...
|
|
virtual void | HighlightActor2D (vtkActor2D *actor2D) |
|
virtual void | HighlightProp3D (vtkProp3D *prop3D) |
|
virtual void | SetPickColor (double, double, double) |
| Set/Get the pick color (used by default to color vtkActor2D's). More...
|
|
virtual void | SetPickColor (double[3]) |
|
virtual double * | GetPickColor () |
|
virtual void | GetPickColor (double data[3]) |
|
virtual void | SetMouseWheelMotionFactor (double) |
| Set/Get the mouse wheel motion factor. More...
|
|
virtual double | GetMouseWheelMotionFactor () |
|
virtual vtkTDxInteractorStyle * | GetTDxStyle () |
| 3Dconnexion device interactor style. More...
|
|
virtual void | SetTDxStyle (vtkTDxInteractorStyle *tdxStyle) |
|
void | DelegateTDxEvent (unsigned long event, void *calldata) |
| Called by the callback to process 3DConnexion device events. More...
|
|
vtkInteractorObserver * | NewInstance () const |
|
int | GetEnabled () |
|
void | EnabledOn () |
|
void | EnabledOff () |
|
void | On () |
|
void | Off () |
|
virtual vtkRenderWindowInteractor * | GetInteractor () |
|
virtual void | SetPriority (float) |
| Set/Get the priority at which events are processed. More...
|
|
virtual float | GetPriority () |
|
virtual void | PickingManagedOn () |
| Enable/Disable the use of a manager to process the picking. More...
|
|
virtual void | PickingManagedOff () |
|
virtual void | SetPickingManaged (bool managed) |
|
virtual bool | GetPickingManaged () |
|
virtual void | SetKeyPressActivation (vtkTypeBool) |
| Enable/Disable of the use of a keypress to turn on and off the interactor observer. More...
|
|
virtual vtkTypeBool | GetKeyPressActivation () |
|
virtual void | KeyPressActivationOn () |
|
virtual void | KeyPressActivationOff () |
|
virtual void | SetKeyPressActivationValue (char) |
| Specify which key press value to use to activate the interactor observer (if key press activation is enabled). More...
|
|
virtual char | GetKeyPressActivationValue () |
|
virtual vtkRenderer * | GetDefaultRenderer () |
| Set/Get the default renderer to use when activating the interactor observer. More...
|
|
virtual void | SetDefaultRenderer (vtkRenderer *) |
|
virtual vtkRenderer * | GetCurrentRenderer () |
| Set/Get the current renderer. More...
|
|
virtual void | SetCurrentRenderer (vtkRenderer *) |
|
void | GrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr) |
| These methods enable an interactor observer to exclusively grab all events invoked by its associated vtkRenderWindowInteractor. More...
|
|
void | ReleaseFocus () |
|
| vtkBaseTypeMacro (vtkObject, vtkObjectBase) |
|
virtual void | DebugOn () |
| Turn debugging output on. More...
|
|
virtual void | DebugOff () |
| Turn debugging output off. More...
|
|
bool | GetDebug () |
| Get the value of the debug flag. More...
|
|
void | SetDebug (bool debugFlag) |
| Set the value of the debug flag. More...
|
|
virtual void | Modified () |
| Update the modification time for this object. More...
|
|
virtual vtkMTimeType | GetMTime () |
| Return this object's modified time. More...
|
|
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
|
vtkCommand * | GetCommand (unsigned long tag) |
|
void | RemoveObserver (vtkCommand *) |
|
void | RemoveObservers (unsigned long event, vtkCommand *) |
|
void | RemoveObservers (const char *event, vtkCommand *) |
|
vtkTypeBool | HasObserver (unsigned long event, vtkCommand *) |
|
vtkTypeBool | HasObserver (const char *event, vtkCommand *) |
|
void | RemoveObserver (unsigned long tag) |
|
void | RemoveObservers (unsigned long event) |
|
void | RemoveObservers (const char *event) |
|
void | RemoveAllObservers () |
|
vtkTypeBool | HasObserver (unsigned long event) |
|
vtkTypeBool | HasObserver (const char *event) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
| Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
|
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
| Allow user to set the AbortFlagOn() with the return value of the callback method. More...
|
|
int | InvokeEvent (unsigned long event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. More...
|
|
int | InvokeEvent (const char *event, void *callData) |
|
int | InvokeEvent (unsigned long event) |
|
int | InvokeEvent (const char *event) |
|
const char * | GetClassName () const |
| Return the class name as a string. More...
|
|
virtual vtkIdType | GetNumberOfGenerationsFromBase (const char *name) |
| Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
|
|
virtual void | Delete () |
| Delete a VTK object. More...
|
|
virtual void | FastDelete () |
| Delete a reference to this object. More...
|
|
void | InitializeObjectBase () |
|
void | Print (ostream &os) |
| Print an object to an ostream. More...
|
|
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
|
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
|
virtual void | Register (vtkObjectBase *o) |
| Increase the reference count (mark as used by another object). More...
|
|
virtual void | UnRegister (vtkObjectBase *o) |
| Decrease the reference count (release by another object). More...
|
|
int | GetReferenceCount () |
| Return the current reference count of this object. More...
|
|
void | SetReferenceCount (int) |
| Sets the reference count. More...
|
|
bool | GetIsInMemkind () const |
| A local state flag that remembers whether this object lives in the normal or extended memory space. More...
|
|
|
static vtkInteractorStyle * | New () |
| This class must be supplied with a vtkRenderWindowInteractor wrapper or parent. More...
|
|
static vtkTypeBool | IsTypeOf (const char *type) |
|
static vtkInteractorStyle * | SafeDownCast (vtkObjectBase *o) |
|
static vtkTypeBool | IsTypeOf (const char *type) |
|
static vtkInteractorObserver * | SafeDownCast (vtkObjectBase *o) |
|
static void | ComputeDisplayToWorld (vtkRenderer *ren, double x, double y, double z, double worldPt[4]) |
| Convenience methods for outside classes. More...
|
|
static void | ComputeWorldToDisplay (vtkRenderer *ren, double x, double y, double z, double displayPt[3]) |
|
static vtkObject * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
|
|
static void | BreakOnError () |
| This method is called when vtkErrorMacro executes. More...
|
|
static void | SetGlobalWarningDisplay (int val) |
| This is a global flag that controls whether any debug, warning or error messages are displayed. More...
|
|
static void | GlobalWarningDisplayOn () |
|
static void | GlobalWarningDisplayOff () |
|
static int | GetGlobalWarningDisplay () |
|
static vtkTypeBool | IsTypeOf (const char *name) |
| Return 1 if this class type is the same type of (or a subclass of) the named class. More...
|
|
static vtkIdType | GetNumberOfGenerationsFromBaseType (const char *name) |
| Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
|
|
static vtkObjectBase * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
|
|
static void | SetMemkindDirectory (const char *directoryname) |
| The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
|
|
static bool | GetUsingMemkind () |
| A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. More...
|
|
provide event-driven interface to the rendering window (defines trackball mode)
vtkInteractorStyle is a base class implementing the majority of motion control routines and defines an event driven interface to support vtkRenderWindowInteractor. vtkRenderWindowInteractor implements platform dependent key/mouse routing and timer control, which forwards events in a neutral form to vtkInteractorStyle.
vtkInteractorStyle implements the "joystick" style of interaction. That is, holding down the mouse keys generates a stream of events that cause continuous actions (e.g., rotate, translate, pan, zoom). (The class vtkInteractorStyleTrackball implements a grab and move style.) The event bindings for this class include the following:
- Keypress j / Keypress t: toggle between joystick (position sensitive) and trackball (motion sensitive) styles. In joystick style, motion occurs continuously as long as a mouse button is pressed. In trackball style, motion occurs when the mouse button is pressed and the mouse pointer moves.
- Keypress c / Keypress a: toggle between camera and actor modes. In camera mode, mouse events affect the camera position and focal point. In actor mode, mouse events affect the actor that is under the mouse pointer.
- Button 1: rotate the camera around its focal point (if camera mode) or rotate the actor around its origin (if actor mode). The rotation is in the direction defined from the center of the renderer's viewport towards the mouse position. In joystick mode, the magnitude of the rotation is determined by the distance the mouse is from the center of the render window.
- Button 2: pan the camera (if camera mode) or translate the actor (if actor mode). In joystick mode, the direction of pan or translation is from the center of the viewport towards the mouse position. In trackball mode, the direction of motion is the direction the mouse moves. (Note: with 2-button mice, pan is defined as <Shift>-Button 1.)
- Button 3: zoom the camera (if camera mode) or scale the actor (if actor mode). Zoom in/increase scale if the mouse position is in the top half of the viewport; zoom out/decrease scale if the mouse position is in the bottom half. In joystick mode, the amount of zoom is controlled by the distance of the mouse pointer from the horizontal centerline of the window.
- Keypress 3: toggle the render window into and out of stereo mode. By default, red-blue stereo pairs are created. Some systems support Crystal Eyes LCD stereo glasses; you have to invoke SetStereoTypeToCrystalEyes() on the rendering window.
- Keypress e: exit the application.
- Keypress f: fly to the picked point
- Keypress p: perform a pick operation. The render window interactor has an internal instance of vtkCellPicker that it uses to pick.
- Keypress r: reset the camera view along the current view direction. Centers the actors and moves the camera so that all actors are visible.
- Keypress s: modify the representation of all actors so that they are surfaces.
- Keypress u: invoke the user-defined function. Typically, this keypress will bring up an interactor that you can type commands in. Typing u calls UserCallBack() on the vtkRenderWindowInteractor, which invokes a vtkCommand::UserEvent. In other words, to define a user-defined callback, just add an observer to the vtkCommand::UserEvent on the vtkRenderWindowInteractor object.
- Keypress w: modify the representation of all actors so that they are wireframe.
vtkInteractorStyle can be subclassed to provide new interaction styles and a facility to override any of the default mouse/key operations which currently handle trackball or joystick styles is provided. Note that this class will fire a variety of events that can be watched using an observer, such as LeftButtonPressEvent, LeftButtonReleaseEvent, MiddleButtonPressEvent, MiddleButtonReleaseEvent, RightButtonPressEvent, RightButtonReleaseEvent, EnterEvent, LeaveEvent, KeyPressEvent, KeyReleaseEvent, CharEvent, ExposeEvent, ConfigureEvent, TimerEvent, MouseMoveEvent,
- See also
- vtkInteractorStyleTrackball
- Events:
- vtkCommand::Button3DEvent vtkCommand::CharEvent vtkCommand::ConfigureEvent vtkCommand::DisableEvent vtkCommand::DropFilesEvent vtkCommand::EnableEvent vtkCommand::EndInteractionEvent vtkCommand::EndPanEvent vtkCommand::EndPinchEvent vtkCommand::EndRotateEvent vtkCommand::EndSwipeEvent vtkCommand::EnterEvent vtkCommand::ExposeEvent vtkCommand::FifthButtonPressEvent vtkCommand::FifthButtonReleaseEvent vtkCommand::FourthButtonPressEvent vtkCommand::FourthButtonReleaseEvent vtkCommand::KeyPressEvent vtkCommand::KeyReleaseEvent vtkCommand::LeaveEvent vtkCommand::LeftButtonPressEvent vtkCommand::LeftButtonReleaseEvent vtkCommand::LongTapEvent vtkCommand::MiddleButtonPressEvent vtkCommand::MiddleButtonReleaseEvent vtkCommand::MouseMoveEvent vtkCommand::MouseWheelBackwardEvent vtkCommand::MouseWheelForwardEvent vtkCommand::MouseWheelLeftEvent vtkCommand::MouseWheelRightEvent vtkCommand::Move3DEvent vtkCommand::PanEvent vtkCommand::PinchEvent vtkCommand::RightButtonPressEvent vtkCommand::RightButtonReleaseEvent vtkCommand::RotateEvent vtkCommand::StartInteractionEvent vtkCommand::StartPanEvent vtkCommand::StartPinchEvent vtkCommand::StartRotateEvent vtkCommand::StartSwipeEvent vtkCommand::SwipeEvent vtkCommand::TapEvent vtkCommand::TimerEvent vtkCommand::UpdateDropLocationEvent
- Examples:
- vtkInteractorStyle (Examples)
- Tests:
- vtkInteractorStyle (Tests)
Definition at line 147 of file vtkInteractorStyle.h.