VTK
dox/Widgets/vtkSliderWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSliderWidget.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00074 #ifndef __vtkSliderWidget_h
00075 #define __vtkSliderWidget_h
00076 
00077 #include "vtkAbstractWidget.h"
00078 
00079 class vtkSliderRepresentation;
00080 
00081 
00082 class VTK_WIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget
00083 {
00084 public:
00086   static vtkSliderWidget *New();
00087 
00089 
00090   vtkTypeMacro(vtkSliderWidget,vtkAbstractWidget);
00091   void PrintSelf(ostream& os, vtkIndent indent);
00093 
00095 
00098   void SetRepresentation(vtkSliderRepresentation *r)
00099     {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
00101   
00103 
00108   vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate);
00109   vtkGetMacro(AnimationMode, int);
00110   void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); }
00111   void SetAnimationModeToJump() { this->SetAnimationMode(Jump); }
00112   void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); }
00114 
00116 
00118   vtkSetClampMacro(NumberOfAnimationSteps,int,1,VTK_LARGE_INTEGER);
00119   vtkGetMacro(NumberOfAnimationSteps,int);
00121 
00123   void CreateDefaultRepresentation();
00124 
00125 protected:
00126   vtkSliderWidget();
00127   ~vtkSliderWidget() {}
00128 
00129   // These are the events that are handled
00130   static void SelectAction(vtkAbstractWidget*);
00131   static void EndSelectAction(vtkAbstractWidget*);
00132   static void MoveAction(vtkAbstractWidget*);
00133   void AnimateSlider(int selectionState);
00134 
00135 //BTX - manage the state of the widget
00136   int WidgetState;
00137   enum _WidgetState
00138   {
00139     Start=0,
00140     Sliding,
00141     Animating
00142   };
00143 
00144   int NumberOfAnimationSteps;
00145   int AnimationMode;
00146   enum AnimationState {    
00147     AnimateOff,
00148     Jump,
00149     Animate
00150   };
00151 
00152 //ETX
00153 
00154 
00155 private:
00156   vtkSliderWidget(const vtkSliderWidget&);  //Not implemented
00157   void operator=(const vtkSliderWidget&);  //Not implemented
00158 };
00159 
00160 #endif