VTK  9.0.1
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 =========================================================================*/
38 #ifndef vtkSliderRepresentation_h
39 #define vtkSliderRepresentation_h
40 
41 #include "vtkInteractionWidgetsModule.h" // For export macro
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
45 {
46 public:
48 
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
60  void SetValue(double value);
61  vtkGetMacro(Value, double);
63 
65 
70  void SetMinimumValue(double value);
71  vtkGetMacro(MinimumValue, double);
73 
75 
80  void SetMaximumValue(double value);
81  vtkGetMacro(MaximumValue, double);
83 
85 
89  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
90  vtkGetMacro(SliderLength, double);
92 
94 
99  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
100  vtkGetMacro(SliderWidth, double);
102 
104 
108  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
109  vtkGetMacro(TubeWidth, double);
111 
113 
118  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
119  vtkGetMacro(EndCapLength, double);
121 
123 
127  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
128  vtkGetMacro(EndCapWidth, double);
130 
135  virtual void SetTitleText(const char*) {}
136  virtual const char* GetTitleText() { return nullptr; }
137 
139 
142  vtkSetStringMacro(LabelFormat);
143  vtkGetStringMacro(LabelFormat);
145 
147 
151  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
152  vtkGetMacro(LabelHeight, double);
154 
156 
160  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
161  vtkGetMacro(TitleHeight, double);
163 
165 
169  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
170  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
171  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
173 
178  virtual double GetCurrentT() { return this->CurrentT; }
179  virtual double GetPickedT() { return this->PickedT; }
180 
181  // Enums are used to describe what is selected
183  {
184  Outside = 0,
188  Slider
189  };
190 
191 protected:
194 
195  // Values
196  double Value;
197  double MinimumValue;
198  double MaximumValue;
199 
200  // More ivars controlling the appearance of the widget
201  double SliderLength;
202  double SliderWidth;
203  double EndCapLength;
204  double EndCapWidth;
205  double TubeWidth;
206 
207  // The current parametric coordinate
208  double CurrentT;
209  double PickedT;
210 
211  // both the title and label
213  char* LabelFormat;
214  double LabelHeight;
215  double TitleHeight;
216 
217 private:
219  void operator=(const vtkSliderRepresentation&) = delete;
220 };
221 
222 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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
Methods invoked by print to print information about the object including superclasses.
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