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=========================================================================*/
178#ifndef vtkSliderWidget_h
179#define vtkSliderWidget_h
180
181#include "vtkAbstractWidget.h"
182#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
183#include "vtkInteractionWidgetsModule.h" // For export macro
184
186
187class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
188{
189public:
194
196
200 void PrintSelf(ostream& os, vtkIndent indent) override;
202
209 {
210 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
211 }
212
217 {
218 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
219 }
220
222
229 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
230 vtkGetMacro(AnimationMode, int);
231 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
232 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
233 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
235
237
241 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
242 vtkGetMacro(NumberOfAnimationSteps, int);
244
249
250protected:
252 ~vtkSliderWidget() override = default;
253
254 // These are the events that are handled
258 void AnimateSlider(int selectionState);
259
260 // Manage the state of the widget
263 {
264 Start = 0,
266 Animating
267 };
268#if !defined(VTK_LEGACY_REMOVE)
269 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
271#endif
272
276 {
279 Animate
280 };
281
282private:
283 vtkSliderWidget(const vtkSliderWidget&) = delete;
284 void operator=(const vtkSliderWidget&) = delete;
285};
286
287#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:119
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_DEPRECATED_IN_9_2_0(reason)
#define VTK_INT_MAX
Definition: vtkType.h:155