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 =========================================================================*/
35 #ifndef vtkSliderRepresentation_h
36 #define vtkSliderRepresentation_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
40 
41 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
42 {
43 public:
45 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
57  void SetValue(double value);
58  vtkGetMacro(Value, double);
60 
62 
67  void SetMinimumValue(double value);
68  vtkGetMacro(MinimumValue, double);
70 
72 
77  void SetMaximumValue(double value);
78  vtkGetMacro(MaximumValue, double);
80 
82 
86  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
87  vtkGetMacro(SliderLength, double);
89 
91 
96  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
97  vtkGetMacro(SliderWidth, double);
99 
101 
105  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
106  vtkGetMacro(TubeWidth, double);
108 
110 
115  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
116  vtkGetMacro(EndCapLength, double);
118 
120 
124  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
125  vtkGetMacro(EndCapWidth, double);
127 
132  virtual void SetTitleText(const char*) {}
133  virtual const char* GetTitleText() { return nullptr; }
134 
136 
139  vtkSetStringMacro(LabelFormat);
140  vtkGetStringMacro(LabelFormat);
142 
144 
148  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
149  vtkGetMacro(LabelHeight, double);
151 
153 
157  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
158  vtkGetMacro(TitleHeight, double);
160 
162 
166  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
167  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
168  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
170 
175  virtual double GetCurrentT() { return this->CurrentT; }
176  virtual double GetPickedT() { return this->PickedT; }
177 
178  // Enums are used to describe what is selected
180  {
181  Outside = 0,
185  Slider
186  };
187 
188 protected:
191 
192  // Values
193  double Value;
194  double MinimumValue;
195  double MaximumValue;
196 
197  // More ivars controlling the appearance of the widget
198  double SliderLength;
199  double SliderWidth;
200  double EndCapLength;
201  double EndCapWidth;
202  double TubeWidth;
203 
204  // The current parametric coordinate
205  double CurrentT;
206  double PickedT;
207 
208  // both the title and label
210  char* LabelFormat;
211  double LabelHeight;
212  double TitleHeight;
213 
214 private:
216  void operator=(const vtkSliderRepresentation&) = delete;
217 };
218 
219 #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
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