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 =========================================================================*/
36 #ifndef vtkResliceCursorWidget_h
37 #define vtkResliceCursorWidget_h
38 
39 #include "vtkInteractionWidgetsModule.h" // For export macro
40 #include "vtkAbstractWidget.h"
41 
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorWidget : public vtkAbstractWidget
45 {
46 public:
47 
51  static vtkResliceCursorWidget *New();
52 
54 
58  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
60 
67  {this->Superclass::SetWidgetRepresentation(
68  reinterpret_cast<vtkWidgetRepresentation*>(r));}
69 
74  {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);}
75 
79  void CreateDefaultRepresentation() VTK_OVERRIDE;
80 
86  void SetEnabled(int) VTK_OVERRIDE;
87 
89 
92  vtkSetMacro( ManageWindowLevel, int );
93  vtkGetMacro( ManageWindowLevel, int );
94  vtkBooleanMacro( ManageWindowLevel, int );
96 
100  enum
101  {
102  WindowLevelEvent = 1055,
105  ResetCursorEvent
106  };
107 
111  virtual void ResetResliceCursor();
112 
113 protected:
115  ~vtkResliceCursorWidget() VTK_OVERRIDE;
116 
117  // These are the callbacks for this widget
118  static void SelectAction(vtkAbstractWidget*);
119  static void RotateAction(vtkAbstractWidget*);
120  static void EndSelectAction(vtkAbstractWidget*);
121  static void ResizeThicknessAction(vtkAbstractWidget*);
122  static void EndResizeThicknessAction(vtkAbstractWidget*);
123  static void MoveAction(vtkAbstractWidget*);
124  static void ResetResliceCursorAction(vtkAbstractWidget*);
125 
126  // helper methods for cursor management
127  void SetCursor(int state) VTK_OVERRIDE;
128 
129  // Start Window Level
130  void StartWindowLevel();
131 
132  // Invoke the appropriate event based on state
133  void InvokeAnEvent();
134 
135  // Manage the state of the widget
136  int WidgetState;
138  {
139  Start=0,
140  Active
141  };
142 
143  // Keep track whether key modifier key is pressed
146 
147 private:
148  vtkResliceCursorWidget(const vtkResliceCursorWidget&) VTK_DELETE_FUNCTION;
149  void operator=(const vtkResliceCursorWidget&) VTK_DELETE_FUNCTION;
150 };
151 
152 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
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:33
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
void SetEnabled(int) override
Methods for activating this widget.
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...
represent the vtkResliceCursorWidget