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 =========================================================================*/
72 #ifndef vtkSliderWidget_h
73 #define vtkSliderWidget_h
74 
75 #include "vtkAbstractWidget.h"
76 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
77 #include "vtkInteractionWidgetsModule.h" // For export macro
78 
80 
81 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
82 {
83 public:
87  static vtkSliderWidget* New();
88 
90 
94  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
103  {
104  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
105  }
106 
111  {
112  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
113  }
114 
116 
123  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
124  vtkGetMacro(AnimationMode, int);
125  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
126  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
127  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
129 
131 
135  vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
136  vtkGetMacro(NumberOfAnimationSteps, int);
138 
142  void CreateDefaultRepresentation() override;
143 
144 protected:
145  vtkSliderWidget();
146  ~vtkSliderWidget() override = default;
147 
148  // These are the events that are handled
149  static void SelectAction(vtkAbstractWidget*);
150  static void EndSelectAction(vtkAbstractWidget*);
151  static void MoveAction(vtkAbstractWidget*);
152  void AnimateSlider(int selectionState);
153 
154  // Manage the state of the widget
157  {
158  Start = 0,
160  Animating
161  };
162 #if !defined(VTK_LEGACY_REMOVE)
163  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
165 #endif
166 
170  {
173  Animate
174  };
175 
176 private:
177  vtkSliderWidget(const vtkSliderWidget&) = delete;
178  void operator=(const vtkSliderWidget&) = delete;
179 };
180 
181 #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:155
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:39
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...