VTK  9.7.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 "vtkInteractionWidgetsModule.h" // For export macro
38 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
39 
40 VTK_ABI_NAMESPACE_BEGIN
42 
43 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkResliceCursorWidget : public vtkAbstractWidget
44 {
45 public:
49  static vtkResliceCursorWidget* New();
50 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
65  {
66  this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));
67  }
68 
73  {
74  return reinterpret_cast<vtkResliceCursorRepresentation*>(this->WidgetRep);
75  }
76 
80  void CreateDefaultRepresentation() override;
81 
87  void SetEnabled(int) override;
88 
90 
93  vtkSetMacro(ManageWindowLevel, vtkTypeBool);
94  vtkGetMacro(ManageWindowLevel, vtkTypeBool);
95  vtkBooleanMacro(ManageWindowLevel, vtkTypeBool);
97 
101  enum
102  {
103  WindowLevelEvent = 1055,
106  ResetCursorEvent
107  };
108 
112  virtual void ResetResliceCursor();
113 
114 protected:
116  ~vtkResliceCursorWidget() override;
117 
118  // These are the callbacks for this widget
119  static void SelectAction(vtkAbstractWidget*);
120  static void RotateAction(vtkAbstractWidget*);
121  static void TranslateAction(vtkAbstractWidget*);
122  static void EndSelectAction(vtkAbstractWidget*);
123  static void ResizeThicknessAction(vtkAbstractWidget*);
124  static void EndResizeThicknessAction(vtkAbstractWidget*);
125  static void MoveAction(vtkAbstractWidget*);
126  static void ResetResliceCursorAction(vtkAbstractWidget*);
127 
128  // helper methods for cursor management
129  void SetCursor(int state) override;
130 
131  // Start Window Level
132  void StartWindowLevel();
133 
134  // Invoke the appropriate event based on state
135  void InvokeAnEvent();
136 
137  // Manage the state of the widget
140  {
141  Start = 0,
142  Active
143  };
144 
145  // Keep track whether key modifier key is pressed
148 
149 private:
151  void operator=(const vtkResliceCursorWidget&) = delete;
152 };
153 
154 VTK_ABI_NAMESPACE_END
155 #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
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.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void SetCursor(int state)
represent the vtkResliceCursorWidget