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=========================================================================*/
54#ifndef vtkSliderRepresentation_h
55#define vtkSliderRepresentation_h
56
57#include "vtkInteractionWidgetsModule.h" // For export macro
59
60class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
61{
62public:
64
68 void PrintSelf(ostream& os, vtkIndent indent) override;
70
72
76 void SetValue(double value);
77 vtkGetMacro(Value, double);
79
81
86 void SetMinimumValue(double value);
87 vtkGetMacro(MinimumValue, double);
89
91
96 void SetMaximumValue(double value);
97 vtkGetMacro(MaximumValue, double);
99
101
105 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
106 vtkGetMacro(SliderLength, double);
108
110
115 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
116 vtkGetMacro(SliderWidth, double);
118
120
124 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
125 vtkGetMacro(TubeWidth, double);
127
129
134 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
135 vtkGetMacro(EndCapLength, double);
137
139
143 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
144 vtkGetMacro(EndCapWidth, double);
146
151 virtual void SetTitleText(const char*) {}
152 virtual const char* GetTitleText() { return nullptr; }
153
155
158 vtkSetStringMacro(LabelFormat);
159 vtkGetStringMacro(LabelFormat);
161
163
167 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
168 vtkGetMacro(LabelHeight, double);
170
172
176 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
177 vtkGetMacro(TitleHeight, double);
179
181
185 vtkSetMacro(ShowSliderLabel, vtkTypeBool);
186 vtkGetMacro(ShowSliderLabel, vtkTypeBool);
187 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
189
194 virtual double GetCurrentT() { return this->CurrentT; }
195 virtual double GetPickedT() { return this->PickedT; }
196
197 // Enums are used to describe what is selected
199 {
200 Outside = 0,
204 Slider
205 };
206
207protected:
210
211 // Values
212 double Value;
215
216 // More ivars controlling the appearance of the widget
221 double TubeWidth;
222
223 // The current parametric coordinate
224 double CurrentT;
225 double PickedT;
226
227 // both the title and label
232
233private:
235 void operator=(const vtkSliderRepresentation&) = delete;
236};
237
238#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
int vtkTypeBool
Definition: vtkABI.h:69