VTK  9.4.20250102
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
169#ifndef vtkSliderWidget_h
170#define vtkSliderWidget_h
171
172#include "vtkAbstractWidget.h"
173#include "vtkInteractionWidgetsModule.h" // For export macro
174#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
175
176VTK_ABI_NAMESPACE_BEGIN
178
179class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSliderWidget : public vtkAbstractWidget
180{
181public:
186
188
192 void PrintSelf(ostream& os, vtkIndent indent) override;
194
201 {
202 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
203 }
204
209 {
210 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
211 }
212
214
221 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
222 vtkGetMacro(AnimationMode, int);
223 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
224 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
225 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
227
229
233 vtkSetClampMacro(NumberOfAnimationSteps, int, 1, VTK_INT_MAX);
234 vtkGetMacro(NumberOfAnimationSteps, int);
236
241
242protected:
244 ~vtkSliderWidget() override = default;
245
246 // These are the events that are handled
250 void AnimateSlider(int selectionState);
251
252 // Manage the state of the widget
255 {
256 Start = 0,
258 Animating
259 };
260
264 {
267 Animate
268 };
269
270private:
271 vtkSliderWidget(const vtkSliderWidget&) = delete;
272 void operator=(const vtkSliderWidget&) = delete;
273};
274
275VTK_ABI_NAMESPACE_END
276#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition vtkIndent.h:108
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:144
#define VTK_MARSHALAUTO