00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkAngleWidget.h,v 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 =========================================================================*/ 00079 #ifndef __vtkAngleWidget_h 00080 #define __vtkAngleWidget_h 00081 00082 #include "vtkAbstractWidget.h" 00083 00084 class vtkAngleRepresentation; 00085 class vtkHandleWidget; 00086 class vtkAngleWidgetCallback; 00087 00088 00089 class VTK_WIDGETS_EXPORT vtkAngleWidget : public vtkAbstractWidget 00090 { 00091 public: 00093 static vtkAngleWidget *New(); 00094 00096 00097 vtkTypeMacro(vtkAngleWidget,vtkAbstractWidget); 00098 void PrintSelf(ostream& os, vtkIndent indent); 00100 00104 virtual void SetEnabled(int); 00105 00107 00110 void SetRepresentation(vtkAngleRepresentation *r) 00111 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00113 00115 void CreateDefaultRepresentation(); 00116 00119 int IsAngleValid(); 00120 00123 virtual void SetProcessEvents(int); 00124 00125 protected: 00126 vtkAngleWidget(); 00127 ~vtkAngleWidget(); 00128 00129 // The state of the widget 00130 //BTX 00131 enum {Start=0,Define,Manipulate}; 00132 //ETX 00133 int WidgetState; 00134 int CurrentHandle; 00135 00136 // Callback interface to capture events when 00137 // placing the widget. 00138 static void AddPointAction(vtkAbstractWidget*); 00139 static void MoveAction(vtkAbstractWidget*); 00140 static void EndSelectAction(vtkAbstractWidget*); 00141 00142 // The positioning handle widgets 00143 vtkHandleWidget *Point1Widget; 00144 vtkHandleWidget *CenterWidget; 00145 vtkHandleWidget *Point2Widget; 00146 vtkAngleWidgetCallback *AngleWidgetCallback1; 00147 vtkAngleWidgetCallback *AngleWidgetCenterCallback; 00148 vtkAngleWidgetCallback *AngleWidgetCallback2; 00149 00150 // Methods invoked when the handles at the 00151 // end points of the widget are manipulated 00152 void StartAngleInteraction(int handleNum); 00153 void AngleInteraction(int handleNum); 00154 void EndAngleInteraction(int handleNum); 00155 00156 //BTX 00157 friend class vtkAngleWidgetCallback; 00158 //ETX 00159 00160 private: 00161 vtkAngleWidget(const vtkAngleWidget&); //Not implemented 00162 void operator=(const vtkAngleWidget&); //Not implemented 00163 }; 00164 00165 #endif