VTK  9.1.0
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=========================================================================*/
181#ifndef vtkSliderWidget_h
182#define vtkSliderWidget_h
183
184#include "vtkAbstractWidget.h"
185#include "vtkInteractionWidgetsModule.h" // For export macro
186
188
189class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
190{
191public:
196
198
202 void PrintSelf(ostream& os, vtkIndent indent) override;
204
211 {
212 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
213 }
214
219 {
220 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
221 }
222
224
231 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
232 vtkGetMacro(AnimationMode, int);
233 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
234 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
235 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
237
239
243 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
244 vtkGetMacro(NumberOfAnimationSteps, int);
246
251
252protected:
254 ~vtkSliderWidget() override = default;
255
256 // These are the events that are handled
260 void AnimateSlider(int selectionState);
261
262 // Manage the state of the widget
265 {
266 Start = 0,
268 Animating
269 };
270
274 {
277 Animate
278 };
279
280private:
281 vtkSliderWidget(const vtkSliderWidget&) = delete;
282 void operator=(const vtkSliderWidget&) = delete;
283};
284
285#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract class defines the representation for a vtkSliderWidget
set a value by manipulating a slider
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.
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
~vtkSliderWidget() override=default
static void SelectAction(vtkAbstractWidget *)
static void EndSelectAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static vtkSliderWidget * New()
Instantiate the class.
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:155