VTK  9.1.0
vtkSliderWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSliderWidget.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
81#ifndef vtkSliderWidget_h
82#define vtkSliderWidget_h
83
84#include "vtkAbstractWidget.h"
85#include "vtkInteractionWidgetsModule.h" // For export macro
86
88
89class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
90{
91public:
96
98
102 void PrintSelf(ostream& os, vtkIndent indent) override;
104
111 {
112 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
113 }
114
119 {
120 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
121 }
122
124
131 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
132 vtkGetMacro(AnimationMode, int);
133 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
134 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
135 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
137
139
143 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
144 vtkGetMacro(NumberOfAnimationSteps, int);
146
151
152protected:
154 ~vtkSliderWidget() override = default;
155
156 // These are the events that are handled
160 void AnimateSlider(int selectionState);
161
162 // Manage the state of the widget
165 {
166 Start = 0,
168 Animating
169 };
170
174 {
177 Animate
178 };
179
180private:
181 vtkSliderWidget(const vtkSliderWidget&) = delete;
182 void operator=(const vtkSliderWidget&) = delete;
183};
184
185#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:43
abstract class defines the representation for a vtkSliderWidget
set a value by manipulating a slider
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
void SetAnimationModeToOff()
Control the behavior of the slider when selecting the tube or caps.
void SetAnimationModeToJump()
Control the behavior of the slider when selecting the tube or caps.
void AnimateSlider(int selectionState)
void SetAnimationModeToAnimate()
Control the behavior of the slider when selecting the tube or caps.
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
~vtkSliderWidget() override=default
static void SelectAction(vtkAbstractWidget *)
static void EndSelectAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static vtkSliderWidget * New()
Instantiate the class.
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static void MoveAction(vtkAbstractWidget *)
abstract class defines interface between the widget and widget representation classes
#define VTK_INT_MAX
Definition: vtkType.h:155