VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkResliceCursorWidget.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 =========================================================================*/ 00044 #ifndef __vtkResliceCursorWidget_h 00045 #define __vtkResliceCursorWidget_h 00046 00047 #include "vtkAbstractWidget.h" 00048 00049 class vtkResliceCursorRepresentation; 00050 00051 class VTK_WIDGETS_EXPORT vtkResliceCursorWidget : public vtkAbstractWidget 00052 { 00053 public: 00054 00056 static vtkResliceCursorWidget *New(); 00057 00059 00060 vtkTypeMacro(vtkResliceCursorWidget,vtkAbstractWidget); 00061 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 00068 void SetRepresentation(vtkResliceCursorRepresentation *r) 00069 {this->Superclass::SetWidgetRepresentation( 00070 reinterpret_cast<vtkWidgetRepresentation*>(r));} 00072 00074 00075 vtkResliceCursorRepresentation *GetResliceCursorRepresentation() 00076 {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);} 00078 00080 void CreateDefaultRepresentation(); 00081 00085 virtual void SetEnabled(int); 00086 00088 00089 vtkSetMacro( ManageWindowLevel, int ); 00090 vtkGetMacro( ManageWindowLevel, int ); 00091 vtkBooleanMacro( ManageWindowLevel, int ); 00093 00095 00096 enum 00097 { 00098 WindowLevelEvent = 1055, 00099 ResliceAxesChangedEvent, 00100 ResliceThicknessChangedEvent, 00101 ResetCursorEvent 00102 }; 00103 //ETX 00105 00107 virtual void ResetResliceCursor(); 00108 00109 protected: 00110 vtkResliceCursorWidget(); 00111 ~vtkResliceCursorWidget(); 00112 00113 // These are the callbacks for this widget 00114 static void SelectAction(vtkAbstractWidget*); 00115 static void RotateAction(vtkAbstractWidget*); 00116 static void EndSelectAction(vtkAbstractWidget*); 00117 static void ResizeThicknessAction(vtkAbstractWidget*); 00118 static void EndResizeThicknessAction(vtkAbstractWidget*); 00119 static void MoveAction(vtkAbstractWidget*); 00120 static void ResetResliceCursorAction(vtkAbstractWidget*); 00121 00122 // helper methods for cursor management 00123 void SetCursor(int state); 00124 00125 // Start Window Level 00126 void StartWindowLevel(); 00127 00128 // Invoke the appropriate event based on state 00129 void InvokeAnEvent(); 00130 00131 //BTX - manage the state of the widget 00132 int WidgetState; 00133 enum _WidgetState 00134 { 00135 Start=0, 00136 Active 00137 }; 00138 //ETX 00139 00140 // Keep track whether key modifier key is pressed 00141 int ModifierActive; 00142 int ManageWindowLevel; 00143 00144 private: 00145 vtkResliceCursorWidget(const vtkResliceCursorWidget&); //Not implemented 00146 void operator=(const vtkResliceCursorWidget&); //Not implemented 00147 }; 00148 00149 #endif