Call a class member method in response to a VTK event. More...
#include <vtkMemberFunctionCommand.h>
Public Types | |
typedef vtkCommand | Superclass |
Public Member Functions | |
const char * | GetClassNameInternal () const override |
void | PrintSelf (ostream &os, vtkIndent indent) override |
void | SetCallback (ClassT &object, void(ClassT::*method2)(vtkObject *, unsigned long, void *)) |
void | Execute (vtkObject *caller, unsigned long event, void *calldata) override |
void | Reset () |
void | SetCallback (ClassT &object, void(ClassT::*method)()) |
Set which class instance and member function will be called when a VTK event is received. More... | |
Public Member Functions inherited from vtkCommand | |
vtkBaseTypeMacro (vtkCommand, vtkObjectBase) | |
void | UnRegister () |
virtual void | UnRegister (vtkObjectBase *) |
void | SetAbortFlag (int f) |
int | GetAbortFlag () |
void | AbortFlagOn () |
void | AbortFlagOff () |
void | SetPassiveObserver (int f) |
int | GetPassiveObserver () |
void | PassiveObserverOn () |
void | PassiveObserverOff () |
void | UnRegister () |
virtual void | UnRegister (vtkObjectBase *) |
void | SetAbortFlag (int f) |
int | GetAbortFlag () |
void | AbortFlagOn () |
void | AbortFlagOff () |
void | SetPassiveObserver (int f) |
int | GetPassiveObserver () |
void | PassiveObserverOn () |
void | PassiveObserverOff () |
vtkCommand () | |
virtual | ~vtkCommand () |
vtkCommand (const vtkCommand &c) | |
void | operator= (const vtkCommand &) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual vtkTypeBool | IsA (const char *name) |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
void | SetReferenceCount (int) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
Static Public Member Functions | |
static ThisT * | SafeDownCast (vtkObjectBase *o) |
static ThisT * | New () |
Static Public Member Functions inherited from vtkCommand | |
static const char * | GetStringFromEventId (unsigned long event) |
static unsigned long | GetEventIdFromString (const char *event) |
static const char * | GetStringFromEventId (unsigned long event) |
static unsigned long | GetEventIdFromString (const char *event) |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
static vtkObjectBase * | New () |
Additional Inherited Members | |
Public Attributes inherited from vtkCommand | |
vtkEventDeclarationMacro(EventIds) protected int | PassiveObserver |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Call a class member method in response to a VTK event.
vtkMemberFunctionCommand is a vtkCommand-derivative that will listen for VTK events, calling a class member function when a VTK event is received.
It is generally more useful than vtkCallbackCommand, which can only call non-member functions in response to a VTK event.
Usage: create an instance of vtkMemberFunctionCommand, specialized for the class that will receive events. Use the SetCallback() method to pass the instance and member function that will be called when an event is received. Use vtkObject::AddObserver() to control which VTK events the vtkMemberFunctionCommand object will receive.
Usage:
vtkObject* subject = ... foo* observer = ... vtkMemberFunctionCommand<foo>* adapter = vtkMemberFunctionCommand<foo>::New(); adapter->SetCallback(observer, &foo::bar); subject->AddObserver(vtkCommand::AnyEvent, adapter);
Alternative Usage
vtkCommand* command = vtkMakeMemberFunctionCommand(*observer, &foo::Callback); subject->AddObserver(vtkCommand::AnyEvent, command);
There are two types of callback methods that could be defined.
Definition at line 49 of file vtkMemberFunctionCommand.h.
typedef vtkCommand vtkMemberFunctionCommand< ClassT >::Superclass |
Definition at line 54 of file vtkMemberFunctionCommand.h.
|
inlineoverride |
Definition at line 56 of file vtkMemberFunctionCommand.h.
|
inlinestatic |
Definition at line 58 of file vtkMemberFunctionCommand.h.
|
inlinestatic |
Definition at line 60 of file vtkMemberFunctionCommand.h.
|
inlineoverridevirtual |
Reimplemented from vtkObjectBase.
Definition at line 62 of file vtkMemberFunctionCommand.h.
|
inline |
Set which class instance and member function will be called when a VTK event is received.
Definition at line 72 of file vtkMemberFunctionCommand.h.
|
inline |
Definition at line 79 of file vtkMemberFunctionCommand.h.
|
inlineoverridevirtual |
Implements vtkCommand.
Definition at line 85 of file vtkMemberFunctionCommand.h.
|
inline |
Definition at line 96 of file vtkMemberFunctionCommand.h.