VTK  9.0.20210928
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 
60 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
61 {
62 public:
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 
207 protected:
210 
211  // Values
212  double Value;
213  double MinimumValue;
214  double MaximumValue;
215 
216  // More ivars controlling the appearance of the widget
217  double SliderLength;
218  double SliderWidth;
219  double EndCapLength;
220  double EndCapWidth;
221  double TubeWidth;
222 
223  // The current parametric coordinate
224  double CurrentT;
225  double PickedT;
226 
227  // both the title and label
229  char* LabelFormat;
230  double LabelHeight;
231  double TitleHeight;
232 
233 private:
235  void operator=(const vtkSliderRepresentation&) = delete;
236 };
237 
238 #endif
vtkWidgetRepresentation.h
vtkSliderRepresentation::MinimumValue
double MinimumValue
Definition: vtkSliderRepresentation.h:213
vtkSliderRepresentation::ShowSliderLabel
vtkTypeBool ShowSliderLabel
Definition: vtkSliderRepresentation.h:228
vtkSliderRepresentation::GetPickedT
virtual double GetPickedT()
Definition: vtkSliderRepresentation.h:195
vtkSliderRepresentation::EndCapLength
double EndCapLength
Definition: vtkSliderRepresentation.h:219
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkSliderRepresentation::SliderLength
double SliderLength
Definition: vtkSliderRepresentation.h:217
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:60
vtkSliderRepresentation::TitleHeight
double TitleHeight
Definition: vtkSliderRepresentation.h:231
vtkSliderRepresentation::LeftCap
@ LeftCap
Definition: vtkSliderRepresentation.h:202
vtkSliderRepresentation::TubeWidth
double TubeWidth
Definition: vtkSliderRepresentation.h:221
vtkSliderRepresentation::CurrentT
double CurrentT
Definition: vtkSliderRepresentation.h:224
vtkSliderRepresentation::PickedT
double PickedT
Definition: vtkSliderRepresentation.h:225
vtkSliderRepresentation::EndCapWidth
double EndCapWidth
Definition: vtkSliderRepresentation.h:220
vtkSliderRepresentation::SetTitleText
virtual void SetTitleText(const char *)
Specify the label text for this widget.
Definition: vtkSliderRepresentation.h:151
vtkSliderRepresentation::SetValue
void SetValue(double value)
Specify the current value for the widget.
vtkSliderRepresentation::GetCurrentT
virtual double GetCurrentT()
Methods to interface with the vtkSliderWidget.
Definition: vtkSliderRepresentation.h:194
vtkSliderRepresentation::SetMinimumValue
void SetMinimumValue(double value)
Set the current minimum value that the slider can take.
vtkSliderRepresentation::LabelHeight
double LabelHeight
Definition: vtkSliderRepresentation.h:230
vtkSliderRepresentation::SliderWidth
double SliderWidth
Definition: vtkSliderRepresentation.h:218
vtkSliderRepresentation::~vtkSliderRepresentation
~vtkSliderRepresentation() override
vtkSliderRepresentation::_InteractionState
_InteractionState
Definition: vtkSliderRepresentation.h:199
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkSliderRepresentation::Value
double Value
Definition: vtkSliderRepresentation.h:212
vtkSliderRepresentation::LabelFormat
char * LabelFormat
Definition: vtkSliderRepresentation.h:229
vtkSliderRepresentation::vtkSliderRepresentation
vtkSliderRepresentation()
vtkSliderRepresentation::Tube
@ Tube
Definition: vtkSliderRepresentation.h:201
vtkSliderRepresentation::RightCap
@ RightCap
Definition: vtkSliderRepresentation.h:203
vtkSliderRepresentation::SetMaximumValue
void SetMaximumValue(double value)
Set the current maximum value that the slider can take.
vtkSliderRepresentation::GetTitleText
virtual const char * GetTitleText()
Definition: vtkSliderRepresentation.h:152
vtkSliderRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkSliderRepresentation::MaximumValue
double MaximumValue
Definition: vtkSliderRepresentation.h:214
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkSliderRepresentation
abstract class defines the representation for a vtkSliderWidget
Definition: vtkSliderRepresentation.h:61