VTK  9.3.1
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
60 #ifndef vtkSliderWidget_h
61 #define vtkSliderWidget_h
62 
63 #include "vtkAbstractWidget.h"
64 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
65 #include "vtkInteractionWidgetsModule.h" // For export macro
66 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
67 
68 VTK_ABI_NAMESPACE_BEGIN
70 
71 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
72 {
73 public:
77  static vtkSliderWidget* New();
78 
80 
84  void PrintSelf(ostream& os, vtkIndent indent) override;
86 
93  {
94  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
95  }
96 
101  {
102  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
103  }
104 
106 
113  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
114  vtkGetMacro(AnimationMode, int);
115  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
116  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
117  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
119 
121 
125  vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
126  vtkGetMacro(NumberOfAnimationSteps, int);
128 
132  void CreateDefaultRepresentation() override;
133 
134 protected:
135  vtkSliderWidget();
136  ~vtkSliderWidget() override = default;
137 
138  // These are the events that are handled
139  static void SelectAction(vtkAbstractWidget*);
140  static void EndSelectAction(vtkAbstractWidget*);
141  static void MoveAction(vtkAbstractWidget*);
142  void AnimateSlider(int selectionState);
143 
144  // Manage the state of the widget
147  {
148  Start = 0,
150  Animating
151  };
152 #if !defined(VTK_LEGACY_REMOVE)
153  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
155 #endif
156 
160  {
163  Animate
164  };
165 
166 private:
167  vtkSliderWidget(const vtkSliderWidget&) = delete;
168  void operator=(const vtkSliderWidget&) = delete;
169 };
170 
171 VTK_ABI_NAMESPACE_END
172 #endif
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
#define VTK_INT_MAX
Definition: vtkType.h:144
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
void SetAnimationModeToOff()
Control the behavior of the slider when selecting the tube or caps.
vtkWidgetRepresentation * WidgetRep
void SetAnimationModeToJump()
Control the behavior of the slider when selecting the tube or caps.
a simple class to control print indentation
Definition: vtkIndent.h:28
void SetAnimationModeToAnimate()
Control the behavior of the slider when selecting the tube or caps.
abstract class defines the representation for a vtkSliderWidget
set a value by manipulating a slider
define the API for widget / widget representation
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...