Section: Visualization Toolkit Widget Classes
The class defines basic positioning functionality, including the ability to size the widget with locked x/y proportions. The area within the border may be made "selectable" as well, meaning that a selection event interior to the widget invokes a virtual SelectRegion() method, which can be used to pick objects or otherwise manipulate data interior to the widget.
.SECTION Event Bindings By default, the widget responds to the following VTK events (i.e., it watches the vtkRenderWindowInteractor for these events): <pre> On the boundary of the widget: LeftButtonPressEvent - select boundary LeftButtonReleaseEvent - deselect boundary MouseMoveEvent - move/resize widget depending on which portion of the boundary was selected. On the interior of the widget: LeftButtonPressEvent - invoke SelectButton() callback (if the ivar Selectable is on) Anywhere on the widget: MiddleButtonPressEvent - move the widget </pre>
Note that the event bindings described above can be changed using this class's vtkWidgetEventTranslator. This class translates VTK events into the vtkBorderWidget's widget events: <pre> vtkWidgetEvent::Select -- some part of the widget has been selected vtkWidgetEvent::EndSelect -- the selection process has completed vtkWidgetEvent::Translate -- the widget is to be translated vtkWidgetEvent::Move -- a request for slider motion has been invoked </pre>
In turn, when these widget events are processed, this widget invokes the following VTK events on itself (which observers can listen for): <pre> vtkCommand::StartInteractionEvent (on vtkWidgetEvent::Select) vtkCommand::EndInteractionEvent (on vtkWidgetEvent::EndSelect) vtkCommand::InteractionEvent (on vtkWidgetEvent::Move) </pre>
To create an instance of class vtkBorderWidget, simply invoke its constructor as follows
obj = vtkBorderWidget
obj
is an instance of the vtkBorderWidget class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkBorderWidget = obj.NewInstance ()
vtkBorderWidget = obj.SafeDownCast (vtkObject o)
obj.SetSelectable (int )
- Indicate whether the interior region of the widget can be selected or
not. If not, then events (such as left mouse down) allow the user to
"move" the widget, and no selection is possible. Otherwise the
SelectRegion() method is invoked.
int = obj.GetSelectable ()
- Indicate whether the interior region of the widget can be selected or
not. If not, then events (such as left mouse down) allow the user to
"move" the widget, and no selection is possible. Otherwise the
SelectRegion() method is invoked.
obj.SelectableOn ()
- Indicate whether the interior region of the widget can be selected or
not. If not, then events (such as left mouse down) allow the user to
"move" the widget, and no selection is possible. Otherwise the
SelectRegion() method is invoked.
obj.SelectableOff ()
- Indicate whether the interior region of the widget can be selected or
not. If not, then events (such as left mouse down) allow the user to
"move" the widget, and no selection is possible. Otherwise the
SelectRegion() method is invoked.
obj.SetResizable (int )
- Indicate whether the boundary of the widget can be resized.
If not, the cursor will not change to "resize" type when mouse
over the boundary.
int = obj.GetResizable ()
- Indicate whether the boundary of the widget can be resized.
If not, the cursor will not change to "resize" type when mouse
over the boundary.
obj.ResizableOn ()
- Indicate whether the boundary of the widget can be resized.
If not, the cursor will not change to "resize" type when mouse
over the boundary.
obj.ResizableOff ()
- Indicate whether the boundary of the widget can be resized.
If not, the cursor will not change to "resize" type when mouse
over the boundary.
obj.SetRepresentation (vtkBorderRepresentation r)
- Create the default widget representation if one is not set.
obj.CreateDefaultRepresentation ()
- Create the default widget representation if one is not set.