ActiViz .NET  5.8.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Private Member Functions | Static Private Member Functions
Kitware.VTK.vtkWidgetSet Class Reference

vtkWidgetSet - Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch Action mechanism. More...

Inheritance diagram for Kitware.VTK.vtkWidgetSet:
[legend]
Collaboration diagram for Kitware.VTK.vtkWidgetSet:
[legend]

List of all members.

Public Member Functions

 vtkWidgetSet (IntPtr rawCppThis, bool callDisposalMethod, bool strong)
 Automatically generated constructor - called from generated code. DO NOT call directly.
 vtkWidgetSet ()
 Instantiate this class.
void AddWidget (vtkAbstractWidget arg0)
 Add a widget to the set.
virtual void EnabledOff ()
 Method for activiating and deactiviating all widgets in the group.
virtual void EnabledOn ()
 Method for activiating and deactiviating all widgets in the group.
vtkAbstractWidget GetNthWidget (uint arg0)
 Get the Nth widget in the set.
uint GetNumberOfWidgets ()
 Get number of widgets in the set.
override int IsA (string type)
 Standard methods for a VTK class.
new vtkWidgetSet NewInstance ()
 Standard methods for a VTK class.
void RemoveWidget (vtkAbstractWidget arg0)
 Remove a widget from the set.
virtual void SetEnabled (int arg0)
 Method for activiating and deactiviating all widgets in the group.

Static Public Member Functions

static new vtkWidgetSet New ()
 Instantiate this class.
static new int IsTypeOf (string type)
 Standard methods for a VTK class.
static new vtkWidgetSet SafeDownCast (vtkObjectBase o)
 Standard methods for a VTK class.

Public Attributes

new const string MRFullTypeName = "Kitware.VTK.vtkWidgetSet"
 Automatically generated type registration mechanics.

Static Public Attributes

static new readonly string MRClassNameKey = "12vtkWidgetSet"
 Automatically generated type registration mechanics.

Protected Member Functions

override void Dispose (bool disposing)
 Automatically generated protected Dispose method - called from public Dispose or the C# destructor. DO NOT call directly.

Private Member Functions

static internal IntPtr vtkWidgetSet_New (ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount)
static internal void vtkWidgetSet_AddWidget_01 (HandleRef pThis, HandleRef arg0)
static internal void vtkWidgetSet_EnabledOff_02 (HandleRef pThis)
static internal void vtkWidgetSet_EnabledOn_03 (HandleRef pThis)
static internal IntPtr vtkWidgetSet_GetNthWidget_04 (HandleRef pThis, uint arg0, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount)
static internal uint vtkWidgetSet_GetNumberOfWidgets_05 (HandleRef pThis)
static internal int vtkWidgetSet_IsA_06 (HandleRef pThis, string type)
static internal int vtkWidgetSet_IsTypeOf_07 (string type)
static internal IntPtr vtkWidgetSet_NewInstance_09 (HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount)
static internal void vtkWidgetSet_RemoveWidget_10 (HandleRef pThis, HandleRef arg0)
static internal IntPtr vtkWidgetSet_SafeDownCast_11 (HandleRef o, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount)
static internal void vtkWidgetSet_SetEnabled_12 (HandleRef pThis, int arg0)

Static Private Member Functions

static vtkWidgetSet ()
 Automatically generated type registration mechanics.

Detailed Description

vtkWidgetSet - Synchronize a collection on vtkWidgets drawn on different renderwindows using the Callback - Dispatch Action mechanism.

Description 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.

    vtkWidgetSet *set = vtkWidgetSet::New();
    vtkParallelopipedWidget *w1 = vtkParallelopipedWidget::New();
    set->AddWidget(w1);
    w1->SetInteractor(axialRenderWindow->GetInteractor());
    vtkParallelopipedWidget *w2 = vtkParallelopipedWidget::New();
    set->AddWidget(w2);
    w2->SetInteractor(coronalRenderWindow->GetInteractor());
    vtkParallelopipedWidget *w3 = vtkParallelopipedWidget::New();
    set->AddWidget(w3);
    w3->SetInteractor(sagittalRenderWindow->GetInteractor());
    set->SetEnabled(1);

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,
                            vtkEvent::NoModifier, 0, 0, NULL, 
                            vtkPaintbrushWidget::BeginDrawStrokeEvent,
                            this, vtkPaintbrushWidget::BeginDrawCallback);

The callback invoked when the left button is pressed looks like:

    void vtkPaintbrushWidget::BeginDrawCallback(vtkAbstractWidget *w)
    {
      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)
    {
    // Do stuff to draw... 
    // Here dispatcher is the widget that was interacted with, the one that
    // dispatched an action to all the other widgets in its group. You may, if
    // necessary find it helpful to get parameters from it.
    //   For instance for a ResizeAction:
    //     if (this != dispatcher)
    //       {
    //       double *newsize = dispatcher->GetRepresentation()->GetSize();
    //       this->WidgetRep->SetSize(newsize);
    //       }
    //     else
    //       {
    //       this->WidgetRep->IncrementSizeByDelta();
    //       }
    }

