VTK  9.2.6
vtkCenteredSliderWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCenteredSliderWidget.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 =========================================================================*/
77 #ifndef vtkCenteredSliderWidget_h
78 #define vtkCenteredSliderWidget_h
79 
80 #include "vtkAbstractWidget.h"
81 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
82 #include "vtkInteractionWidgetsModule.h" // For export macro
83 
85 
86 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderWidget : public vtkAbstractWidget
87 {
88 public:
92  static vtkCenteredSliderWidget* New();
93 
95 
99  void PrintSelf(ostream& os, vtkIndent indent) override;
101 
108  {
109  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
110  }
111 
116  {
117  return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
118  }
119 
123  void CreateDefaultRepresentation() override;
124 
128  double GetValue() { return this->Value; }
129 
130 protected:
132  ~vtkCenteredSliderWidget() override = default;
133 
134  // These are the events that are handled
135  static void SelectAction(vtkAbstractWidget*);
136  static void EndSelectAction(vtkAbstractWidget*);
137  static void MoveAction(vtkAbstractWidget*);
138  static void TimerAction(vtkAbstractWidget*);
139 
140  // Manage the state of the widget
143  {
144  Start = 0,
145  Sliding
146  };
147 #if !defined(VTK_LEGACY_REMOVE)
148  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
150 #endif
151 
152  int TimerId;
154  double StartTime;
155  double Value;
156 
157 private:
159  void operator=(const vtkCenteredSliderWidget&) = delete;
160 };
161 
162 #endif
#define VTK_DEPRECATED_IN_9_2_0(reason)
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:39
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
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...