VTK  9.1.0
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=========================================================================*/
48#ifndef vtkSliderRepresentation_h
49#define vtkSliderRepresentation_h
50
51#include "vtkInteractionWidgetsModule.h" // For export macro
53
54class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
55{
56public:
58
62 void PrintSelf(ostream& os, vtkIndent indent) override;
64
66
70 void SetValue(double value);
71 vtkGetMacro(Value, double);
73
75
80 void SetMinimumValue(double value);
81 vtkGetMacro(MinimumValue, double);
83
85
90 void SetMaximumValue(double value);
91 vtkGetMacro(MaximumValue, double);
93
95
99 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
100 vtkGetMacro(SliderLength, double);
102
104
109 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
110 vtkGetMacro(SliderWidth, double);
112
114
118 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
119 vtkGetMacro(TubeWidth, double);
121
123
128 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
129 vtkGetMacro(EndCapLength, double);
131
133
137 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
138 vtkGetMacro(EndCapWidth, double);
140
145 virtual void SetTitleText(const char*) {}
146 virtual const char* GetTitleText() { return nullptr; }
147
149
152 vtkSetStringMacro(LabelFormat);
153 vtkGetStringMacro(LabelFormat);
155
157
161 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
162 vtkGetMacro(LabelHeight, double);
164
166
170 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
171 vtkGetMacro(TitleHeight, double);
173
175
179 vtkSetMacro(ShowSliderLabel, vtkTypeBool);
180 vtkGetMacro(ShowSliderLabel, vtkTypeBool);
181 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
183
188 virtual double GetCurrentT() { return this->CurrentT; }
189 virtual double GetPickedT() { return this->PickedT; }
190
191 // Enums are used to describe what is selected
193 {
194 Outside = 0,
198 Slider
199 };
200
201protected:
204
205 // Values
206 double Value;
209
210 // More ivars controlling the appearance of the widget
215 double TubeWidth;
216
217 // The current parametric coordinate
218 double CurrentT;
219 double PickedT;
220
221 // both the title and label
226
227private:
229 void operator=(const vtkSliderRepresentation&) = delete;
230};
231
232#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
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.
virtual const char * GetTitleText()
void SetMinimumValue(double value)
Set the current minimum value that the slider can take.
~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