VTK
vtkSliderWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSliderWidget.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 =========================================================================*/
72 #ifndef vtkSliderWidget_h
73 #define vtkSliderWidget_h
74 
75 #include "vtkInteractionWidgetsModule.h" // For export macro
76 #include "vtkAbstractWidget.h"
77 
79 
80 
81 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
82 {
83 public:
87  static vtkSliderWidget *New();
88 
90 
94  void PrintSelf(ostream& os, vtkIndent indent);
96 
103  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
104 
109  {return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);}
110 
112 
119  vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
120  vtkGetMacro(AnimationMode, int);
121  void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
122  void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
123  void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
125 
127 
131  vtkSetClampMacro(NumberOfAnimationSteps,int,1,VTK_INT_MAX);
132  vtkGetMacro(NumberOfAnimationSteps,int);
134 
139 
140 protected:
141  vtkSliderWidget();
143 
144  // These are the events that are handled
145  static void SelectAction(vtkAbstractWidget*);
146  static void EndSelectAction(vtkAbstractWidget*);
147  static void MoveAction(vtkAbstractWidget*);
148  void AnimateSlider(int selectionState);
149 
150  // Manage the state of the widget
153  {
154  Start=0,
156  Animating
157  };
158 
164  Animate
165  };
166 
167 
168 
169 private:
170  vtkSliderWidget(const vtkSliderWidget&) VTK_DELETE_FUNCTION;
171  void operator=(const vtkSliderWidget&) VTK_DELETE_FUNCTION;
172 };
173 
174 #endif
void PrintSelf(ostream &os, vtkIndent indent)
Standard macros implementing standard VTK methods.
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
#define VTK_INT_MAX
Definition: vtkType.h:153
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
void SetAnimationModeToOff()
Control the behavior of the slider when selecting the tube or caps.
vtkWidgetRepresentation * WidgetRep
void SetAnimationModeToJump()
Control the behavior of the slider when selecting the tube or caps.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetAnimationModeToAnimate()
Control the behavior of the slider when selecting the tube or caps.
abstract class defines the representation for a vtkSliderWidget
set a value by manipulating a slider
define the API for widget / widget representation
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...