VTK  9.6.1
vtkInteractorStyleImage.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
55
56#ifndef vtkInteractorStyleImage_h
57#define vtkInteractorStyleImage_h
58
59#include "vtkInteractionStyleModule.h" // For export macro
61#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
62
63// Motion flags
64
65#define VTKIS_WINDOW_LEVEL 1024
66#define VTKIS_SLICE 1025
67
68// Style flags
69
70#define VTKIS_IMAGE2D 2
71#define VTKIS_IMAGE3D 3
72#define VTKIS_IMAGE_SLICING 4
73
74VTK_ABI_NAMESPACE_BEGIN
76
77class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleImage
79{
80public:
83 void PrintSelf(ostream& os, vtkIndent indent) override;
84
86
89 vtkGetVector2Macro(WindowLevelStartPosition, int);
90 vtkGetVector2Macro(WindowLevelCurrentPosition, int);
92
94
98 void OnMouseMove() override;
99 void OnLeftButtonDown() override;
100 void OnLeftButtonUp() override;
101 void OnMiddleButtonDown() override;
102 void OnMiddleButtonUp() override;
103 void OnRightButtonDown() override;
104 void OnRightButtonUp() override;
106
110 void OnChar() override;
111
112 // These methods for the different interactions in different modes
113 // are overridden in subclasses to perform the correct motion. Since
114 // they might be called from OnTimer, they do not have mouse coord parameters
115 // (use interactor's GetEventPosition and GetLastEventPosition)
116 virtual void WindowLevel();
117 virtual void Pick();
118 virtual void Slice();
119
120 // Interaction mode entry points used internally.
121 virtual void StartWindowLevel();
122 virtual void EndWindowLevel();
123 virtual void StartPick();
124 virtual void EndPick();
125 virtual void StartSlice();
126 virtual void EndSlice();
127
129
136 vtkGetMacro(InteractionMode, int);
141
143
147 vtkSetVector3Macro(XViewRightVector, double);
148 vtkGetVector3Macro(XViewRightVector, double);
149 vtkSetVector3Macro(XViewUpVector, double);
150 vtkGetVector3Macro(XViewUpVector, double);
151 vtkSetVector3Macro(YViewRightVector, double);
152 vtkGetVector3Macro(YViewRightVector, double);
153 vtkSetVector3Macro(YViewUpVector, double);
154 vtkGetVector3Macro(YViewUpVector, double);
155 vtkSetVector3Macro(ZViewRightVector, double);
156 vtkGetVector3Macro(ZViewRightVector, double);
157 vtkSetVector3Macro(ZViewUpVector, double);
158 vtkGetVector3Macro(ZViewUpVector, double);
160
170 void SetImageOrientation(const double leftToRight[3], const double bottomToTop[3]);
171
182 virtual void SetCurrentImageNumber(int i);
184
192
193protected:
196
202
205 double XViewUpVector[3];
207 double YViewUpVector[3];
209 double ZViewUpVector[3];
210
211private:
213 void operator=(const vtkInteractorStyleImage&) = delete;
214};
215
216VTK_ABI_NAMESPACE_END
217#endif
image display properties
a simple class to control print indentation
Definition vtkIndent.h:29
virtual void StartWindowLevel()
void OnRightButtonUp() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void SetInteractionModeToImage2D()
Set/Get current mode to 2D or 3D.
void SetInteractionModeToImageSlicing()
Set/Get current mode to 2D or 3D.
virtual void Slice()
void OnMiddleButtonDown() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
~vtkInteractorStyleImage() override
virtual void StartSlice()
void OnLeftButtonUp() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void OnRightButtonDown() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
virtual void StartPick()
virtual void EndSlice()
void OnLeftButtonDown() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void OnMiddleButtonUp() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
virtual void SetCurrentImageNumber(int i)
Set the image to use for WindowLevel interaction.
vtkImageProperty * CurrentImageProperty
void SetInteractionModeToImage3D()
Set/Get current mode to 2D or 3D.
static vtkInteractorStyleImage * New()
virtual void SetInteractionMode(int)
Set/Get current mode to 2D or 3D.
vtkImageProperty * GetCurrentImageProperty()
Get the current image property, which is set when StartWindowLevel is called immediately before Start...
virtual void EndPick()
void OnMouseMove() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void SetImageOrientation(const double leftToRight[3], const double bottomToTop[3])
Set the view orientation, in terms of the horizontal and vertical directions of the computer screen.
virtual void EndWindowLevel()
void OnChar() override
Override the "fly-to" (f keypress) for images.
virtual void WindowLevel()
#define VTKIS_IMAGE2D
#define VTKIS_IMAGE3D
#define VTKIS_IMAGE_SLICING
#define VTK_MARSHALAUTO