VTK  9.3.0
vtkSliderRepresentation.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
29#ifndef vtkSliderRepresentation_h
30#define vtkSliderRepresentation_h
31
32#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
33#include "vtkInteractionWidgetsModule.h" // For export macro
34#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
36
37VTK_ABI_NAMESPACE_BEGIN
38class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
39{
40public:
42
46 void PrintSelf(ostream& os, vtkIndent indent) override;
48
50
54 void SetValue(double value);
55 vtkGetMacro(Value, double);
57
59
64 void SetMinimumValue(double value);
65 vtkGetMacro(MinimumValue, double);
67
69
74 void SetMaximumValue(double value);
75 vtkGetMacro(MaximumValue, double);
77
79
83 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
84 vtkGetMacro(SliderLength, double);
86
88
93 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
94 vtkGetMacro(SliderWidth, double);
96
98
102 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
103 vtkGetMacro(TubeWidth, double);
105
107
112 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
113 vtkGetMacro(EndCapLength, double);
115
117
121 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
122 vtkGetMacro(EndCapWidth, double);
124
129 virtual void SetTitleText(const char*) {}
130 virtual const char* GetTitleText() { return nullptr; }
131
133
136 vtkSetStringMacro(LabelFormat);
137 vtkGetStringMacro(LabelFormat);
139
141
145 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
146 vtkGetMacro(LabelHeight, double);
148
150
154 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
155 vtkGetMacro(TitleHeight, double);
157
159
163 vtkSetMacro(ShowSliderLabel, vtkTypeBool);
164 vtkGetMacro(ShowSliderLabel, vtkTypeBool);
165 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
167
172 virtual double GetCurrentT() { return this->CurrentT; }
173 virtual double GetPickedT() { return this->PickedT; }
174
175 // Enums are used to describe what is selected
177 {
178 Outside = 0,
182 Slider
183 };
184#if !defined(VTK_LEGACY_REMOVE)
185 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
187#endif
188
189protected:
192
193 // Values
194 double Value;
197
198 // More ivars controlling the appearance of the widget
203 double TubeWidth;
204
205 // The current parametric coordinate
206 double CurrentT;
207 double PickedT;
208
209 // both the title and label
214
215private:
217 void operator=(const vtkSliderRepresentation&) = delete;
218};
219
220VTK_ABI_NAMESPACE_END
221#endif
a simple class to control print indentation
Definition vtkIndent.h:38
abstract class defines the representation for a vtkSliderWidget
virtual void SetTitleText(const char *)
Specify the label text for this widget.
void SetValue(double value)
Specify the current value for the widget.
virtual double GetCurrentT()
Methods to interface with the vtkSliderWidget.
virtual const char * GetTitleText()
void SetMinimumValue(double value)
Set the current minimum value that the slider can take.
~vtkSliderRepresentation() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
void SetMaximumValue(double value)
Set the current maximum value that the slider can take.
abstract class defines interface between the widget and widget representation classes
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_2_0(reason)