VTK  9.2.20230606
vtkSliderRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSliderRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
54 #ifndef vtkSliderRepresentation_h
55 #define vtkSliderRepresentation_h
56 
57 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
58 #include "vtkInteractionWidgetsModule.h" // For export macro
59 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
61 
62 VTK_ABI_NAMESPACE_BEGIN
63 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
64 {
65 public:
67 
71  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
79  void SetValue(double value);
80  vtkGetMacro(Value, double);
82 
84 
89  void SetMinimumValue(double value);
90  vtkGetMacro(MinimumValue, double);
92 
94 
99  void SetMaximumValue(double value);
100  vtkGetMacro(MaximumValue, double);
102 
104 
108  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
109  vtkGetMacro(SliderLength, double);
111 
113 
118  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
119  vtkGetMacro(SliderWidth, double);
121 
123 
127  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
128  vtkGetMacro(TubeWidth, double);
130 
132 
137  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
138  vtkGetMacro(EndCapLength, double);
140 
142 
146  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
147  vtkGetMacro(EndCapWidth, double);
149 
154  virtual void SetTitleText(const char*) {}
155  virtual const char* GetTitleText() { return nullptr; }
156 
158 
161  vtkSetStringMacro(LabelFormat);
162  vtkGetStringMacro(LabelFormat);
164 
166 
170  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
171  vtkGetMacro(LabelHeight, double);
173 
175 
179  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
180  vtkGetMacro(TitleHeight, double);
182 
184 
188  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
189  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
190  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
192 
197  virtual double GetCurrentT() { return this->CurrentT; }
198  virtual double GetPickedT() { return this->PickedT; }
199 
200  // Enums are used to describe what is selected
202  {
203  Outside = 0,
207  Slider
208  };
209 #if !defined(VTK_LEGACY_REMOVE)
210  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
212 #endif
213 
214 protected:
217 
218  // Values
219  double Value;
220  double MinimumValue;
221  double MaximumValue;
222 
223  // More ivars controlling the appearance of the widget
224  double SliderLength;
225  double SliderWidth;
226  double EndCapLength;
227  double EndCapWidth;
228  double TubeWidth;
229 
230  // The current parametric coordinate
231  double CurrentT;
232  double PickedT;
233 
234  // both the title and label
236  char* LabelFormat;
237  double LabelHeight;
238  double TitleHeight;
239 
240 private:
242  void operator=(const vtkSliderRepresentation&) = delete;
243 };
244 
245 VTK_ABI_NAMESPACE_END
246 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
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:232
int vtkTypeBool
Definition: vtkABI.h:71
#define VTK_DEPRECATED_IN_9_2_0(reason)