VTK  9.4.20251203
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 "vtkInteractionWidgetsModule.h" // For export macro
28#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
29
30VTK_ABI_NAMESPACE_BEGIN
31class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSliderRepresentation
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
179protected:
182
183 // Values
184 double Value;
187
188 // More ivars controlling the appearance of the widget
193 double TubeWidth;
194
195 // The current parametric coordinate
196 double CurrentT;
197 double PickedT;
198
199 // both the title and label
204
205private:
207 void operator=(const vtkSliderRepresentation&) = delete;
208};
209
210VTK_ABI_NAMESPACE_END
211#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_MARSHALAUTO