VTK  9.0.1
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 =========================================================================*/
32 #ifndef vtkSliderRepresentation_h
33 #define vtkSliderRepresentation_h
34 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
37 
38 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
39 {
40 public:
42 
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
54  void SetValue(double value);
55  vtkGetMacro(Value, double);
57 
59 
64  void SetMinimumValue(double value);
65  vtkGetMacro(MinimumValue, double);
67 
69 
74  void SetMaximumValue(double value);
75  vtkGetMacro(MaximumValue, double);
77 
79 
83  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
84  vtkGetMacro(SliderLength, double);
86 
88 
93  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
94  vtkGetMacro(SliderWidth, double);
96 
98 
102  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
103  vtkGetMacro(TubeWidth, double);
105 
107 
112  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
113  vtkGetMacro(EndCapLength, double);
115 
117 
121  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
122  vtkGetMacro(EndCapWidth, double);
124 
129  virtual void SetTitleText(const char*) {}
130  virtual const char* GetTitleText() { return nullptr; }
131 
133 
136  vtkSetStringMacro(LabelFormat);
137  vtkGetStringMacro(LabelFormat);
139 
141 
145  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
146  vtkGetMacro(LabelHeight, double);
148 
150 
154  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
155  vtkGetMacro(TitleHeight, double);
157 
159 
163  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
164  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
165  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
167 
172  virtual double GetCurrentT() { return this->CurrentT; }
173  virtual double GetPickedT() { return this->PickedT; }
174 
175  // Enums are used to describe what is selected
177  {
178  Outside = 0,
182  Slider
183  };
184 
185 protected:
187  ~vtkSliderRepresentation() override;
188 
189  // Values
190  double Value;
191  double MinimumValue;
192  double MaximumValue;
193 
194  // More ivars controlling the appearance of the widget
195  double SliderLength;
196  double SliderWidth;
197  double EndCapLength;
198  double EndCapWidth;
199  double TubeWidth;
200 
201  // The current parametric coordinate
202  double CurrentT;
203  double PickedT;
204 
205  // both the title and label
207  char* LabelFormat;
208  double LabelHeight;
209  double TitleHeight;
210 
211 private:
213  void operator=(const vtkSliderRepresentation&) = delete;
214 };
215 
216 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual double GetCurrentT()
Methods to interface with the vtkSliderWidget.
virtual void SetTitleText(const char *)
Specify the label text for this widget.
abstract class defines interface between the widget and widget representation classes ...
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class defines the representation for a vtkSliderWidget
virtual const char * GetTitleText()