VTK  9.3.1
vtkResliceCursorWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
33 #ifndef vtkResliceCursorWidget_h
34 #define vtkResliceCursorWidget_h
35 
36 #include "vtkAbstractWidget.h"
37 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
38 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
40 
41 VTK_ABI_NAMESPACE_BEGIN
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorWidget : public vtkAbstractWidget
45 {
46 public:
50  static vtkResliceCursorWidget* New();
51 
53 
57  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
66  {
67  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
68  }
69 
74  {
75  return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);
76  }
77 
81  void CreateDefaultRepresentation() override;
82 
88  void SetEnabled(int) override;
89 
91 
94  vtkSetMacro(ManageWindowLevel, vtkTypeBool);
95  vtkGetMacro(ManageWindowLevel, vtkTypeBool);
96  vtkBooleanMacro(ManageWindowLevel, vtkTypeBool);
98 
102  enum
103  {
104  WindowLevelEvent = 1055,
107  ResetCursorEvent
108  };
109 
113  virtual void ResetResliceCursor();
114 
115 protected:
117  ~vtkResliceCursorWidget() override;
118 
119  // These are the callbacks for this widget
120  static void SelectAction(vtkAbstractWidget*);
121  static void RotateAction(vtkAbstractWidget*);
122  static void TranslateAction(vtkAbstractWidget*);
123  static void EndSelectAction(vtkAbstractWidget*);
124  static void ResizeThicknessAction(vtkAbstractWidget*);
125  static void EndResizeThicknessAction(vtkAbstractWidget*);
126  static void MoveAction(vtkAbstractWidget*);
127  static void ResetResliceCursorAction(vtkAbstractWidget*);
128 
129  // helper methods for cursor management
130  void SetCursor(int state) override;
131 
132  // Start Window Level
133  void StartWindowLevel();
134 
135  // Invoke the appropriate event based on state
136  void InvokeAnEvent();
137 
138  // Manage the state of the widget
141  {
142  Start = 0,
143  Active
144  };
145 #if !defined(VTK_LEGACY_REMOVE)
146  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
148 #endif
149 
150  // Keep track whether key modifier key is pressed
153 
154 private:
156  void operator=(const vtkResliceCursorWidget&) = delete;
157 };
158 
159 VTK_ABI_NAMESPACE_END
160 #endif
virtual void SetCursor(int vtkNotUsed(state))
#define VTK_DEPRECATED_IN_9_2_0(reason)
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:64
a simple class to control print indentation
Definition: vtkIndent.h:28
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