VTK  9.7.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 "vtkInteractionWidgetsModule.h" // For export macro
65 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
66 
67 VTK_ABI_NAMESPACE_BEGIN
69 
70 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSliderWidget : public vtkAbstractWidget
71 {
72 public:
76  static vtkSliderWidget* New();
77 
79 
83  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
92  {
93  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
94  }
95 
100  {
101  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
102  }
103 
105 
112  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
113  vtkGetMacro(AnimationMode, int);
114  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
115  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
116  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
118 
120 
124  vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
125  vtkGetMacro(NumberOfAnimationSteps, int);
127 
131  void CreateDefaultRepresentation() override;
132 
133 protected:
134  vtkSliderWidget();
135  ~vtkSliderWidget() override = default;
136 
137  // These are the events that are handled
138  static void SelectAction(vtkAbstractWidget*);
139  static void EndSelectAction(vtkAbstractWidget*);
140  static void MoveAction(vtkAbstractWidget*);
141  void AnimateSlider(int selectionState);
142 
143  // Manage the state of the widget
146  {
147  Start = 0,
149  Animating
150  };
151 
155  {
158  Animate
159  };
160 
161 private:
162  vtkSliderWidget(const vtkSliderWidget&) = delete;
163  void operator=(const vtkSliderWidget&) = delete;
164 };
165 
166 VTK_ABI_NAMESPACE_END
167 #endif
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
#define VTK_INT_MAX
Definition: vtkType.h:192
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
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...