VTK  9.3.1
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 
31 VTK_ABI_NAMESPACE_BEGIN
32 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
33 {
34 public:
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 
183 protected:
185  ~vtkSliderRepresentation() override;
186 
187  // Values
188  double Value;
189  double MinimumValue;
190  double MaximumValue;
191 
192  // More ivars controlling the appearance of the widget
193  double SliderLength;
194  double SliderWidth;
195  double EndCapLength;
196  double EndCapWidth;
197  double TubeWidth;
198 
199  // The current parametric coordinate
200  double CurrentT;
201  double PickedT;
202 
203  // both the title and label
205  char* LabelFormat;
206  double LabelHeight;
207  double TitleHeight;
208 
209 private:
211  void operator=(const vtkSliderRepresentation&) = delete;
212 };
213 
214 VTK_ABI_NAMESPACE_END
215 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
#define VTK_DEPRECATED_IN_9_2_0(reason)
virtual double GetCurrentT()
Methods to interface with the vtkSliderWidget.
virtual void SetTitleText(const char *)
Specify the label text for this widget.
abstract class defines interface between the widget and widget representation classes ...
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract class defines the representation for a vtkSliderWidget
virtual const char * GetTitleText()