VTK  9.0.1
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 =========================================================================*/
39 #ifndef vtkResliceCursorWidget_h
40 #define vtkResliceCursorWidget_h
41 
42 #include "vtkAbstractWidget.h"
43 #include "vtkInteractionWidgetsModule.h" // For export macro
44 
46 
47 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorWidget : public vtkAbstractWidget
48 {
49 public:
53  static vtkResliceCursorWidget* New();
54 
56 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
69  {
70  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
71  }
72 
77  {
78  return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);
79  }
80 
84  void CreateDefaultRepresentation() override;
85 
91  void SetEnabled(int) override;
92 
94 
97  vtkSetMacro(ManageWindowLevel, vtkTypeBool);
98  vtkGetMacro(ManageWindowLevel, vtkTypeBool);
99  vtkBooleanMacro(ManageWindowLevel, vtkTypeBool);
101 
105  enum
106  {
107  WindowLevelEvent = 1055,
110  ResetCursorEvent
111  };
112 
116  virtual void ResetResliceCursor();
117 
118 protected:
120  ~vtkResliceCursorWidget() override;
121 
122  // These are the callbacks for this widget
123  static void SelectAction(vtkAbstractWidget*);
124  static void RotateAction(vtkAbstractWidget*);
125  static void EndSelectAction(vtkAbstractWidget*);
126  static void ResizeThicknessAction(vtkAbstractWidget*);
127  static void EndResizeThicknessAction(vtkAbstractWidget*);
128  static void MoveAction(vtkAbstractWidget*);
129  static void ResetResliceCursorAction(vtkAbstractWidget*);
130 
131  // helper methods for cursor management
132  void SetCursor(int state) override;
133 
134  // Start Window Level
135  void StartWindowLevel();
136 
137  // Invoke the appropriate event based on state
138  void InvokeAnEvent();
139 
140  // Manage the state of the widget
143  {
144  Start = 0,
145  Active
146  };
147 
148  // Keep track whether key modifier key is pressed
151 
152 private:
154  void operator=(const vtkResliceCursorWidget&) = delete;
155 };
156 
157 #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:33
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