VTK  9.2.6
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
86#include "vtkInteractionWidgetsModule.h" // For export macro
87
89
90class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
91{
92public:
97
99
103 void PrintSelf(ostream& os, vtkIndent indent) override;
105
112 {
113 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
114 }
115
120 {
121 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
122 }
123
125
132 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
133 vtkGetMacro(AnimationMode, int);
134 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
135 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
136 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
138
140
144 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
145 vtkGetMacro(NumberOfAnimationSteps, int);
147
152
153protected:
155 ~vtkSliderWidget() override = default;
156
157 // These are the events that are handled
161 void AnimateSlider(int selectionState);
162
163 // Manage the state of the widget
166 {
167 Start = 0,
169 Animating
170 };
171#if !defined(VTK_LEGACY_REMOVE)
172 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
174#endif
175
179 {
182 Animate
183 };
184
185private:
186 vtkSliderWidget(const vtkSliderWidget&) = delete;
187 void operator=(const vtkSliderWidget&) = delete;
188};
189
190#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition vtkIndent.h:49
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_DEPRECATED_IN_9_2_0(reason)
#define VTK_INT_MAX
Definition vtkType.h:155