VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCenteredSliderWidget.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 =========================================================================*/ 00076 #ifndef __vtkCenteredSliderWidget_h 00077 #define __vtkCenteredSliderWidget_h 00078 00079 #include "vtkInteractionWidgetsModule.h" // For export macro 00080 #include "vtkAbstractWidget.h" 00081 00082 class vtkSliderRepresentation; 00083 00084 00085 class VTKINTERACTIONWIDGETS_EXPORT vtkCenteredSliderWidget : public vtkAbstractWidget 00086 { 00087 public: 00089 static vtkCenteredSliderWidget *New(); 00090 00092 00093 vtkTypeMacro(vtkCenteredSliderWidget,vtkAbstractWidget); 00094 void PrintSelf(ostream& os, vtkIndent indent); 00096 00098 00101 void SetRepresentation(vtkSliderRepresentation *r) 00102 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00104 00106 00107 vtkSliderRepresentation *GetSliderRepresentation() 00108 {return reinterpret_cast<vtkSliderRepresentation*>(this->WidgetRep);} 00110 00112 void CreateDefaultRepresentation(); 00113 00115 double GetValue() { return this->Value; }; 00116 00117 protected: 00118 vtkCenteredSliderWidget(); 00119 ~vtkCenteredSliderWidget() {} 00120 00121 // These are the events that are handled 00122 static void SelectAction(vtkAbstractWidget*); 00123 static void EndSelectAction(vtkAbstractWidget*); 00124 static void MoveAction(vtkAbstractWidget*); 00125 static void TimerAction(vtkAbstractWidget*); 00126 00127 //BTX - manage the state of the widget 00128 int WidgetState; 00129 enum _WidgetState 00130 { 00131 Start=0, 00132 Sliding 00133 }; 00134 //ETX 00135 00136 int TimerId; 00137 int TimerDuration; 00138 double StartTime; 00139 double Value; 00140 00141 private: 00142 vtkCenteredSliderWidget(const vtkCenteredSliderWidget&); //Not implemented 00143 void operator=(const vtkCenteredSliderWidget&); //Not implemented 00144 }; 00145 00146 #endif