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
23#ifndef vtkSliderRepresentation_h
24#define vtkSliderRepresentation_h
25
26#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
27#include "vtkInteractionWidgetsModule.h" // For export macro
28#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
30
31VTK_ABI_NAMESPACE_BEGIN
32class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
33{
34public:
36
40 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
48 void SetValue(double value);
49 vtkGetMacro(Value, double);
51
53
58 void SetMinimumValue(double value);
59 vtkGetMacro(MinimumValue, double);
61
63
68 void SetMaximumValue(double value);
69 vtkGetMacro(MaximumValue, double);
71
73
77 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
78 vtkGetMacro(SliderLength, double);
80
82
87 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
88 vtkGetMacro(SliderWidth, double);
90
92
96 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
97 vtkGetMacro(TubeWidth, double);
99
101
106 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
107 vtkGetMacro(EndCapLength, double);
109
111
115 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
116 vtkGetMacro(EndCapWidth, double);
118
123 virtual void SetTitleText(const char*) {}
124 virtual const char* GetTitleText() { return nullptr; }
125
127
130 vtkSetStringMacro(LabelFormat);
131 vtkGetStringMacro(LabelFormat);
133
135
139 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
140 vtkGetMacro(LabelHeight, double);
142
144
148 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
149 vtkGetMacro(TitleHeight, double);
151
153
157 vtkSetMacro(ShowSliderLabel, vtkTypeBool);
158 vtkGetMacro(ShowSliderLabel, vtkTypeBool);
159 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
161
166 virtual double GetCurrentT() { return this->CurrentT; }
167 virtual double GetPickedT() { return this->PickedT; }
168
169 // Enums are used to describe what is selected
171 {
172 Outside = 0,
176 Slider
177 };
178#if !defined(VTK_LEGACY_REMOVE)
179 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
181#endif
182
183protected:
186
187 // Values
188 double Value;
191
192 // More ivars controlling the appearance of the widget
197 double TubeWidth;
198
199 // The current parametric coordinate
200 double CurrentT;
201 double PickedT;
202
203 // both the title and label
208
209private:
211 void operator=(const vtkSliderRepresentation&) = delete;
212};
213
214VTK_ABI_NAMESPACE_END
215#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)