VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkAbstractWidget Class Referenceabstract

define the API for widget / widget representation More...

#include <vtkAbstractWidget.h>

Inheritance diagram for vtkAbstractWidget:
[legend]
Collaboration diagram for vtkAbstractWidget:
[legend]

Public Member Functions

virtual void SetEnabled (int)
 
virtual void CreateDefaultRepresentation ()=0
 
void Render ()
 
virtual void SetPriority (float)
 
virtual void SetProcessEvents (int)
 
virtual int GetProcessEvents ()
 
virtual void ProcessEventsOn ()
 
virtual void ProcessEventsOff ()
 
vtkWidgetEventTranslatorGetEventTranslator ()
 
void SetParent (vtkAbstractWidget *parent)
 
virtual vtkAbstractWidgetGetParent ()
 
vtkWidgetRepresentationGetRepresentation ()
 
virtual void SetManagesCursor (int)
 
virtual int GetManagesCursor ()
 
virtual void ManagesCursorOn ()
 
virtual void ManagesCursorOff ()
 

Protected Member Functions

 vtkAbstractWidget ()
 
 ~vtkAbstractWidget ()
 
void SetWidgetRepresentation (vtkWidgetRepresentation *r)
 
virtual void SetCursor (int vtkNotUsed(state))
 

Static Protected Member Functions

