VTK  9.2.6
vtkInteractorStyleImage.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkInteractorStyleImage.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
61
62#ifndef vtkInteractorStyleImage_h
63#define vtkInteractorStyleImage_h
64
65#include "vtkInteractionStyleModule.h" // For export macro
67
68// Motion flags
69
70#define VTKIS_WINDOW_LEVEL 1024
71#define VTKIS_SLICE 1025
72
73// Style flags
74
75#define VTKIS_IMAGE2D 2
76#define VTKIS_IMAGE3D 3
77#define VTKIS_IMAGE_SLICING 4
78
80
81class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleImage : public vtkInteractorStyleTrackballCamera
82{
83public:
86 void PrintSelf(ostream& os, vtkIndent indent) override;
87
89
92 vtkGetVector2Macro(WindowLevelStartPosition, int);
93 vtkGetVector2Macro(WindowLevelCurrentPosition, int);
95
97
101 void OnMouseMove() override;
102 void OnLeftButtonDown() override;
103 void OnLeftButtonUp() override;
104 void OnMiddleButtonDown() override;
105 void OnMiddleButtonUp() override;
106 void OnRightButtonDown() override;
107 void OnRightButtonUp() override;
109
113 void OnChar() override;
114
115 // These methods for the different interactions in different modes
116 // are overridden in subclasses to perform the correct motion. Since
117 // they might be called from OnTimer, they do not have mouse coord parameters
118 // (use interactor's GetEventPosition and GetLastEventPosition)
119 virtual void WindowLevel();
120 virtual void Pick();
121 virtual void Slice();
122
123 // Interaction mode entry points used internally.
124 virtual void StartWindowLevel();
125 virtual void EndWindowLevel();
126 virtual void StartPick();
127 virtual void EndPick();
128 virtual void StartSlice();
129 virtual void EndSlice();
130
132
139 vtkGetMacro(InteractionMode, int);
144
146
150 vtkSetVector3Macro(XViewRightVector, double);
151 vtkGetVector3Macro(XViewRightVector, double);
152 vtkSetVector3Macro(XViewUpVector, double);
153 vtkGetVector3Macro(XViewUpVector, double);
154 vtkSetVector3Macro(YViewRightVector, double);
155 vtkGetVector3Macro(YViewRightVector, double);
156 vtkSetVector3Macro(YViewUpVector, double);
157 vtkGetVector3Macro(YViewUpVector, double);
158 vtkSetVector3Macro(ZViewRightVector, double);
159 vtkGetVector3Macro(ZViewRightVector, double);
160 vtkSetVector3Macro(ZViewUpVector, double);
161 vtkGetVector3Macro(ZViewUpVector, double);
163
173 void SetImageOrientation(const double leftToRight[3], const double bottomToTop[3]);
174
185 virtual void SetCurrentImageNumber(int i);
187
195
196protected:
199
205
208 double XViewUpVector[3];
210 double YViewUpVector[3];
212 double ZViewUpVector[3];
213
214private:
216 void operator=(const vtkInteractorStyleImage&) = delete;
217};
218
219#endif
image display properties
a simple class to control print indentation
Definition vtkIndent.h:34
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