VTK
|
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 00104 vtkSliderRepresentation *GetSliderRepresentation() 00105 {return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);} 00107 00109 00114 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate); 00115 vtkGetMacro(AnimationMode, int); 00116 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); } 00117 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); } 00118 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); } 00120 00122 00124 vtkSetClampMacro(NumberOfAnimationSteps,int,1,VTK_LARGE_INTEGER); 00125 vtkGetMacro(NumberOfAnimationSteps,int); 00127 00129 void CreateDefaultRepresentation(); 00130 00131 protected: 00132 vtkSliderWidget(); 00133 ~vtkSliderWidget() {} 00134 00135 // These are the events that are handled 00136 static void SelectAction(vtkAbstractWidget*); 00137 static void EndSelectAction(vtkAbstractWidget*); 00138 static void MoveAction(vtkAbstractWidget*); 00139 void AnimateSlider(int selectionState); 00140 00141 //BTX - manage the state of the widget 00142 int WidgetState; 00143 enum _WidgetState 00144 { 00145 Start=0, 00146 Sliding, 00147 Animating 00148 }; 00149 00150 int NumberOfAnimationSteps; 00151 int AnimationMode; 00152 enum AnimationState { 00153 AnimateOff, 00154 Jump, 00155 Animate 00156 }; 00157 00158 //ETX 00159 00160 00161 private: 00162 vtkSliderWidget(const vtkSliderWidget&); //Not implemented 00163 void operator=(const vtkSliderWidget&); //Not implemented 00164 }; 00165 00166 #endif