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) override;
66 
73  {this->Superclass::SetWidgetRepresentation(
74  reinterpret_cast<vtkWidgetRepresentation*>(r));}
75 
80  {return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);}
81 
85  void CreateDefaultRepresentation() override;
86 
92  void SetEnabled(int) override;
93 
95 
98  vtkSetMacro( ManageWindowLevel, vtkTypeBool );
99  vtkGetMacro( ManageWindowLevel, vtkTypeBool );
100  vtkBooleanMacro( ManageWindowLevel, vtkTypeBool );
102 
106  enum
107  {
108  WindowLevelEvent = 1055,
111  ResetCursorEvent
112  };
113 
117  virtual void ResetResliceCursor();
118 
119 protected:
121  ~vtkResliceCursorWidget() override;
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) override;
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:
155  void operator=(const vtkResliceCursorWidget&) = delete;
156 };
157 
158 #endif
virtual void SetCursor(int vtkNotUsed(state))
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
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkResliceCursorRepresentation * GetResliceCursorRepresentation()
Return the representation as a vtkResliceCursorRepresentation.
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent the vtkResliceCursorWidget