VTK  9.3.20240328
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
122 #ifndef vtkSliderRepresentation_h
123 #define vtkSliderRepresentation_h
124 
125 #include "vtkInteractionWidgetsModule.h" // For export macro
126 #include "vtkWidgetRepresentation.h"
127 
128 VTK_ABI_NAMESPACE_BEGIN
129 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
130 {
131 public:
133 
137  void PrintSelf(ostream& os, vtkIndent indent) override;
139 
141 
145  void SetValue(double value);
146  vtkGetMacro(Value, double);
148 
150 
155  void SetMinimumValue(double value);
156  vtkGetMacro(MinimumValue, double);
158 
160 
165  void SetMaximumValue(double value);
166  vtkGetMacro(MaximumValue, double);
168 
170 
174  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
175  vtkGetMacro(SliderLength, double);
177 
179 
184  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
185  vtkGetMacro(SliderWidth, double);
187 
189 
193  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
194  vtkGetMacro(TubeWidth, double);
196 
198 
203  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
204  vtkGetMacro(EndCapLength, double);
206 
208 
212  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
213  vtkGetMacro(EndCapWidth, double);
215 
220  virtual void SetTitleText(const char*) {}
221  virtual const char* GetTitleText() { return nullptr; }
222 
224 
227  vtkSetStringMacro(LabelFormat);
228  vtkGetStringMacro(LabelFormat);
230 
232 
236  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
237  vtkGetMacro(LabelHeight, double);
239 
241 
245  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
246  vtkGetMacro(TitleHeight, double);
248 
250 
254  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
255  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
256  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
258 
263  virtual double GetCurrentT() { return this->CurrentT; }
264  virtual double GetPickedT() { return this->PickedT; }
265 
266  // Enums are used to describe what is selected
268  {
269  Outside = 0,
273  Slider
274  };
275 
276 protected:
279 
280  // Values
281  double Value;
282  double MinimumValue;
283  double MaximumValue;
284 
285  // More ivars controlling the appearance of the widget
286  double SliderLength;
287  double SliderWidth;
288  double EndCapLength;
289  double EndCapWidth;
290  double TubeWidth;
291 
292  // The current parametric coordinate
293  double CurrentT;
294  double PickedT;
295 
296  // both the title and label
298  char* LabelFormat;
299  double LabelHeight;
300  double TitleHeight;
301 
302 private:
304  void operator=(const vtkSliderRepresentation&) = delete;
305 };
306 
307 VTK_ABI_NAMESPACE_END
308 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
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.
void SetMinimumValue(double value)
Set the current minimum value that the slider can take.
virtual const char * GetTitleText()
~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
@ value
Definition: vtkX3D.h:220
int vtkTypeBool
Definition: vtkABI.h:64