FreeMat: vtkSliderWidget

FreeMat

- Main Page
- Related Pages

vtkSliderWidget

Section: Visualization Toolkit Widget Classes

# Usage

The vtkSliderWidget is used to set a scalar value in an application. This class assumes that a slider is moved along a 1D parameter space (e.g., a spherical bead that can be moved along a tube). Moving the slider modifies the value of the widget, which can be used to set parameters on other objects. Note that the actual appearance of the widget depends on the specific representation for the widget.

To use this widget, set the widget representation. The representation is assumed to consist of a tube, two end caps, and a slider (the details may vary depending on the particulars of the representation). Then in the representation you will typically set minimum and maximum value, as well as the current value. The position of the slider must also be set, as well as various properties.

.SECTION Event Bindings By default, the widget responds to the following VTK events (i.e., it watches the vtkRenderWindowInteractor for these events):

     If the slider bead is selected:
       LeftButtonPressEvent - select slider (if on slider)
       LeftButtonReleaseEvent - release slider (if selected)
       MouseMoveEvent - move slider
     If the end caps or slider tube are selected:
       LeftButtonPressEvent - move (or animate) to cap or point on tube;

Note that the event bindings described above can be changed using this class's vtkWidgetEventTranslator. This class translates VTK events into the vtkSliderWidget's widget events:

       vtkWidgetEvent::Select – some part of the widget has been selected
       vtkWidgetEvent::EndSelect – the selection process has completed
       vtkWidgetEvent::Move – a request for slider motion has been invoked

In turn, when these widget events are processed, the vtkSliderWidget invokes the following VTK events on itself (which observers can listen for):

       vtkCommand::StartInteractionEvent (on vtkWidgetEvent::Select)
       vtkCommand::EndInteractionEvent (on vtkWidgetEvent::EndSelect)
       vtkCommand::InteractionEvent (on vtkWidgetEvent::Move)

To create an instance of class vtkSliderWidget, simply invoke its constructor as follows

      obj = vtkSliderWidget

# Methods

The class vtkSliderWidget has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkSliderWidget class.

- `string = obj.GetClassName ()` - Standard macros.
- `int = obj.IsA (string name)` - Standard macros.
- `vtkSliderWidget = obj.NewInstance ()` - Standard macros.
- `vtkSliderWidget = obj.SafeDownCast (vtkObject o)` - Standard macros.
- `obj.SetRepresentation (vtkSliderRepresentation r)` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `obj.SetAnimationMode (int )` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `int = obj.GetAnimationModeMinValue ()` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `int = obj.GetAnimationModeMaxValue ()` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `int = obj.GetAnimationMode ()` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `obj.SetAnimationModeToOff ()` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `obj.SetAnimationModeToJump ()` - Control the behavior of the slider when selecting the tube or caps. If Jump, then selecting the tube, left cap, or right cap causes the slider to jump to the selection point. If the mode is Animate, the slider moves towards the selection point in NumberOfAnimationSteps number of steps. If Off, then the slider does not move.
- `obj.SetAnimationModeToAnimate ()` - Specify the number of animation steps to take if the animation mode is set to animate.
- `obj.SetNumberOfAnimationSteps (int )` - Specify the number of animation steps to take if the animation mode is set to animate.
- `int = obj.GetNumberOfAnimationStepsMinValue ()` - Specify the number of animation steps to take if the animation mode is set to animate.
- `int = obj.GetNumberOfAnimationStepsMaxValue ()` - Specify the number of animation steps to take if the animation mode is set to animate.
- `int = obj.GetNumberOfAnimationSteps ()` - Specify the number of animation steps to take if the animation mode is set to animate.
- `obj.CreateDefaultRepresentation ()` - Create the default widget representation if one is not set.