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 =========================================================================*/
42 #ifndef vtkResliceCursorWidget_h
43 #define vtkResliceCursorWidget_h
44 
45 #include "vtkInteractionWidgetsModule.h" // For export macro
46 #include "vtkAbstractWidget.h"
47 
49 
50 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorWidget : public vtkAbstractWidget
51 {
52 public:
53 
57  static vtkResliceCursorWidget *New();
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent);
66 
73  {this->Superclass::SetWidgetRepresentation(
74  reinterpret_cast<vtkWidgetRepresentation*>(r));}
75 
80  {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);}
81 
86 
92  virtual void SetEnabled(int);
93 
95 
98  vtkSetMacro( ManageWindowLevel, int );
99  vtkGetMacro( ManageWindowLevel, int );
100  vtkBooleanMacro( ManageWindowLevel, int );
102 
106  enum
107  {
108  WindowLevelEvent = 1055,
111  ResetCursorEvent
112  };
113 
117  virtual void ResetResliceCursor();
118 
119 protected:
122 
123  // These are the callbacks for this widget
124  static void SelectAction(vtkAbstractWidget*);
125  static void RotateAction(vtkAbstractWidget*);
126  static void EndSelectAction(vtkAbstractWidget*);
127  static void ResizeThicknessAction(vtkAbstractWidget*);
128  static void EndResizeThicknessAction(vtkAbstractWidget*);
129  static void MoveAction(vtkAbstractWidget*);
130  static void ResetResliceCursorAction(vtkAbstractWidget*);
131 
132  // helper methods for cursor management
133  void SetCursor(int state);
134 
135  // Start Window Level
136  void StartWindowLevel();
137 
138  // Invoke the appropriate event based on state
139  void InvokeAnEvent();
140 
141  // Manage the state of the widget
144  {
145  Start=0,
146  Active
147  };
148 
149  // Keep track whether key modifier key is pressed
152 
153 private:
154  vtkResliceCursorWidget(const vtkResliceCursorWidget&) VTK_DELETE_FUNCTION;
155  void operator=(const vtkResliceCursorWidget&) VTK_DELETE_FUNCTION;
156 };
157 
158 #endif
void PrintSelf(ostream &os, vtkIndent indent)
Standard macros implementing standard VTK methods.
virtual void SetCursor(int vtkNotUsed(state))
void SetRepresentation(vtkResliceCursorRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene...
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
represent a reslice cursor
vtkWidgetRepresentation * WidgetRep
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkResliceCursorRepresentation * GetResliceCursorRepresentation()
Return the representation as a vtkResliceCursorRepresentation.
define the API for widget / widget representation
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void SetEnabled(int)
Methods for activating this widget.
represent the vtkResliceCursorWidget