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
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 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
76 
77 VTK_ABI_NAMESPACE_BEGIN
79 
80 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
81 {
82 public:
86  static vtkSliderWidget* New();
87 
89 
93  void PrintSelf(ostream& os, vtkIndent indent) override;
95 
102  {
103  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
104  }
105 
110  {
111  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
112  }
113 
115 
122  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
123  vtkGetMacro(AnimationMode, int);
124  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
125  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
126  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
128 
130 
134  vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
135  vtkGetMacro(NumberOfAnimationSteps, int);
137 
142 
143 protected:
145  ~vtkSliderWidget() override = default;
146 
147  // These are the events that are handled
151  void AnimateSlider(int selectionState);
152 
153  // Manage the state of the widget
156  {
157  Start = 0,
159  Animating
160  };
161 #if !defined(VTK_LEGACY_REMOVE)
162  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
164 #endif
165 
169  {
172  Animate
173  };
174 
175 private:
176  vtkSliderWidget(const vtkSliderWidget&) = delete;
177  void operator=(const vtkSliderWidget&) = delete;
178 };
179 
180 VTK_ABI_NAMESPACE_END
181 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract class defines the representation for a vtkSliderWidget
set a value by manipulating a slider
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
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.
static vtkSliderWidget * New()
Instantiate the class.
~vtkSliderWidget() override=default
static void SelectAction(vtkAbstractWidget *)
static void EndSelectAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
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