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 =========================================================================*/
29 #ifndef vtkSliderRepresentation_h
30 #define vtkSliderRepresentation_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
35 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
36 {
37 public:
39 
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
51  void SetValue(double value);
52  vtkGetMacro(Value, double);
54 
56 
61  void SetMinimumValue(double value);
62  vtkGetMacro(MinimumValue, double);
64 
66 
71  void SetMaximumValue(double value);
72  vtkGetMacro(MaximumValue, double);
74 
76 
80  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
81  vtkGetMacro(SliderLength, double);
83 
85 
90  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
91  vtkGetMacro(SliderWidth, double);
93 
95 
99  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
100  vtkGetMacro(TubeWidth, double);
102 
104 
109  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
110  vtkGetMacro(EndCapLength, double);
112 
114 
118  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
119  vtkGetMacro(EndCapWidth, double);
121 
126  virtual void SetTitleText(const char*) {}
127  virtual const char* GetTitleText() { return nullptr; }
128 
130 
133  vtkSetStringMacro(LabelFormat);
134  vtkGetStringMacro(LabelFormat);
136 
138 
142  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
143  vtkGetMacro(LabelHeight, double);
145 
147 
151  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
152  vtkGetMacro(TitleHeight, double);
154 
156 
160  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
161  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
162  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
164 
169  virtual double GetCurrentT() { return this->CurrentT; }
170  virtual double GetPickedT() { return this->PickedT; }
171 
172  // Enums are used to describe what is selected
174  {
175  Outside = 0,
179  Slider
180  };
181 
182 protected:
184  ~vtkSliderRepresentation() override;
185 
186  // Values
187  double Value;
188  double MinimumValue;
189  double MaximumValue;
190 
191  // More ivars controlling the appearance of the widget
192  double SliderLength;
193  double SliderWidth;
194  double EndCapLength;
195  double EndCapWidth;
196  double TubeWidth;
197 
198  // The current parametric coordinate
199  double CurrentT;
200  double PickedT;
201 
202  // both the title and label
204  char* LabelFormat;
205  double LabelHeight;
206  double TitleHeight;
207 
208 private:
210  void operator=(const vtkSliderRepresentation&) = delete;
211 };
212 
213 #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()