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
32 #ifndef vtkSliderRepresentation_h
33 #define vtkSliderRepresentation_h
34 
35 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
36 #include "vtkInteractionWidgetsModule.h" // For export macro
37 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
39 
40 VTK_ABI_NAMESPACE_BEGIN
41 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
42 {
43 public:
45 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
57  void SetValue(double value);
58  vtkGetMacro(Value, double);
60 
62 
67  void SetMinimumValue(double value);
68  vtkGetMacro(MinimumValue, double);
70 
72 
77  void SetMaximumValue(double value);
78  vtkGetMacro(MaximumValue, double);
80 
82 
86  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
87  vtkGetMacro(SliderLength, double);
89 
91 
96  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
97  vtkGetMacro(SliderWidth, double);
99 
101 
105  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
106  vtkGetMacro(TubeWidth, double);
108 
110 
115  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
116  vtkGetMacro(EndCapLength, double);
118 
120 
124  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
125  vtkGetMacro(EndCapWidth, double);
127 
132  virtual void SetTitleText(const char*) {}
133  virtual const char* GetTitleText() { return nullptr; }
134 
136 
139  vtkSetStringMacro(LabelFormat);
140  vtkGetStringMacro(LabelFormat);
142 
144 
148  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
149  vtkGetMacro(LabelHeight, double);
151 
153 
157  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
158  vtkGetMacro(TitleHeight, double);
160 
162 
166  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
167  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
168  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
170 
175  virtual double GetCurrentT() { return this->CurrentT; }
176  virtual double GetPickedT() { return this->PickedT; }
177 
178  // Enums are used to describe what is selected
180  {
181  Outside = 0,
185  Slider
186  };
187 #if !defined(VTK_LEGACY_REMOVE)
188  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
190 #endif
191 
192 protected:
195 
196  // Values
197  double Value;
198  double MinimumValue;
199  double MaximumValue;
200 
201  // More ivars controlling the appearance of the widget
202  double SliderLength;
203  double SliderWidth;
204  double EndCapLength;
205  double EndCapWidth;
206  double TubeWidth;
207 
208  // The current parametric coordinate
209  double CurrentT;
210  double PickedT;
211 
212  // both the title and label
214  char* LabelFormat;
215  double LabelHeight;
216  double TitleHeight;
217 
218 private:
220  void operator=(const vtkSliderRepresentation&) = delete;
221 };
222 
223 VTK_ABI_NAMESPACE_END
224 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
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
#define VTK_DEPRECATED_IN_9_2_0(reason)