VTK
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 
36 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
37 {
38 public:
40 
44  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
52  void SetValue(double value);
53  vtkGetMacro(Value,double);
55 
57 
62  void SetMinimumValue(double value);
63  vtkGetMacro(MinimumValue,double);
65 
67 
72  void SetMaximumValue(double value);
73  vtkGetMacro(MaximumValue,double);
75 
77 
81  vtkSetClampMacro(SliderLength,double,0.01,0.5);
82  vtkGetMacro(SliderLength,double);
84 
86 
91  vtkSetClampMacro(SliderWidth,double,0.0,1.0);
92  vtkGetMacro(SliderWidth,double);
94 
96 
100  vtkSetClampMacro(TubeWidth,double,0.0,1.0);
101  vtkGetMacro(TubeWidth,double);
103 
105 
110  vtkSetClampMacro(EndCapLength,double,0.0,0.25);
111  vtkGetMacro(EndCapLength,double);
113 
115 
119  vtkSetClampMacro(EndCapWidth,double,0.0,0.25);
120  vtkGetMacro(EndCapWidth,double);
122 
127  virtual void SetTitleText(const char*) {}
128  virtual const char* GetTitleText() {return nullptr;}
129 
131 
134  vtkSetStringMacro(LabelFormat);
135  vtkGetStringMacro(LabelFormat);
137 
139 
143  vtkSetClampMacro(LabelHeight,double,0.0,2.0);
144  vtkGetMacro(LabelHeight,double);
146 
148 
152  vtkSetClampMacro(TitleHeight,double,0.0,2.0);
153  vtkGetMacro(TitleHeight,double);
155 
157 
161  vtkSetMacro(ShowSliderLabel,vtkTypeBool);
162  vtkGetMacro(ShowSliderLabel,vtkTypeBool);
163  vtkBooleanMacro(ShowSliderLabel,vtkTypeBool);
165 
170  virtual double GetCurrentT()
171  {return this->CurrentT;}
172  virtual double GetPickedT()
173  {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()