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=========================================================================*/
44#ifndef vtkSliderRepresentation_h
45#define vtkSliderRepresentation_h
46
47#include "vtkInteractionWidgetsModule.h" // For export macro
49
50class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
51{
52public:
54
58 void PrintSelf(ostream& os, vtkIndent indent) override;
60
62
66 void SetValue(double value);
67 vtkGetMacro(Value, double);
69
71
76 void SetMinimumValue(double value);
77 vtkGetMacro(MinimumValue, double);
79
81
86 void SetMaximumValue(double value);
87 vtkGetMacro(MaximumValue, double);
89
91
95 vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
96 vtkGetMacro(SliderLength, double);
98
100
105 vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
106 vtkGetMacro(SliderWidth, double);
108
110
114 vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
115 vtkGetMacro(TubeWidth, double);
117
119
124 vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
125 vtkGetMacro(EndCapLength, double);
127
129
133 vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
134 vtkGetMacro(EndCapWidth, double);
136
141 virtual void SetTitleText(const char*) {}
142 virtual const char* GetTitleText() { return nullptr; }
143
145
148 vtkSetStringMacro(LabelFormat);
149 vtkGetStringMacro(LabelFormat);
151
153
157 vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
158 vtkGetMacro(LabelHeight, double);
160
162
166 vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
167 vtkGetMacro(TitleHeight, double);
169
171
175 vtkSetMacro(ShowSliderLabel, vtkTypeBool);
176 vtkGetMacro(ShowSliderLabel, vtkTypeBool);
177 vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
179
184 virtual double GetCurrentT() { return this->CurrentT; }
185 virtual double GetPickedT() { return this->PickedT; }
186
187 // Enums are used to describe what is selected
189 {
190 Outside = 0,
194 Slider
195 };
196
197protected:
200
201 // Values
202 double Value;
205
206 // More ivars controlling the appearance of the widget
211 double TubeWidth;
212
213 // The current parametric coordinate
214 double CurrentT;
215 double PickedT;
216
217 // both the title and label
222
223private:
225 void operator=(const vtkSliderRepresentation&) = delete;
226};
227
228#endif
a simple class to control print indentation
Definition: vtkIndent.h:43
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