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 "vtkInteractionWidgetsModule.h" // For export macro 00078 #include "vtkAbstractWidget.h" 00079 00080 class vtkSliderRepresentation; 00081 00082 00083 class VTKINTERACTIONWIDGETS_EXPORT vtkSliderWidget : public vtkAbstractWidget 00084 { 00085 public: 00087 static vtkSliderWidget *New(); 00088 00090 00091 vtkTypeMacro(vtkSliderWidget,vtkAbstractWidget); 00092 void PrintSelf(ostream& os, vtkIndent indent); 00094 00096 00099 void SetRepresentation(vtkSliderRepresentation *r) 00100 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00102 00104 00105 vtkSliderRepresentation *GetSliderRepresentation() 00106 {return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);} 00108 00110 00115 vtkSetClampMacro(AnimationMode, int, AnimateOff, Animate); 00116 vtkGetMacro(AnimationMode, int); 00117 void SetAnimationModeToOff() { this->SetAnimationMode(AnimateOff); } 00118 void SetAnimationModeToJump() { this->SetAnimationMode(Jump); } 00119 void SetAnimationModeToAnimate() { this->SetAnimationMode(Animate); } 00121 00123 00125 vtkSetClampMacro(NumberOfAnimationSteps,int,1,VTK_INT_MAX); 00126 vtkGetMacro(NumberOfAnimationSteps,int); 00128 00130 void CreateDefaultRepresentation(); 00131 00132 protected: 00133 vtkSliderWidget(); 00134 ~vtkSliderWidget() {} 00135 00136 // These are the events that are handled 00137 static void SelectAction(vtkAbstractWidget*); 00138 static void EndSelectAction(vtkAbstractWidget*); 00139 static void MoveAction(vtkAbstractWidget*); 00140 void AnimateSlider(int selectionState); 00141 00142 //BTX - manage the state of the widget 00143 int WidgetState; 00144 enum _WidgetState 00145 { 00146 Start=0, 00147 Sliding, 00148 Animating 00149 }; 00150 00151 int NumberOfAnimationSteps; 00152 int AnimationMode; 00153 enum AnimationState { 00154 AnimateOff, 00155 Jump, 00156 Animate 00157 }; 00158 00159 //ETX 00160 00161 00162 private: 00163 vtkSliderWidget(const vtkSliderWidget&); //Not implemented 00164 void operator=(const vtkSliderWidget&); //Not implemented 00165 }; 00166 00167 #endif