VTK  9.5.2
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
52
53#ifndef vtkInteractorStyleImage_h
54#define vtkInteractorStyleImage_h
55
56#include "vtkInteractionStyleModule.h" // For export macro
58#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
59
60// Motion flags
61
62#define VTKIS_WINDOW_LEVEL 1024
63#define VTKIS_SLICE 1025
64
65// Style flags
66
67#define VTKIS_IMAGE2D 2
68#define VTKIS_IMAGE3D 3
69#define VTKIS_IMAGE_SLICING 4
70
71VTK_ABI_NAMESPACE_BEGIN
73
74class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleImage
76{
77public:
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
83
86 vtkGetVector2Macro(WindowLevelStartPosition, int);
87 vtkGetVector2Macro(WindowLevelCurrentPosition, int);
89
91
95 void OnMouseMove() override;
96 void OnLeftButtonDown() override;
97 void OnLeftButtonUp() override;
98 void OnMiddleButtonDown() override;
99 void OnMiddleButtonUp() override;
100 void OnRightButtonDown() override;
101 void OnRightButtonUp() override;
103
107 void OnChar() override;
108
109 // These methods for the different interactions in different modes
110 // are overridden in subclasses to perform the correct motion. Since
111 // they might be called from OnTimer, they do not have mouse coord parameters
112 // (use interactor's GetEventPosition and GetLastEventPosition)
113 virtual void WindowLevel();
114 virtual void Pick();
115 virtual void Slice();
116
117 // Interaction mode entry points used internally.
118 virtual void StartWindowLevel();
119 virtual void EndWindowLevel();
120 virtual void StartPick();
121 virtual void EndPick();
122 virtual void StartSlice();
123 virtual void EndSlice();
124
126
133 vtkGetMacro(InteractionMode, int);
138
140
144 vtkSetVector3Macro(XViewRightVector, double);
145 vtkGetVector3Macro(XViewRightVector, double);
146 vtkSetVector3Macro(XViewUpVector, double);
147 vtkGetVector3Macro(XViewUpVector, double);
148 vtkSetVector3Macro(YViewRightVector, double);
149 vtkGetVector3Macro(YViewRightVector, double);
150 vtkSetVector3Macro(YViewUpVector, double);
151 vtkGetVector3Macro(YViewUpVector, double);
152 vtkSetVector3Macro(ZViewRightVector, double);
153 vtkGetVector3Macro(ZViewRightVector, double);
154 vtkSetVector3Macro(ZViewUpVector, double);
155 vtkGetVector3Macro(ZViewUpVector, double);
157
167 void SetImageOrientation(const double leftToRight[3], const double bottomToTop[3]);
168
179 virtual void SetCurrentImageNumber(int i);
181
189
190protected:
193
199
202 double XViewUpVector[3];
204 double YViewUpVector[3];
206 double ZViewUpVector[3];
207
208private:
210 void operator=(const vtkInteractorStyleImage&) = delete;
211};
212
213VTK_ABI_NAMESPACE_END
214#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