VTK  9.1.0
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=========================================================================*/
71#ifndef vtkCenteredSliderWidget_h
72#define vtkCenteredSliderWidget_h
73
74#include "vtkAbstractWidget.h"
75#include "vtkInteractionWidgetsModule.h" // For export macro
76
78
79class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderWidget : public vtkAbstractWidget
80{
81public:
86
88
92 void PrintSelf(ostream& os, vtkIndent indent) override;
94
101 {
102 this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
103 }
104
109 {
110 return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);
111 }
112
117
121 double GetValue() { return this->Value; }
122
123protected:
125 ~vtkCenteredSliderWidget() override = default;
126
127 // These are the events that are handled
132
133 // Manage the state of the widget
136 {
137 Start = 0,
138 Sliding
139 };
140
143 double StartTime;
144 double Value;
145
146private:
148 void operator=(const vtkCenteredSliderWidget&) = delete;
149};
150
151#endif
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
set a value by manipulating a slider
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static vtkCenteredSliderWidget * New()
Instantiate the class.
void CreateDefaultRepresentation() override
Create the default widget representation if one is not set.
double GetValue()
Get the value fo this widget.
static void MoveAction(vtkAbstractWidget *)
static void TimerAction(vtkAbstractWidget *)
~vtkCenteredSliderWidget() override=default
static void EndSelectAction(vtkAbstractWidget *)
static void SelectAction(vtkAbstractWidget *)
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.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract class defines the representation for a vtkSliderWidget
abstract class defines interface between the widget and widget representation classes