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 =========================================================================*/
37 #ifndef __vtkSliderRepresentation_h
38 #define __vtkSliderRepresentation_h
39 
41 
42 
44 {
45 public:
47 
49  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
55  void SetValue(double value);
56  vtkGetMacro(Value,double);
58 
60 
63  void SetMinimumValue(double value);
64  vtkGetMacro(MinimumValue,double);
66 
68 
71  void SetMaximumValue(double value);
72  vtkGetMacro(MaximumValue,double);
74 
76 
78  vtkSetClampMacro(SliderLength,double,0.01,0.5);
79  vtkGetMacro(SliderLength,double);
81 
83 
87  vtkSetClampMacro(SliderWidth,double,0.0,1.0);
88  vtkGetMacro(SliderWidth,double);
90 
92 
94  vtkSetClampMacro(TubeWidth,double,0.0,1.0);
95  vtkGetMacro(TubeWidth,double);
97 
99 
102  vtkSetClampMacro(EndCapLength,double,0.0,0.25);
103  vtkGetMacro(EndCapLength,double);
105 
107 
109  vtkSetClampMacro(EndCapWidth,double,0.0,0.25);
110  vtkGetMacro(EndCapWidth,double);
112 
114 
116  virtual void SetTitleText(const char*) {}
117  virtual const char* GetTitleText() {return NULL;}
119 
121 
122  vtkSetStringMacro(LabelFormat);
123  vtkGetStringMacro(LabelFormat);
125 
127 
129  vtkSetClampMacro(LabelHeight,double,0.0,2.0);
130  vtkGetMacro(LabelHeight,double);
132 
134 
136  vtkSetClampMacro(TitleHeight,double,0.0,2.0);
137  vtkGetMacro(TitleHeight,double);
139 
141 
143  vtkSetMacro(ShowSliderLabel,int);
144  vtkGetMacro(ShowSliderLabel,int);
145  vtkBooleanMacro(ShowSliderLabel,int);
147 
149 
151  virtual double GetCurrentT()
152  {return this->CurrentT;}
153  virtual double GetPickedT()
154  {return this->PickedT;}
156 
157 //BTX
158  // Enums are used to describe what is selected
160  {
161  Outside=0,
165  Slider
166  };
167 //ETX
168 
169 protected:
172 
173  // Values
174  double Value;
175  double MinimumValue;
176  double MaximumValue;
177 
178  // More ivars controlling the appearance of the widget
179  double SliderLength;
180  double SliderWidth;
181  double EndCapLength;
182  double EndCapWidth;
183  double TubeWidth;
184 
185  // The current parametric coordinate
186  double CurrentT;
187  double PickedT;
188 
189  // both the title and label
191  char *LabelFormat;
192  double LabelHeight;
193  double TitleHeight;
194 
195 private:
196  vtkSliderRepresentation(const vtkSliderRepresentation&); //Not implemented
197  void operator=(const vtkSliderRepresentation&); //Not implemented
198 };
199 
200 #endif