ParaView
|
Call a class member method in response to a VTK event. More...
#include <vtkMemberFunctionCommand.h>
Inherits vtkCommand.
Public Types | |
typedef vtkCommand | Superclass |
Public Member Functions | |
virtual const char * | GetClassNameInternal () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | SetCallback (ClassT &object, void(ClassT::*method2)(vtkObject *, unsigned long, void *)) |
virtual void | Execute (vtkObject *caller, unsigned long event, void *calldata) |
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... | |
Static Public Member Functions | |
static ThisT * | SafeDownCast (vtkObjectBase *o) |
static ThisT * | New () |
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 74 of file vtkMemberFunctionCommand.h.
typedef vtkCommand vtkMemberFunctionCommand< ClassT >::Superclass |
Definition at line 79 of file vtkMemberFunctionCommand.h.
|
inlinevirtual |
Definition at line 81 of file vtkMemberFunctionCommand.h.
|
inlinestatic |
Definition at line 83 of file vtkMemberFunctionCommand.h.
|
inlinestatic |
Definition at line 85 of file vtkMemberFunctionCommand.h.
|
inline |
Definition at line 87 of file vtkMemberFunctionCommand.h.
|
inline |
Set which class instance and member function will be called when a VTK event is received.
Definition at line 94 of file vtkMemberFunctionCommand.h.
|
inline |
Definition at line 101 of file vtkMemberFunctionCommand.h.
|
inlinevirtual |
Definition at line 107 of file vtkMemberFunctionCommand.h.
|
inline |
Definition at line 118 of file vtkMemberFunctionCommand.h.