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:
143 
144  // These are the events that are handled
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
define the API for widget / widget representation
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class defines the representation for a vtkSliderWidget
set a value by manipulating a slider
vtkSliderRepresentation * GetSliderRepresentation()
Return the representation as a vtkSliderRepresentation.
void SetAnimationModeToOff()
void SetAnimationModeToJump()
void AnimateSlider(int selectionState)
void SetAnimationModeToAnimate()
static vtkSliderWidget * New()
Instantiate the class.
static void SelectAction(vtkAbstractWidget *)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static void EndSelectAction(vtkAbstractWidget *)
void CreateDefaultRepresentation()
Create the default widget representation if one is not set.
void SetRepresentation(vtkSliderRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
static void MoveAction(vtkAbstractWidget *)
abstract class defines interface between the widget and widget representation classes
#define VTK_INT_MAX
Definition: vtkType.h:153