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 =========================================================================*/
35 #ifndef vtkSliderRepresentation_h
36 #define vtkSliderRepresentation_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
40 
41 
42 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderRepresentation : public vtkWidgetRepresentation
43 {
44 public:
46 
50  void PrintSelf(ostream& os, vtkIndent indent);
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 NULL;}
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,int);
168  vtkGetMacro(ShowSliderLabel,int);
169  vtkBooleanMacro(ShowSliderLabel,int);
171 
176  virtual double GetCurrentT()
177  {return this->CurrentT;}
178  virtual double GetPickedT()
179  {return this->PickedT;}
180 
181  // Enums are used to describe what is selected
183  {
184  Outside=0,
188  Slider
189  };
190 
191 protected:
194 
195  // Values
196  double Value;
197  double MinimumValue;
198  double MaximumValue;
199 
200  // More ivars controlling the appearance of the widget
201  double SliderLength;
202  double SliderWidth;
203  double EndCapLength;
204  double EndCapWidth;
205  double TubeWidth;
206 
207  // The current parametric coordinate
208  double CurrentT;
209  double PickedT;
210 
211  // both the title and label
213  char *LabelFormat;
214  double LabelHeight;
215  double TitleHeight;
216 
217 private:
218  vtkSliderRepresentation(const vtkSliderRepresentation&) VTK_DELETE_FUNCTION;
219  void operator=(const vtkSliderRepresentation&) VTK_DELETE_FUNCTION;
220 };
221 
222 #endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class defines the representation for a vtkSliderWidget
virtual void SetTitleText(const char *)
Specify the label text for this widget.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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()
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:220
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.