VTK  9.3.0
vtkSliderWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
57#ifndef vtkSliderWidget_h
58#define vtkSliderWidget_h
59
60#include "vtkAbstractWidget.h"
61#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
62#include "vtkInteractionWidgetsModule.h" // For export macro
63#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
64
65VTK_ABI_NAMESPACE_BEGIN
67
68class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
69{
70public:
75
77
81 void PrintSelf(ostream& os, vtkIndent indent) override;
83
90 {
91 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
92 }
93
98 {
99 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
100 }
101
103
110 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
111 vtkGetMacro(AnimationMode, int);
112 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
113 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
114 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
116
118
122 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
123 vtkGetMacro(NumberOfAnimationSteps, int);
125
130
131protected:
133 ~vtkSliderWidget() override = default;
134
135 // These are the events that are handled
139 void AnimateSlider(int selectionState);
140
141 // Manage the state of the widget
144 {
145 Start = 0,
147 Animating
148 };
149#if !defined(VTK_LEGACY_REMOVE)
150 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
152#endif
153
157 {
160 Animate
161 };
162
163private:
164 vtkSliderWidget(const vtkSliderWidget&) = delete;
165 void operator=(const vtkSliderWidget&) = delete;
166};
167
168VTK_ABI_NAMESPACE_END
169#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition vtkIndent.h:29
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:144