|
enum | EventIds {
NoEvent = 0
, AnyEvent
, DeleteEvent
, StartEvent
,
EndEvent
, RenderEvent
, ProgressEvent
, PickEvent
,
StartPickEvent
, EndPickEvent
, AbortCheckEvent
, ExitEvent
,
LeftButtonPressEvent
, LeftButtonReleaseEvent
, MiddleButtonPressEvent
, MiddleButtonReleaseEvent
,
RightButtonPressEvent
, RightButtonReleaseEvent
, EnterEvent
, LeaveEvent
,
KeyPressEvent
, KeyReleaseEvent
, CharEvent
, ExposeEvent
,
ConfigureEvent
, TimerEvent
, MouseMoveEvent
, MouseWheelForwardEvent
,
MouseWheelBackwardEvent
, ActiveCameraEvent
, CreateCameraEvent
, ResetCameraEvent
,
ResetCameraClippingRangeEvent
, ModifiedEvent
, WindowLevelEvent
, StartWindowLevelEvent
,
EndWindowLevelEvent
, ResetWindowLevelEvent
, SetOutputEvent
, ErrorEvent
,
WarningEvent
, StartInteractionEvent
, DropFilesEvent
, UpdateDropLocationEvent
,
InteractionEvent
, EndInteractionEvent
, EnableEvent
, DisableEvent
,
CreateTimerEvent
, DestroyTimerEvent
, PlacePointEvent
, DeletePointEvent
,
PlaceWidgetEvent
, CursorChangedEvent
, ExecuteInformationEvent
, RenderWindowMessageEvent
,
WrongTagEvent
, StartAnimationCueEvent
, ResliceAxesChangedEvent
, AnimationCueTickEvent
,
EndAnimationCueEvent
, VolumeMapperRenderEndEvent
, VolumeMapperRenderProgressEvent
, VolumeMapperRenderStartEvent
,
VolumeMapperComputeGradientsEndEvent
, VolumeMapperComputeGradientsProgressEvent
, VolumeMapperComputeGradientsStartEvent
, WidgetModifiedEvent
,
WidgetValueChangedEvent
, WidgetActivateEvent
, ConnectionCreatedEvent
, ConnectionClosedEvent
,
DomainModifiedEvent
, PropertyModifiedEvent
, UpdateEvent
, RegisterEvent
,
UnRegisterEvent
, UpdateInformationEvent
, AnnotationChangedEvent
, SelectionChangedEvent
,
UpdatePropertyEvent
, ViewProgressEvent
, UpdateDataEvent
, CurrentChangedEvent
,
ComputeVisiblePropBoundsEvent
, TDxMotionEvent
, TDxButtonPressEvent
, TDxButtonReleaseEvent
,
HoverEvent
, LoadStateEvent
, SaveStateEvent
, StateChangedEvent
,
WindowMakeCurrentEvent
, WindowIsCurrentEvent
, WindowFrameEvent
, HighlightEvent
,
WindowSupportsOpenGLEvent
, WindowIsDirectEvent
, WindowStereoTypeChangedEvent
, WindowResizeEvent
,
UncheckedPropertyModifiedEvent
, UpdateShaderEvent
, MessageEvent
, StartSwipeEvent
,
SwipeEvent
, EndSwipeEvent
, StartPinchEvent
, PinchEvent
,
EndPinchEvent
, StartRotateEvent
, RotateEvent
, EndRotateEvent
,
StartPanEvent
, PanEvent
, EndPanEvent
, TapEvent
,
LongTapEvent
, FourthButtonPressEvent
, FourthButtonReleaseEvent
, FifthButtonPressEvent
,
FifthButtonReleaseEvent
, Move3DEvent
, Button3DEvent
, TextEvent
,
LeftButtonDoubleClickEvent
, MiddleButtonDoubleClickEvent
, RightButtonDoubleClickEvent
, MouseWheelLeftEvent
,
MouseWheelRightEvent
, ViewerMovement3DEvent
, Menu3DEvent
, NextPose3DEvent
,
Clip3DEvent
, PositionProp3DEvent
, Pick3DEvent
, Select3DEvent
,
Elevation3DEvent
, UserEvent = 1000
} |
|
|
static bool | EventHasData (unsigned long event) |
| Does this event type contain vtkEventData.
|
|
|
static const char * | GetStringFromEventId (unsigned long event) |
| Convenience methods for translating between event names and event ids.
|
|
static unsigned long | GetEventIdFromString (const char *event) |
| Convenience methods for translating between event names and event ids.
|
|
static vtkTypeBool | IsTypeOf (const char *name) |
| Return 1 if this class type is the same type of (or a subclass of) the named class.
|
|
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).
|
|
static vtkObjectBase * | New () |
| Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
|
|
static void | SetMemkindDirectory (const char *directoryname) |
| The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
|
|
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.
|
|
superclass for callback/observer methods
vtkCommand is an implementation of the observer/command design pattern. In this design pattern, any instance of vtkObject can be "observed" for any events it might invoke. For example, vtkRenderer invokes a StartEvent as it begins to render and a EndEvent when it finishes rendering. Filters (subclasses of vtkProcessObject) invoke StartEvent, ProgressEvent, and EndEvent as the filter processes data. Observers of events are added with the AddObserver() method found in vtkObject. AddObserver(), besides requiring an event id or name, also takes an instance of vtkCommand (or a subclasses). Note that vtkCommand is meant to be subclassed, so that you can package the information necessary to support your callback.
Event processing can be organized in priority lists, so it is possible to truncate the processing of a particular event by setting the AbortFlag variable. The priority is set using the AddObserver() method. By default the priority is 0, events of the same priority are processed in last-in-first-processed order. The ordering/aborting of events is important for things like 3D widgets, which handle an event if the widget is selected (and then aborting further processing of that event). Otherwise. the event is passed along for further processing.
When an instance of vtkObject invokes an event, it also passes an optional void pointer to a callData. This callData is nullptr most of the time. The callData is not specific to a type of event but specific to a type of vtkObject invoking a specific event. For instance, vtkCommand::PickEvent is invoked by vtkProp with a nullptr callData but is invoked by vtkInteractorStyleImage with a pointer to the vtkInteractorStyleImage object itself.
Here is the list of events that may be invoked with a non-nullptr callData.
- See also
- vtkObject vtkCallbackCommand vtkOldStyleCallbackCommand vtkInteractorObserver vtk3DWidget
Definition at line 383 of file vtkCommand.h.
virtual void vtkCommand::Execute |
( |
vtkObject * |
caller, |
|
|
unsigned long |
eventId, |
|
|
void * |
callData |
|
) |
| |
|
pure virtual |
All derived classes of vtkCommand must implement this method.
This is the method that actually does the work of the callback. The caller argument is the object invoking the event, the eventId parameter is the id of the event, and callData parameter is data that can be passed into the execute method. (Note: vtkObject::InvokeEvent() takes two parameters: the event id (or name) and call data. Typically call data is nullptr, but the user can package data and pass it this way. Alternatively, a derived class of vtkCommand can be used to pass data.)
Implemented in vtkTclCommand, vtkCallbackCommand, vtkEventForwarderCommand, and vtkOldStyleCallbackCommand.