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=========================================================================*/
69#ifndef vtkSliderWidget_h
70#define vtkSliderWidget_h
71
72#include "vtkAbstractWidget.h"
73#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
74#include "vtkInteractionWidgetsModule.h" // For export macro
75
77
78class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
79{
80public:
85
87
91 void PrintSelf(ostream& os, vtkIndent indent) override;
93
100 {
101 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
102 }
103
108 {
109 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
110 }
111
113
120 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
121 vtkGetMacro(AnimationMode, int);
122 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
123 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
124 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
126
128
132 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
133 vtkGetMacro(NumberOfAnimationSteps, int);
135
140
141protected:
143 ~vtkSliderWidget() override = default;
144
145 // These are the events that are handled
149 void AnimateSlider(int selectionState);
150
151 // Manage the state of the widget
154 {
155 Start = 0,
157 Animating
158 };
159#if !defined(VTK_LEGACY_REMOVE)
160 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
162#endif
163
167 {
170 Animate
171 };
172
173private:
174 vtkSliderWidget(const vtkSliderWidget&) = delete;
175 void operator=(const vtkSliderWidget&) = delete;
176};
177
178#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition vtkIndent.h:34
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