VTK
vtkResliceCursorWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkResliceCursorWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
44 #ifndef vtkResliceCursorWidget_h
45 #define vtkResliceCursorWidget_h
46 
47 #include "vtkInteractionWidgetsModule.h" // For export macro
48 #include "vtkAbstractWidget.h"
49 
51 
53 {
54 public:
55 
57  static vtkResliceCursorWidget *New();
58 
60 
62  void PrintSelf(ostream& os, vtkIndent indent);
64 
66 
70  {this->Superclass::SetWidgetRepresentation(
71  reinterpret_cast<vtkWidgetRepresentation*>(r));}
73 
75 
77  {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);}
79 
82 
86  virtual void SetEnabled(int);
87 
89 
90  vtkSetMacro( ManageWindowLevel, int );
91  vtkGetMacro( ManageWindowLevel, int );
92  vtkBooleanMacro( ManageWindowLevel, int );
94 
96 
97  enum
98  {
99  WindowLevelEvent = 1055,
102  ResetCursorEvent
103  };
105 
107  virtual void ResetResliceCursor();
108 
109 protected:
112 
113  // These are the callbacks for this widget
114  static void SelectAction(vtkAbstractWidget*);
115  static void RotateAction(vtkAbstractWidget*);
116  static void EndSelectAction(vtkAbstractWidget*);
117  static void ResizeThicknessAction(vtkAbstractWidget*);
118  static void EndResizeThicknessAction(vtkAbstractWidget*);
119  static void MoveAction(vtkAbstractWidget*);
120  static void ResetResliceCursorAction(vtkAbstractWidget*);
121 
122  // helper methods for cursor management
123  void SetCursor(int state);
124 
125  // Start Window Level
126  void StartWindowLevel();
127 
128  // Invoke the appropriate event based on state
129  void InvokeAnEvent();
130 
131  // Manage the state of the widget
134  {
135  Start=0,
136  Active
137  };
138 
139  // Keep track whether key modifier key is pressed
142 
143 private:
144  vtkResliceCursorWidget(const vtkResliceCursorWidget&); //Not implemented
145  void operator=(const vtkResliceCursorWidget&); //Not implemented
146 };
147 
148 #endif
void PrintSelf(ostream &os, vtkIndent indent)
virtual void SetCursor(int vtkNotUsed(state))
void SetRepresentation(vtkResliceCursorRepresentation *r)
virtual void CreateDefaultRepresentation()=0
represent a reslice cursor
vtkWidgetRepresentation * WidgetRep
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkResliceCursorRepresentation * GetResliceCursorRepresentation()
define the API for widget / widget representation
static vtkObject * New()
virtual void SetEnabled(int)
represent the vtkResliceCursorWidget