Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch Action mechanism.
More...
|
void | AddWidget (vtkAbstractWidget *) |
|
void | RemoveWidget (vtkAbstractWidget *) |
|
unsigned int | GetNumberOfWidgets () |
|
vtkAbstractWidget * | GetNthWidget (unsigned int) |
|
|
virtual void | SetEnabled (int) |
|
virtual void | EnabledOn () |
|
virtual void | EnabledOff () |
|
vtkObject * | NewInstance () const |
|
virtual void | DebugOn () |
|
virtual void | DebugOff () |
|
bool | GetDebug () |
|
void | SetDebug (bool debugFlag) |
|
virtual void | Modified () |
|
virtual unsigned long | GetMTime () |
|
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
|
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 *) |
|
int | HasObserver (unsigned long event, vtkCommand *) |
|
int | HasObserver (const char *event, vtkCommand *) |
|
void | RemoveObserver (unsigned long tag) |
|
void | RemoveObservers (unsigned long event) |
|
void | RemoveObservers (const char *event) |
|
void | RemoveAllObservers () |
|
int | HasObserver (unsigned long event) |
|
int | HasObserver (const char *event) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
|
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) |
|
int | InvokeEvent (unsigned long event, void *callData) |
|
int | InvokeEvent (const char *event, void *callData) |
|
int | InvokeEvent (unsigned long event) |
|
int | InvokeEvent (const char *event) |
|
const char * | GetClassName () const |
|
virtual void | Delete () |
|
virtual void | FastDelete () |
|
void | Print (ostream &os) |
|
virtual void | Register (vtkObjectBase *o) |
|
virtual void | UnRegister (vtkObjectBase *o) |
|
void | SetReferenceCount (int) |
|
void | PrintRevisions (ostream &) |
|
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
|
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
|
int | GetReferenceCount () |
|
Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch Action mechanism.
The class synchronizes a set of vtkAbstractWidget(s). Widgets typically invoke "Actions" that drive the geometry/behaviour of their representations in response to interactor events. Interactor interactions on a render window are mapped into "Callbacks" by the widget, from which "Actions" are dispatched to the entire set. This architecture allows us to tie widgets existing in different render windows together. For instance a HandleWidget might exist on the sagittal view. Moving it around should update the representations of the corresponding handle widget that lies on the axial and coronal and volume views as well.
- User API:
- A user would use this class as follows.
- Motivation:
- The motivation for this class is really to provide a usable API to tie together multiple widgets of the same kind. To enable this, subclasses of vtkAbstractWidget, must be written as follows: They will generally have callback methods mapped to some user interaction such as:
this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent,
vtkPaintbrushWidget::BeginDrawStrokeEvent,
this, vtkPaintbrushWidget::BeginDrawCallback);
The callback invoked when the left button is pressed looks like:
{
vtkPaintbrushWidget *self = vtkPaintbrushWidget::SafeDownCast(w);
self->WidgetSet->DispatchAction(self, &vtkPaintbrushWidget::BeginDrawAction);
}
The actual code for handling the drawing is written in the BeginDrawAction method. void vtkPaintbrushWidget::BeginDrawAction( vtkPaintbrushWidget *dispatcher)
{
}
- Warning
- Actions are always dispatched first to the activeWidget, the one calling the set, and then to the other widgets in the set.
Definition at line 112 of file vtkWidgetSet.h.