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 "vtkInteractionWidgetsModule.h" // For export macro 00064 #include "vtkAbstractWidget.h" 00065 00066 class vtkButtonRepresentation; 00067 00068 00069 class VTKINTERACTIONWIDGETS_EXPORT vtkButtonWidget : public vtkAbstractWidget 00070 { 00071 public: 00073 static vtkButtonWidget *New(); 00074 00076 00077 vtkTypeMacro(vtkButtonWidget,vtkAbstractWidget); 00078 void PrintSelf(ostream& os, vtkIndent indent); 00080 00082 00085 void SetRepresentation(vtkButtonRepresentation *r) 00086 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00088 00090 00091 vtkButtonRepresentation *GetSliderRepresentation() 00092 {return reinterpret_cast<vtkButtonRepresentation*>(this->WidgetRep);} 00094 00096 void CreateDefaultRepresentation(); 00097 00098 protected: 00099 vtkButtonWidget(); 00100 ~vtkButtonWidget() {} 00101 00102 // These are the events that are handled 00103 static void SelectAction(vtkAbstractWidget*); 00104 static void MoveAction(vtkAbstractWidget*); 00105 static void EndSelectAction(vtkAbstractWidget*); 00106 00107 //BTX - manage the state of the widget 00108 int WidgetState; 00109 enum _WidgetState 00110 { 00111 Start=0, 00112 Hovering, 00113 Selecting 00114 }; 00115 //ETX 00116 00117 private: 00118 vtkButtonWidget(const vtkButtonWidget&); //Not implemented 00119 void operator=(const vtkButtonWidget&); //Not implemented 00120 }; 00121 00122 #endif