VTK  9.0.3
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:
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
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
Methods invoked by print to print information about the object including superclasses.
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