VTK  9.7.1
vtkCenteredSliderWidget.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
65 #ifndef vtkCenteredSliderWidget_h
66 #define vtkCenteredSliderWidget_h
67 
68 #include "vtkAbstractWidget.h"
69 #include "vtkInteractionWidgetsModule.h" // For export macro
70 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
71 
72 VTK_ABI_NAMESPACE_BEGIN
74 
75 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCenteredSliderWidget
76  : public vtkAbstractWidget
77 {
78 public:
82  static vtkCenteredSliderWidget* New();
83 
85 
89  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
98  {
99  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
100  }
101 
106  {
107  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
108  }
109 
113  void CreateDefaultRepresentation() override;
114 
118  double GetValue() { return this->Value; }
119 
120 protected:
122  ~vtkCenteredSliderWidget() override = default;
123 
124  // These are the events that are handled
125  static void SelectAction(vtkAbstractWidget*);
126  static void EndSelectAction(vtkAbstractWidget*);
127  static void MoveAction(vtkAbstractWidget*);
128  static void TimerAction(vtkAbstractWidget*);
129 
130  // Manage the state of the widget
133  {
134  Start = 0,
135  Sliding
136  };
137 
138  int TimerId;
140  double StartTime;
141  double Value;
142 
143 private:
145  void operator=(const vtkCenteredSliderWidget&) = delete;
146 };
147 
148 VTK_ABI_NAMESPACE_END
149 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
double GetValue()
Get the value fo this widget.
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
abstract class defines the representation for a vtkSliderWidget
define the API for widget / widget representation
set a value by manipulating a slider
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...