static void ProcessEventsHandler (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 

Protected Attributes

vtkWidgetRepresentationWidgetRep
 
int ManagesCursor
 
vtkWidgetEventTranslatorEventTranslator
 
vtkWidgetCallbackMapperCallbackMapper
 
vtkAbstractWidgetParent
 
void * CallData
 
int ProcessEvents
 
typedef vtkInteractorObserver Superclass
 
static int IsTypeOf (const char *type)
 
static vtkAbstractWidgetSafeDownCast (vtkObjectBase *o)
 
virtual int IsA (const char *type)
 
vtkAbstractWidgetNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkObjectBase * NewInstanceInternal () const
 

Detailed Description

define the API for widget / widget representation

The vtkAbstractWidget defines an API and implements methods common to all widgets using the interaction/representation design. In this design, the term interaction means that part of the widget that performs event handling, while the representation corresponds to a vtkProp (or the subclass vtkWidgetRepresentation) used to represent the widget. vtkAbstractWidget also implements some methods common to all subclasses.

Note that vtkAbstractWidget provides access to the vtkWidgetEventTranslator. This class is responsible for translating VTK events (defined in vtkCommand.h) into widget events (defined in vtkWidgetEvent.h). This class can be manipulated so that different VTK events can be mapped into widget events, thereby allowing the modification of event bindings. Each subclass of vtkAbstractWidget defines the events to which it responds.

Warning
Note that the pair ( vtkAbstractWidget / vtkWidgetRepresentation ) is an implementation of the second generation VTK Widgets design. In the first generation design, widgets were implemented in a single monolithic class. This design was problematic because in client-server application it was difficult to manage widgets properly. Also, new "representations" or look-and-feel, for a widget required a whole new class, with a lot of redundant code. The separation of the widget event handling and representation enables users and developers to create new appearances for the widget. It also facilitates parallel processing, where the client application handles events, and remote representations of the widget are slaves to the client (and do not handle events).
See Also
vtkWidgetRepresentation vtkWidgetEventTranslator vtkWidgetCallbackMapper
Events:
vtkCommand::DisableEvent vtkCommand::EnableEvent

Definition at line 65 of file vtkAbstractWidget.h.

Member Typedef Documentation

typedef vtkInteractorObserver vtkAbstractWidget::Superclass

Standard macros implementing standard VTK methods.

Definition at line 70 of file vtkAbstractWidget.h.

Constructor & Destructor Documentation

vtkAbstractWidget::vtkAbstractWidget ( )
protected
vtkAbstractWidget::~vtkAbstractWidget ( )
protected

Member Function Documentation

static int vtkAbstractWidget::IsTypeOf ( const char *  type)
static

Standard macros implementing standard VTK methods.

virtual int vtkAbstractWidget::IsA ( const char *  type)
virtual
static vtkAbstractWidget* vtkAbstractWidget::SafeDownCast ( vtkObjectBase *  o)
static

Standard macros implementing standard VTK methods.

virtual vtkObjectBase* vtkAbstractWidget::NewInstanceInternal ( ) const
protectedvirtual
vtkAbstractWidget* vtkAbstractWidget::NewInstance ( ) const

Standard macros implementing standard VTK methods.

void vtkAbstractWidget::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

Standard macros implementing standard VTK methods.

virtual void vtkAbstractWidget::SetEnabled ( int  )
virtual

Methods for activating this widget. Note that the widget representation must be specified or the widget will not appear. ProcessEvents (On by default) must be On for Enabled widget to respond to interaction. If ProcessEvents is Off, enabling/disabling a widget merely affects the visibility of the representation.

Reimplemented in vtkContourWidget, vtkImplicitPlaneWidget2, vtkBiDimensionalWidget, vtkLineWidget2, vtkAxesTransformWidget, vtkAffineWidget, vtkAngleWidget, vtkBalloonWidget, vtkHoverWidget, vtkDistanceWidget, vtkSeedWidget, vtkResliceCursorWidget, vtkCheckerboardWidget, vtkParallelopipedWidget, and vtkCaptionWidget.

virtual void vtkAbstractWidget::SetProcessEvents ( int  )
virtual

Methods to change whether the widget responds to interaction. Set this to Off to disable interaction. On by default. Subclasses must overide SetProcessEvents() to make sure that they pass on the flag to all component widgets.

Reimplemented in vtkBiDimensionalWidget, vtkLineWidget2, vtkSeedWidget, vtkAxesTransformWidget, vtkAngleWidget, vtkDistanceWidget, and vtkParallelopipedWidget.

virtual int vtkAbstractWidget::GetProcessEvents ( )
virtual

Methods to change whether the widget responds to interaction. Set this to Off to disable interaction. On by default. Subclasses must overide SetProcessEvents() to make sure that they pass on the flag to all component widgets.

virtual void vtkAbstractWidget::ProcessEventsOn ( )
virtual

Methods to change whether the widget responds to interaction. Set this to Off to disable interaction. On by default. Subclasses must overide SetProcessEvents() to make sure that they pass on the flag to all component widgets.

virtual void vtkAbstractWidget::ProcessEventsOff ( )
virtual

Methods to change whether the widget responds to interaction. Set this to Off to disable interaction. On by default. Subclasses must overide SetProcessEvents() to make sure that they pass on the flag to all component widgets.

vtkWidgetEventTranslator* vtkAbstractWidget::GetEventTranslator ( )
inline

Get the event translator. Careful manipulation of this class enables the user to override the default event bindings.

Definition at line 94 of file vtkAbstractWidget.h.

virtual void vtkAbstractWidget::CreateDefaultRepresentation ( )
pure virtual
void vtkAbstractWidget::Render ( )

This method is called by subclasses when a render method is to be invoked on the vtkRenderWindowInteractor. This method should be called (instead of vtkRenderWindow::Render() because it has built into it optimizations for minimizing renders and/or speeding renders.

void vtkAbstractWidget::SetParent ( vtkAbstractWidget parent)
inline

Specifying a parent to this widget is used when creating composite widgets. It is an internal method not meant to be used by the public. When a widget has a parent, it defers the rendering to the parent. It may also defer managing the cursor (see ManagesCursor ivar).

Definition at line 115 of file vtkAbstractWidget.h.

virtual vtkAbstractWidget* vtkAbstractWidget::GetParent ( )
virtual

Specifying a parent to this widget is used when creating composite widgets. It is an internal method not meant to be used by the public. When a widget has a parent, it defers the rendering to the parent. It may also defer managing the cursor (see ManagesCursor ivar).

vtkWidgetRepresentation* vtkAbstractWidget::GetRepresentation ( )
inline

Return an instance of vtkWidgetRepresentation used to represent this widget in the scene. Note that the representation is a subclass of vtkProp (typically a subclass of vtkWidgetRepresenation) so it can be added to the renderer independent of the widget.

Definition at line 124 of file vtkAbstractWidget.h.

virtual void vtkAbstractWidget::SetManagesCursor ( int  )
virtual

Turn on or off the management of the cursor. Cursor management is typically disabled for subclasses when composite widgets are created. For example, vtkHandleWidgets are often used to create composite widgets, and the parent widget takes over the cursor management.

virtual int vtkAbstractWidget::GetManagesCursor ( )
virtual

Turn on or off the management of the cursor. Cursor management is typically disabled for subclasses when composite widgets are created. For example, vtkHandleWidgets are often used to create composite widgets, and the parent widget takes over the cursor management.

virtual void vtkAbstractWidget::ManagesCursorOn ( )
virtual

Turn on or off the management of the cursor. Cursor management is typically disabled for subclasses when composite widgets are created. For example, vtkHandleWidgets are often used to create composite widgets, and the parent widget takes over the cursor management.

virtual void vtkAbstractWidget::ManagesCursorOff ( )
virtual

Turn on or off the management of the cursor. Cursor management is typically disabled for subclasses when composite widgets are created. For example, vtkHandleWidgets are often used to create composite widgets, and the parent widget takes over the cursor management.

virtual void vtkAbstractWidget::SetPriority ( float  )
virtual

Override the superclass method. This will automatically change the priority of the widget. Unlike the superclass documentation, no methods such as SetInteractor to null and reset it etc. are necessary

static void vtkAbstractWidget::ProcessEventsHandler ( vtkObject *  object,
unsigned long  event,
void *  clientdata,
void *  calldata 
)
staticprotected
void vtkAbstractWidget::SetWidgetRepresentation ( vtkWidgetRepresentation r)
protected
virtual void vtkAbstractWidget::SetCursor ( int   vtkNotUsedstate)
inlineprotectedvirtual

Definition at line 163 of file vtkAbstractWidget.h.

Member Data Documentation

vtkWidgetRepresentation* vtkAbstractWidget::WidgetRep
protected

Definition at line 159 of file vtkAbstractWidget.h.

int vtkAbstractWidget::ManagesCursor
protected

Definition at line 162 of file vtkAbstractWidget.h.

vtkWidgetEventTranslator* vtkAbstractWidget::EventTranslator
protected

Definition at line 166 of file vtkAbstractWidget.h.

vtkWidgetCallbackMapper* vtkAbstractWidget::CallbackMapper
protected

Definition at line 167 of file vtkAbstractWidget.h.

vtkAbstractWidget* vtkAbstractWidget::Parent
protected

Definition at line 170 of file vtkAbstractWidget.h.

void* vtkAbstractWidget::CallData
protected

Definition at line 175 of file vtkAbstractWidget.h.

int vtkAbstractWidget::ProcessEvents
protected

Definition at line 179 of file vtkAbstractWidget.h.


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