VTK  9.3.20240227
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
169 #ifndef vtkSliderWidget_h
170 #define vtkSliderWidget_h
171 
172 #include "vtkAbstractWidget.h"
173 #include "vtkInteractionWidgetsModule.h" // For export macro
174 
175 VTK_ABI_NAMESPACE_BEGIN
177 
178 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
179 {
180 public:
184  static vtkSliderWidget* New();
185 
187 
191  void PrintSelf(ostream& os, vtkIndent indent) override;
193 
200  {
201  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
202  }
203 
208  {
209  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
210  }
211 
213 
220  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
221  vtkGetMacro(AnimationMode, int);
222  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
223  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
224  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
226 
228 
232  vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
233  vtkGetMacro(NumberOfAnimationSteps, int);
235 
240 
241 protected:
243  ~vtkSliderWidget() override = default;
244 
245  // These are the events that are handled
249  void AnimateSlider(int selectionState);
250 
251  // Manage the state of the widget
254  {
255  Start = 0,
257  Animating
258  };
259 
263  {
266  Animate
267  };
268 
269 private:
270  vtkSliderWidget(const vtkSliderWidget&) = delete;
271  void operator=(const vtkSliderWidget&) = delete;
272 };
273 
274 VTK_ABI_NAMESPACE_END
275 #endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:108
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_INT_MAX
Definition: vtkType.h:144