43 #ifndef vtkMemberFunctionCommand_h 44 #define vtkMemberFunctionCommand_h 48 template <
class ClassT>
60 static ThisT*
New() {
return new ThisT(); }
74 this->Object = &object;
75 this->Method = method;
81 this->Object = &object;
82 this->Method2 = method2;
87 if (this->Object && this->Method)
89 (this->Object->*this->Method)();
91 if (this->Object && this->Method2)
93 (this->Object->*this->Method2)(caller, event, calldata);
98 this->Object =
nullptr;
99 this->Method2 =
nullptr;
100 this->Method =
nullptr;
106 this->Object =
nullptr;
107 this->Method =
nullptr;
108 this->Method2 =
nullptr;
114 void (ClassT::*Method)();
115 void (ClassT::*Method2)(
vtkObject* caller,
unsigned long event,
void* calldata);
136 template <
class ClassT>
138 ClassT&
object,
void (ClassT::*method)())
145 template <
class ClassT>
147 ClassT&
object,
void (ClassT::*method)(
vtkObject*,
unsigned long,
void*))
void SetCallback(ClassT &object, void(ClassT::*method)())
Set which class instance and member function will be called when a VTK event is received.
static ThisT * SafeDownCast(vtkObjectBase *o)
const char * GetClassNameInternal() const override
void SetCallback(ClassT &object, void(ClassT::*method2)(vtkObject *, unsigned long, void *))
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkMemberFunctionCommand< ClassT > * vtkMakeMemberFunctionCommand(ClassT &object, void(ClassT::*method)())
Convenience function for creating vtkMemberFunctionCommand instances that automatically deduces its a...
void Execute(vtkObject *caller, unsigned long event, void *calldata) override
Call a class member method in response to a VTK event.