VTK  9.2.6
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
39 #include "vtkInteractionWidgetsModule.h" // For export macro
41 
42 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
43 {
44 public:
46 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
58  void SetValue(double value);
59  vtkGetMacro(Value, double);
61 
63 
68  void SetMinimumValue(double value);
69  vtkGetMacro(MinimumValue, double);
71 
73 
78  void SetMaximumValue(double value);
79  vtkGetMacro(MaximumValue, double);
81 
83 
87  vtkSetClampMacro(SliderLength, double, 0.01, 0.5);
88  vtkGetMacro(SliderLength, double);
90 
92 
97  vtkSetClampMacro(SliderWidth, double, 0.0, 1.0);
98  vtkGetMacro(SliderWidth, double);
100 
102 
106  vtkSetClampMacro(TubeWidth, double, 0.0, 1.0);
107  vtkGetMacro(TubeWidth, double);
109 
111 
116  vtkSetClampMacro(EndCapLength, double, 0.0, 0.25);
117  vtkGetMacro(EndCapLength, double);
119 
121 
125  vtkSetClampMacro(EndCapWidth, double, 0.0, 0.25);
126  vtkGetMacro(EndCapWidth, double);
128 
133  virtual void SetTitleText(const char*) {}
134  virtual const char* GetTitleText() { return nullptr; }
135 
137 
140  vtkSetStringMacro(LabelFormat);
141  vtkGetStringMacro(LabelFormat);
143 
145 
149  vtkSetClampMacro(LabelHeight, double, 0.0, 2.0);
150  vtkGetMacro(LabelHeight, double);
152 
154 
158  vtkSetClampMacro(TitleHeight, double, 0.0, 2.0);
159  vtkGetMacro(TitleHeight, double);
161 
163 
167  vtkSetMacro(ShowSliderLabel, vtkTypeBool);
168  vtkGetMacro(ShowSliderLabel, vtkTypeBool);
169  vtkBooleanMacro(ShowSliderLabel, vtkTypeBool);
171 
176  virtual double GetCurrentT() { return this->CurrentT; }
177  virtual double GetPickedT() { return this->PickedT; }
178 
179  // Enums are used to describe what is selected
181  {
182  Outside = 0,
186  Slider
187  };
188 #if !defined(VTK_LEGACY_REMOVE)
189  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
191 #endif
192 
193 protected:
195  ~vtkSliderRepresentation() override;
196 
197  // Values
198  double Value;
199  double MinimumValue;
200  double MaximumValue;
201 
202  // More ivars controlling the appearance of the widget
203  double SliderLength;
204  double SliderWidth;
205  double EndCapLength;
206  double EndCapWidth;
207  double TubeWidth;
208 
209  // The current parametric coordinate
210  double CurrentT;
211  double PickedT;
212 
213  // both the title and label
215  char* LabelFormat;
216  double LabelHeight;
217  double TitleHeight;
218 
219 private:
221  void operator=(const vtkSliderRepresentation&) = delete;
222 };
223 
224 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
#define VTK_DEPRECATED_IN_9_2_0(reason)
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:39
abstract class defines the representation for a vtkSliderWidget
virtual const char * GetTitleText()