VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkButtonWidget.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 =========================================================================*/ 00060 #ifndef __vtkButtonWidget_h 00061 #define __vtkButtonWidget_h 00062 00063 #include "vtkAbstractWidget.h" 00064 00065 class vtkButtonRepresentation; 00066 00067 00068 class VTK_WIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget 00069 { 00070 public: 00072 static vtkButtonWidget *New(); 00073 00075 00076 vtkTypeMacro(vtkButtonWidget,vtkAbstractWidget); 00077 void PrintSelf(ostream& os, vtkIndent indent); 00079 00081 00084 void SetRepresentation(vtkButtonRepresentation *r) 00085 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00087 00089 00090 vtkButtonRepresentation *GetSliderRepresentation() 00091 {return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);} 00093 00095 void CreateDefaultRepresentation(); 00096 00097 protected: 00098 vtkButtonWidget(); 00099 ~vtkButtonWidget() {} 00100 00101 // These are the events that are handled 00102 static void SelectAction(vtkAbstractWidget*); 00103 static void MoveAction(vtkAbstractWidget*); 00104 static void EndSelectAction(vtkAbstractWidget*); 00105 00106 //BTX - manage the state of the widget 00107 int WidgetState; 00108 enum _WidgetState 00109 { 00110 Start=0, 00111 Hovering, 00112 Selecting 00113 }; 00114 //ETX 00115 00116 private: 00117 vtkButtonWidget(const vtkButtonWidget&); //Not implemented 00118 void operator=(const vtkButtonWidget&); //Not implemented 00119 }; 00120 00121 #endif