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
161
162#ifndef vtkInteractorStyleImage_h
163#define vtkInteractorStyleImage_h
164
165#include "vtkInteractionStyleModule.h" // For export macro
167#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
168
169// Motion flags
170
171#define VTKIS_WINDOW_LEVEL 1024
172#define VTKIS_SLICE 1025
173
174// Style flags
175
176#define VTKIS_IMAGE2D 2
177#define VTKIS_IMAGE3D 3
178#define VTKIS_IMAGE_SLICING 4
179
180VTK_ABI_NAMESPACE_BEGIN
181class vtkImageProperty;
182
183class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleImage
185{
186public:
189 void PrintSelf(ostream& os, vtkIndent indent) override;
190
192
195 vtkGetVector2Macro(WindowLevelStartPosition, int);
196 vtkGetVector2Macro(WindowLevelCurrentPosition, int);
198
200
204 void OnMouseMove() override;
205 void OnLeftButtonDown() override;
206 void OnLeftButtonUp() override;
207 void OnMiddleButtonDown() override;
208 void OnMiddleButtonUp() override;
209 void OnRightButtonDown() override;
210 void OnRightButtonUp() override;
212
216 void OnChar() override;
217
218 // These methods for the different interactions in different modes
219 // are overridden in subclasses to perform the correct motion. Since
220 // they might be called from OnTimer, they do not have mouse coord parameters
221 // (use interactor's GetEventPosition and GetLastEventPosition)
222 virtual void WindowLevel();
223 virtual void Pick();
224 virtual void Slice();
225
226 // Interaction mode entry points used internally.
227 virtual void StartWindowLevel();
228 virtual void EndWindowLevel();
229 virtual void StartPick();
230 virtual void EndPick();
231 virtual void StartSlice();
232 virtual void EndSlice();
233
235
242 vtkGetMacro(InteractionMode, int);
247
249
253 vtkSetVector3Macro(XViewRightVector, double);
254 vtkGetVector3Macro(XViewRightVector, double);
255 vtkSetVector3Macro(XViewUpVector, double);
256 vtkGetVector3Macro(XViewUpVector, double);
257 vtkSetVector3Macro(YViewRightVector, double);
258 vtkGetVector3Macro(YViewRightVector, double);
259 vtkSetVector3Macro(YViewUpVector, double);
260 vtkGetVector3Macro(YViewUpVector, double);
261 vtkSetVector3Macro(ZViewRightVector, double);
262 vtkGetVector3Macro(ZViewRightVector, double);
263 vtkSetVector3Macro(ZViewUpVector, double);
264 vtkGetVector3Macro(ZViewUpVector, double);
266
276 void SetImageOrientation(const double leftToRight[3], const double bottomToTop[3]);
277
288 virtual void SetCurrentImageNumber(int i);
290
298
299protected:
302
308
311 double XViewUpVector[3];
313 double YViewUpVector[3];
315 double ZViewUpVector[3];
316
317private:
319 void operator=(const vtkInteractorStyleImage&) = delete;
320};
321
322VTK_ABI_NAMESPACE_END
323#endif
image display properties
a simple class to control print indentation
Definition vtkIndent.h:108
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