VTK  9.2.6
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 =========================================================================*/
44 #ifndef vtkSliderRepresentation_h
45 #define vtkSliderRepresentation_h
46 
47 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
48 #include "vtkInteractionWidgetsModule.h" // For export macro
50 
51 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
52 {
53 public:
55 
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
67  void SetValue(double value);
68  vtkGetMacro(Value, double);
70 
72 
77  void SetMinimumValue(double value);
78  vtkGetMacro(MinimumValue, double);
80 
82 
87  void SetMaximumValue(double value);
88  vtkGetMacro(MaximumValue, double);
90 
92 
96  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
97  vtkGetMacro(SliderLength, double);
99 
101 
106  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
107  vtkGetMacro(SliderWidth, double);
109 
111 
115  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
116  vtkGetMacro(TubeWidth, double);
118 
120 
125  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
126  vtkGetMacro(EndCapLength, double);
128 
130 
134  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
135  vtkGetMacro(EndCapWidth, double);
137 
142  virtual void SetTitleText(const char*) {}
143  virtual const char* GetTitleText() { return nullptr; }
144 
146 
149  vtkSetStringMacro(LabelFormat);
150  vtkGetStringMacro(LabelFormat);
152 
154 
158  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
159  vtkGetMacro(LabelHeight, double);
161 
163 
167  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
168  vtkGetMacro(TitleHeight, double);
170 
172 
176  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
177  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
178  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
180 
185  virtual double GetCurrentT() { return this->CurrentT; }
186  virtual double GetPickedT() { return this->PickedT; }
187 
188  // Enums are used to describe what is selected
190  {
191  Outside = 0,
195  Slider
196  };
197 #if !defined(VTK_LEGACY_REMOVE)
198  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
200 #endif
201 
202 protected:
205 
206  // Values
207  double Value;
208  double MinimumValue;
209  double MaximumValue;
210 
211  // More ivars controlling the appearance of the widget
212  double SliderLength;
213  double SliderWidth;
214  double EndCapLength;
215  double EndCapWidth;
216  double TubeWidth;
217 
218  // The current parametric coordinate
219  double CurrentT;
220  double PickedT;
221 
222  // both the title and label
224  char* LabelFormat;
225  double LabelHeight;
226  double TitleHeight;
227 
228 private:
230  void operator=(const vtkSliderRepresentation&) = delete;
231 };
232 
233 #endif
a simple class to control print indentation
Definition: vtkIndent.h:49
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:226
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)