VTK  9.5.20251126
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
121
122#ifndef vtkSliderRepresentation_h
123#define vtkSliderRepresentation_h
124
125#include "vtkInteractionWidgetsModule.h" // For export macro
127#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
128
129VTK_ABI_NAMESPACE_BEGIN
130class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkSliderRepresentation
132{
133public:
135
139 void PrintSelf(ostream& os, vtkIndent indent) override;
141
143
147 void SetValue(double value);
148 vtkGetMacro(Value, double);
150
152
157 void SetMinimumValue(double value);
158 vtkGetMacro(MinimumValue, double);
160
162
167 void SetMaximumValue(double value);
168 vtkGetMacro(MaximumValue, double);
170
172
176 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
177 vtkGetMacro(SliderLength, double);
179
181
186 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
187 vtkGetMacro(SliderWidth, double);
189
191
195 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
196 vtkGetMacro(TubeWidth, double);
198
200
205 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
206 vtkGetMacro(EndCapLength, double);
208
210
214 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
215 vtkGetMacro(EndCapWidth, double);
217
222 virtual void SetTitleText(const char*) {}
223 virtual const char* GetTitleText() { return nullptr; }
224
226
229 void SetLabelFormat(const char* format);
230 vtkGetStringMacro(LabelFormat);
232
234
238 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
239 vtkGetMacro(LabelHeight, double);
241
243
247 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
248 vtkGetMacro(TitleHeight, double);
250
252
258 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
260
265 virtual double GetCurrentT() { return this->CurrentT; }
266 virtual double GetPickedT() { return this->PickedT; }
267
268 // Enums are used to describe what is selected
277
278protected:
281
282 // Values
283 double Value;
286
287 // More ivars controlling the appearance of the widget
292 double TubeWidth;
293
294 // The current parametric coordinate
295 double CurrentT;
296 double PickedT;
297
298 // both the title and label
303
304private:
306 void operator=(const vtkSliderRepresentation&) = delete;
307};
308
309VTK_ABI_NAMESPACE_END
310#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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 SetLabelFormat(const char *format)
Set/Get the std::format style format with which to print the slider value.
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.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO