VTK  9.0.20201028
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 =========================================================================*/
38 #ifndef vtkSliderRepresentation_h
39 #define vtkSliderRepresentation_h
40 
41 #include "vtkInteractionWidgetsModule.h" // For export macro
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
45 {
46 public:
48 
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
60  void SetValue(double value);
61  vtkGetMacro(Value, double);
63 
65 
70  void SetMinimumValue(double value);
71  vtkGetMacro(MinimumValue, double);
73 
75 
80  void SetMaximumValue(double value);
81  vtkGetMacro(MaximumValue, double);
83 
85 
89  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
90  vtkGetMacro(SliderLength, double);
92 
94 
99  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
100  vtkGetMacro(SliderWidth, double);
102 
104 
108  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
109  vtkGetMacro(TubeWidth, double);
111 
113 
118  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
119  vtkGetMacro(EndCapLength, double);
121 
123 
127  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
128  vtkGetMacro(EndCapWidth, double);
130 
135  virtual void SetTitleText(const char*) {}
136  virtual const char* GetTitleText() { return nullptr; }
137 
139 
142  vtkSetStringMacro(LabelFormat);
143  vtkGetStringMacro(LabelFormat);
145 
147 
151  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
152  vtkGetMacro(LabelHeight, double);
154 
156 
160  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
161  vtkGetMacro(TitleHeight, double);
163 
165 
169  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
170  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
171  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
173 
178  virtual double GetCurrentT() { return this->CurrentT; }
179  virtual double GetPickedT() { return this->PickedT; }
180 
181  // Enums are used to describe what is selected
183  {
184  Outside = 0,
188  Slider
189  };
190 
191 protected:
193  ~vtkSliderRepresentation() override;
194 
195  // Values
196  double Value;
197  double MinimumValue;
198  double MaximumValue;
199 
200  // More ivars controlling the appearance of the widget
201  double SliderLength;
202  double SliderWidth;
203  double EndCapLength;
204  double EndCapWidth;
205  double TubeWidth;
206 
207  // The current parametric coordinate
208  double CurrentT;
209  double PickedT;
210 
211  // both the title and label
213  char* LabelFormat;
214  double LabelHeight;
215  double TitleHeight;
216 
217 private:
219  void operator=(const vtkSliderRepresentation&) = delete;
220 };
221 
222 #endif
vtkWidgetRepresentation.h
vtkSliderRepresentation::MinimumValue
double MinimumValue
Definition: vtkSliderRepresentation.h:197
vtkSliderRepresentation::ShowSliderLabel
vtkTypeBool ShowSliderLabel
Definition: vtkSliderRepresentation.h:212
vtkSliderRepresentation::GetPickedT
virtual double GetPickedT()
Definition: vtkSliderRepresentation.h:179
vtkSliderRepresentation::EndCapLength
double EndCapLength
Definition: vtkSliderRepresentation.h:203
vtkX3D::value
Definition: vtkX3D.h:226
vtkSliderRepresentation::SliderLength
double SliderLength
Definition: vtkSliderRepresentation.h:201
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkSliderRepresentation::TitleHeight
double TitleHeight
Definition: vtkSliderRepresentation.h:215
vtkSliderRepresentation::LeftCap
Definition: vtkSliderRepresentation.h:186
vtkSliderRepresentation::TubeWidth
double TubeWidth
Definition: vtkSliderRepresentation.h:205
vtkSliderRepresentation::CurrentT
double CurrentT
Definition: vtkSliderRepresentation.h:208
vtkSliderRepresentation::PickedT
double PickedT
Definition: vtkSliderRepresentation.h:209
vtkSliderRepresentation::EndCapWidth
double EndCapWidth
Definition: vtkSliderRepresentation.h:204
vtkSliderRepresentation::SetTitleText
virtual void SetTitleText(const char *)
Specify the label text for this widget.
Definition: vtkSliderRepresentation.h:135
vtkSliderRepresentation::GetCurrentT
virtual double GetCurrentT()
Methods to interface with the vtkSliderWidget.
Definition: vtkSliderRepresentation.h:178
vtkSliderRepresentation::LabelHeight
double LabelHeight
Definition: vtkSliderRepresentation.h:214
vtkSliderRepresentation::SliderWidth
double SliderWidth
Definition: vtkSliderRepresentation.h:202
vtkSliderRepresentation::_InteractionState
_InteractionState
Definition: vtkSliderRepresentation.h:182
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkSliderRepresentation::Value
double Value
Definition: vtkSliderRepresentation.h:196
vtkSliderRepresentation::LabelFormat
char * LabelFormat
Definition: vtkSliderRepresentation.h:213
vtkSliderRepresentation::Tube
Definition: vtkSliderRepresentation.h:185
vtkSliderRepresentation::RightCap
Definition: vtkSliderRepresentation.h:187
vtkSliderRepresentation::GetTitleText
virtual const char * GetTitleText()
Definition: vtkSliderRepresentation.h:136
vtkSliderRepresentation::MaximumValue
double MaximumValue
Definition: vtkSliderRepresentation.h:198
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkSliderRepresentation
abstract class defines the representation for a vtkSliderWidget
Definition: vtkSliderRepresentation.h:44
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.