VTK
dox/Interaction/Widgets/vtkResliceCursorWidget.h
Go to the documentation of this file.
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 "vtkInteractionWidgetsModule.h" // For export macro
00048 #include "vtkAbstractWidget.h"
00049 
00050 class vtkResliceCursorRepresentation;
00051 
00052 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorWidget : public vtkAbstractWidget
00053 {
00054 public:
00055 
00057   static vtkResliceCursorWidget *New();
00058 
00060 
00061   vtkTypeMacro(vtkResliceCursorWidget,vtkAbstractWidget);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00064 
00066 
00069   void SetRepresentation(vtkResliceCursorRepresentation *r)
00070     {this->Superclass::SetWidgetRepresentation(
00071         reinterpret_cast<vtkWidgetRepresentation*>(r));}
00073 
00075 
00076   vtkResliceCursorRepresentation *GetResliceCursorRepresentation()
00077     {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);}
00079 
00081   void CreateDefaultRepresentation();
00082 
00086   virtual void SetEnabled(int);
00087 
00089 
00090   vtkSetMacro( ManageWindowLevel, int );
00091   vtkGetMacro( ManageWindowLevel, int );
00092   vtkBooleanMacro( ManageWindowLevel, int );
00094 
00096 
00097   enum
00098     {
00099     WindowLevelEvent = 1055,
00100     ResliceAxesChangedEvent,
00101     ResliceThicknessChangedEvent,
00102     ResetCursorEvent
00103     };
00104   //ETX
00106 
00108   virtual void ResetResliceCursor();
00109 
00110 protected:
00111   vtkResliceCursorWidget();
00112   ~vtkResliceCursorWidget();
00113 
00114   // These are the callbacks for this widget
00115   static void SelectAction(vtkAbstractWidget*);
00116   static void RotateAction(vtkAbstractWidget*);
00117   static void EndSelectAction(vtkAbstractWidget*);
00118   static void ResizeThicknessAction(vtkAbstractWidget*);
00119   static void EndResizeThicknessAction(vtkAbstractWidget*);
00120   static void MoveAction(vtkAbstractWidget*);
00121   static void ResetResliceCursorAction(vtkAbstractWidget*);
00122 
00123   // helper methods for cursor management
00124   void SetCursor(int state);
00125 
00126   // Start Window Level
00127   void StartWindowLevel();
00128 
00129   // Invoke the appropriate event based on state
00130   void InvokeAnEvent();
00131 
00132 //BTX - manage the state of the widget
00133   int WidgetState;
00134   enum _WidgetState
00135   {
00136     Start=0,
00137     Active
00138   };
00139 //ETX
00140 
00141   // Keep track whether key modifier key is pressed
00142   int ModifierActive;
00143   int ManageWindowLevel;
00144 
00145 private:
00146   vtkResliceCursorWidget(const vtkResliceCursorWidget&);  //Not implemented
00147   void operator=(const vtkResliceCursorWidget&);  //Not implemented
00148 };
00149 
00150 #endif