00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkAffineWidget.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 =========================================================================*/ 00066 #ifndef __vtkAffineWidget_h 00067 #define __vtkAffineWidget_h 00068 00069 #include "vtkAbstractWidget.h" 00070 00071 class vtkAffineRepresentation; 00072 00073 00074 class VTK_WIDGETS_EXPORT vtkAffineWidget : public vtkAbstractWidget 00075 { 00076 public: 00078 static vtkAffineWidget *New(); 00079 00081 00082 vtkTypeMacro(vtkAffineWidget,vtkAbstractWidget); 00083 void PrintSelf(ostream& os, vtkIndent indent); 00085 00087 00090 void SetRepresentation(vtkAffineRepresentation *r) 00091 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00093 00095 void CreateDefaultRepresentation(); 00096 00100 virtual void SetEnabled(int); 00101 00102 protected: 00103 vtkAffineWidget(); 00104 ~vtkAffineWidget(); 00105 00106 // These are the callbacks for this widget 00107 static void SelectAction(vtkAbstractWidget*); 00108 static void EndSelectAction(vtkAbstractWidget*); 00109 static void MoveAction(vtkAbstractWidget*); 00110 static void ModifyEventAction(vtkAbstractWidget*); 00111 00112 // helper methods for cursor management 00113 void SetCursor(int state); 00114 00115 //BTX - manage the state of the widget 00116 int WidgetState; 00117 enum _WidgetState 00118 { 00119 Start=0, 00120 Active 00121 }; 00122 //ETX 00123 00124 // Keep track whether key modifier key is pressed 00125 int ModifierActive; 00126 00127 private: 00128 vtkAffineWidget(const vtkAffineWidget&); //Not implemented 00129 void operator=(const vtkAffineWidget&); //Not implemented 00130 }; 00131 00132 #endif