VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkHandleWidget.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 =========================================================================*/ 00069 #ifndef __vtkHandleWidget_h 00070 #define __vtkHandleWidget_h 00071 00072 #include "vtkInteractionWidgetsModule.h" // For export macro 00073 #include "vtkAbstractWidget.h" 00074 00075 class vtkHandleRepresentation; 00076 00077 00078 class VTKINTERACTIONWIDGETS_EXPORT vtkHandleWidget : public vtkAbstractWidget 00079 { 00080 public: 00082 static vtkHandleWidget *New(); 00083 00085 00086 vtkTypeMacro(vtkHandleWidget,vtkAbstractWidget); 00087 void PrintSelf(ostream& os, vtkIndent indent); 00089 00091 00094 void SetRepresentation(vtkHandleRepresentation *r) 00095 {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));} 00097 00099 00100 vtkHandleRepresentation *GetHandleRepresentation() 00101 {return reinterpret_cast<vtkHandleRepresentation*>(this->WidgetRep);} 00103 00106 void CreateDefaultRepresentation(); 00107 00109 00112 vtkSetMacro( EnableAxisConstraint, int ); 00113 vtkGetMacro( EnableAxisConstraint, int ); 00114 vtkBooleanMacro( EnableAxisConstraint, int ); 00116 00118 00120 vtkSetMacro( AllowHandleResize, int ); 00121 vtkGetMacro( AllowHandleResize, int ); 00122 vtkBooleanMacro( AllowHandleResize, int ); 00124 00126 00127 vtkGetMacro( WidgetState, int ); 00129 00130 //BTX - manage the state of the widget 00131 enum _WidgetState {Start=0,Active}; 00132 //ETX 00133 00134 protected: 00135 vtkHandleWidget(); 00136 ~vtkHandleWidget(); 00137 00138 // These are the callbacks for this widget 00139 static void GenericAction(vtkHandleWidget*); 00140 static void SelectAction(vtkAbstractWidget*); 00141 static void EndSelectAction(vtkAbstractWidget*); 00142 static void TranslateAction(vtkAbstractWidget*); 00143 static void ScaleAction(vtkAbstractWidget*); 00144 static void MoveAction(vtkAbstractWidget*); 00145 00146 // helper methods for cursor management 00147 void SetCursor(int state); 00148 00149 int WidgetState; 00150 int EnableAxisConstraint; 00151 00152 // Allow resizing of handles. 00153 int AllowHandleResize; 00154 00155 private: 00156 vtkHandleWidget(const vtkHandleWidget&); //Not implemented 00157 void operator=(const vtkHandleWidget&); //Not implemented 00158 }; 00159 00160 #endif