Caveats Actions are always dispatched first to the activeWidget, the one calling the set, and then to the other widgets in the set.


Constructor & Destructor Documentation

static Kitware.VTK.vtkWidgetSet.vtkWidgetSet ( ) [static, private]

Automatically generated type registration mechanics.

Kitware.VTK.vtkWidgetSet.vtkWidgetSet ( IntPtr  rawCppThis,
bool  callDisposalMethod,
bool  strong 
)

Automatically generated constructor - called from generated code. DO NOT call directly.

Instantiate this class.


Member Function Documentation

Add a widget to the set.

override void Kitware.VTK.vtkWidgetSet.Dispose ( bool  disposing) [protected]

Automatically generated protected Dispose method - called from public Dispose or the C# destructor. DO NOT call directly.

Reimplemented from Kitware.VTK.vtkObject.

virtual void Kitware.VTK.vtkWidgetSet.EnabledOff ( ) [virtual]

Method for activiating and deactiviating all widgets in the group.

virtual void Kitware.VTK.vtkWidgetSet.EnabledOn ( ) [virtual]

Method for activiating and deactiviating all widgets in the group.

Get the Nth widget in the set.

Here is the call graph for this function:

Get number of widgets in the set.

override int Kitware.VTK.vtkWidgetSet.IsA ( string  type) [virtual]

Standard methods for a VTK class.

Reimplemented from Kitware.VTK.vtkObject.

static new int Kitware.VTK.vtkWidgetSet.IsTypeOf ( string  type) [static]

Standard methods for a VTK class.

Reimplemented from Kitware.VTK.vtkObject.

static new vtkWidgetSet Kitware.VTK.vtkWidgetSet.New ( ) [static]

Instantiate this class.

Reimplemented from Kitware.VTK.vtkObject.

Standard methods for a VTK class.

Reimplemented from Kitware.VTK.vtkObject.

Remove a widget from the set.

Standard methods for a VTK class.

Reimplemented from Kitware.VTK.vtkObject.

Here is the call graph for this function:

virtual void Kitware.VTK.vtkWidgetSet.SetEnabled ( int  arg0) [virtual]

Method for activiating and deactiviating all widgets in the group.

static internal void Kitware.VTK.vtkWidgetSet.vtkWidgetSet_AddWidget_01 ( HandleRef  pThis,
HandleRef  arg0 
) [private]
static internal void Kitware.VTK.vtkWidgetSet.vtkWidgetSet_EnabledOff_02 ( HandleRef  pThis) [private]
static internal void Kitware.VTK.vtkWidgetSet.vtkWidgetSet_EnabledOn_03 ( HandleRef  pThis) [private]
static internal IntPtr Kitware.VTK.vtkWidgetSet.vtkWidgetSet_GetNthWidget_04 ( HandleRef  pThis,
uint  arg0,
ref uint  mteStatus,
ref uint  mteIndex,
ref uint  rawRefCount 
) [private]
static internal uint Kitware.VTK.vtkWidgetSet.vtkWidgetSet_GetNumberOfWidgets_05 ( HandleRef  pThis) [private]
static internal int Kitware.VTK.vtkWidgetSet.vtkWidgetSet_IsA_06 ( HandleRef  pThis,
string  type 
) [private]
static internal int Kitware.VTK.vtkWidgetSet.vtkWidgetSet_IsTypeOf_07 ( string  type) [private]
static internal IntPtr Kitware.VTK.vtkWidgetSet.vtkWidgetSet_New ( ref uint  mteStatus,
ref uint  mteIndex,
ref uint  rawRefCount 
) [private]
static internal IntPtr Kitware.VTK.vtkWidgetSet.vtkWidgetSet_NewInstance_09 ( HandleRef  pThis,
ref uint  mteStatus,
ref uint  mteIndex,
ref uint  rawRefCount 
) [private]
static internal void Kitware.VTK.vtkWidgetSet.vtkWidgetSet_RemoveWidget_10 ( HandleRef  pThis,
HandleRef  arg0 
) [private]
static internal IntPtr Kitware.VTK.vtkWidgetSet.vtkWidgetSet_SafeDownCast_11 ( HandleRef  o,
ref uint  mteStatus,
ref uint  mteIndex,
ref uint  rawRefCount 
) [private]
static internal void Kitware.VTK.vtkWidgetSet.vtkWidgetSet_SetEnabled_12 ( HandleRef  pThis,
int  arg0 
) [private]

Member Data Documentation

new readonly string Kitware.VTK.vtkWidgetSet.MRClassNameKey = "12vtkWidgetSet" [static]

Automatically generated type registration mechanics.

Reimplemented from Kitware.VTK.vtkObject.

new const string Kitware.VTK.vtkWidgetSet.MRFullTypeName = "Kitware.VTK.vtkWidgetSet"

Automatically generated type registration mechanics.

Reimplemented from Kitware.VTK.vtkObject.


The documentation for this class was generated from the following file: