00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkHandleWidget.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 =========================================================================*/ 00069 #ifndef __vtkHandleWidget_h 00070 #define __vtkHandleWidget_h 00071 00072 #include "vtkAbstractWidget.h" 00073 00074 class vtkHandleRepresentation; 00075 00076 00077 class VTK_WIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget 00078 { 00079 public: 00081 static vtkHandleWidget *New(); 00082 00084 00085 vtkTypeRevisionMacro(vtkHandleWidget,vtkAbstractWidget); 00086 void PrintSelf(ostream& os, vtkIndent indent); 00088 00090 00093 void SetRepresentation(vtkHandleRepresentation *r) 00094 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00096 00099 void CreateDefaultRepresentation(); 00100 00102 00105 vtkSetMacro( EnableAxisConstraint, int ); 00106 vtkGetMacro( EnableAxisConstraint, int ); 00107 vtkBooleanMacro( EnableAxisConstraint, int ); 00109 00111 00113 vtkSetMacro( AllowHandleResize, int ); 00114 vtkGetMacro( AllowHandleResize, int ); 00115 vtkBooleanMacro( AllowHandleResize, int ); 00117 00118 protected: 00119 vtkHandleWidget(); 00120 ~vtkHandleWidget(); 00121 00122 // These are the callbacks for this widget 00123 static void GenericAction(vtkHandleWidget*); 00124 static void SelectAction(vtkAbstractWidget*); 00125 static void EndSelectAction(vtkAbstractWidget*); 00126 static void TranslateAction(vtkAbstractWidget*); 00127 static void ScaleAction(vtkAbstractWidget*); 00128 static void MoveAction(vtkAbstractWidget*); 00129 00130 // helper methods for cursor management 00131 void SetCursor(int state); 00132 00133 //BTX - manage the state of the widget 00134 int WidgetState; 00135 enum _WidgetState {Start=0,Active}; 00136 //ETX 00137 00138 int EnableAxisConstraint; 00139 00140 // Allow resizing of handles. 00141 int AllowHandleResize; 00142 00143 private: 00144 vtkHandleWidget(const vtkHandleWidget&); //Not implemented 00145 void operator=(const vtkHandleWidget&); //Not implemented 00146 }; 00147 00148 #endif