VTK  9.0.1
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 =========================================================================*/
66 #ifndef vtkSliderWidget_h
67 #define vtkSliderWidget_h
68 
69 #include "vtkAbstractWidget.h"
70 #include "vtkInteractionWidgetsModule.h" // For export macro
71 
73 
74 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
75 {
76 public:
80  static vtkSliderWidget* New();
81 
83 
87  void PrintSelf(ostream& os, vtkIndent indent) override;
89 
96  {
97  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
98  }
99 
104  {
105  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
106  }
107 
109 
116  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
117  vtkGetMacro(AnimationMode, int);
118  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
119  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
120  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
122 
124 
128  vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
129  vtkGetMacro(NumberOfAnimationSteps, int);
131 
135  void CreateDefaultRepresentation() override;
136 
137 protected:
138  vtkSliderWidget();
139  ~vtkSliderWidget() override {}
140 
141  // These are the events that are handled
142  static void SelectAction(vtkAbstractWidget*);
143  static void EndSelectAction(vtkAbstractWidget*);
144  static void MoveAction(vtkAbstractWidget*);
145  void AnimateSlider(int selectionState);
146 
147  // Manage the state of the widget
150  {
151  Start = 0,
153  Animating
154  };
155 
159  {
162  Animate
163  };
164 
165 private:
166  vtkSliderWidget(const vtkSliderWidget&) = delete;
167  void operator=(const vtkSliderWidget&) = delete;
168 };
169 
170 #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: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:33
void SetAnimationModeToAnimate()
Control the behavior of the slider when selecting the tube or caps.
~vtkSliderWidget() override
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...