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 "vtkAbstractWidget.h"
48 
50 
52 {
53 public:
54 
56  static vtkResliceCursorWidget *New();
57 
59 
61  void PrintSelf(ostream& os, vtkIndent indent);
63 
65 
68  void SetRepresentation(vtkResliceCursorRepresentation *r)
69  {this->Superclass::SetWidgetRepresentation(
70  reinterpret_cast<vtkWidgetRepresentation*>(r));}
72 
74 
75  vtkResliceCursorRepresentation *GetResliceCursorRepresentation()
76  {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);}
78 
81 
85  virtual void SetEnabled(int);
86 
88 
89  vtkSetMacro( ManageWindowLevel, int );
90  vtkGetMacro( ManageWindowLevel, int );
91  vtkBooleanMacro( ManageWindowLevel, int );
93 
95 
96  enum
97  {
98  WindowLevelEvent = 1055,
101  ResetCursorEvent
102  };
103  //ETX
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 //BTX - manage the state of the widget
134  {
135  Start=0,
136  Active
137  };
138 //ETX
139 
140  // Keep track whether key modifier key is pressed
143 
144 private:
145  vtkResliceCursorWidget(const vtkResliceCursorWidget&); //Not implemented
146  void operator=(const vtkResliceCursorWidget&); //Not implemented
147 };
148 
149 #endif