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
20#ifndef vtkSliderRepresentation_h
21#define vtkSliderRepresentation_h
22
23#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
24#include "vtkInteractionWidgetsModule.h" // For export macro
25#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
27
28VTK_ABI_NAMESPACE_BEGIN
29class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
30{
31public:
33
37 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
45 void SetValue(double value);
46 vtkGetMacro(Value, double);
48
50
55 void SetMinimumValue(double value);
56 vtkGetMacro(MinimumValue, double);
58
60
65 void SetMaximumValue(double value);
66 vtkGetMacro(MaximumValue, double);
68
70
74 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
75 vtkGetMacro(SliderLength, double);
77
79
84 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
85 vtkGetMacro(SliderWidth, double);
87
89
93 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
94 vtkGetMacro(TubeWidth, double);
96
98
103 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
104 vtkGetMacro(EndCapLength, double);
106
108
112 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
113 vtkGetMacro(EndCapWidth, double);
115
120 virtual void SetTitleText(const char*) {}
121 virtual const char* GetTitleText() { return nullptr; }
122
124
127 vtkSetStringMacro(LabelFormat);
128 vtkGetStringMacro(LabelFormat);
130
132
136 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
137 vtkGetMacro(LabelHeight, double);
139
141
145 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
146 vtkGetMacro(TitleHeight, double);
148
150
154 vtkSetMacro(ShowSliderLabel, vtkTypeBool);
155 vtkGetMacro(ShowSliderLabel, vtkTypeBool);
156 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
158
163 virtual double GetCurrentT() { return this->CurrentT; }
164 virtual double GetPickedT() { return this->PickedT; }
165
166 // Enums are used to describe what is selected
168 {
169 Outside = 0,
173 Slider
174 };
175#if !defined(VTK_LEGACY_REMOVE)
176 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
178#endif
179
180protected:
183
184 // Values
185 double Value;
188
189 // More ivars controlling the appearance of the widget
194 double TubeWidth;
195
196 // The current parametric coordinate
197 double CurrentT;
198 double PickedT;
199
200 // both the title and label
205
206private:
208 void operator=(const vtkSliderRepresentation&) = delete;
209};
210
211VTK_ABI_NAMESPACE_END
212#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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)