VTK
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 =========================================================================*/
65 #ifndef vtkInteractorStyleImage_h
66 #define vtkInteractorStyleImage_h
67 
68 #include "vtkInteractionStyleModule.h" // For export macro
70 
71 // Motion flags
72 
73 #define VTKIS_WINDOW_LEVEL 1024
74 #define VTKIS_PICK 1025
75 #define VTKIS_SLICE 1026
76 
77 // Style flags
78 
79 #define VTKIS_IMAGE2D 2
80 #define VTKIS_IMAGE3D 3
81 #define VTKIS_IMAGE_SLICING 4
82 
83 class vtkImageProperty;
84 
85 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleImage : public vtkInteractorStyleTrackballCamera
86 {
87 public:
90  void PrintSelf(ostream& os, vtkIndent indent);
91 
93 
96  vtkGetVector2Macro(WindowLevelStartPosition,int);
97  vtkGetVector2Macro(WindowLevelCurrentPosition,int);
99 
101 
105  virtual void OnMouseMove();
106  virtual void OnLeftButtonDown();
107  virtual void OnLeftButtonUp();
108  virtual void OnMiddleButtonDown();
109  virtual void OnMiddleButtonUp();
110  virtual void OnRightButtonDown();
111  virtual void OnRightButtonUp();
113 
117  virtual void OnChar();
118 
119  // These methods for the different interactions in different modes
120  // are overridden in subclasses to perform the correct motion. Since
121  // they might be called from OnTimer, they do not have mouse coord parameters
122  // (use interactor's GetEventPosition and GetLastEventPosition)
123  virtual void WindowLevel();
124  virtual void Pick();
125  virtual void Slice();
126 
127  // Interaction mode entry points used internally.
128  virtual void StartWindowLevel();
129  virtual void EndWindowLevel();
130  virtual void StartPick();
131  virtual void EndPick();
132  virtual void StartSlice();
133  virtual void EndSlice();
134 
136 
142  vtkSetClampMacro(InteractionMode, int, VTKIS_IMAGE2D, VTKIS_IMAGE_SLICING);
143  vtkGetMacro(InteractionMode, int);
145  this->SetInteractionMode(VTKIS_IMAGE2D); }
147  this->SetInteractionMode(VTKIS_IMAGE3D); }
149  this->SetInteractionMode(VTKIS_IMAGE_SLICING); }
151 
153 
157  vtkSetVector3Macro(XViewRightVector, double);
158  vtkGetVector3Macro(XViewRightVector, double);
159  vtkSetVector3Macro(XViewUpVector, double);
160  vtkGetVector3Macro(XViewUpVector, double);
161  vtkSetVector3Macro(YViewRightVector, double);
162  vtkGetVector3Macro(YViewRightVector, double);
163  vtkSetVector3Macro(YViewUpVector, double);
164  vtkGetVector3Macro(YViewUpVector, double);
165  vtkSetVector3Macro(ZViewRightVector, double);
166  vtkGetVector3Macro(ZViewRightVector, double);
167  vtkSetVector3Macro(ZViewUpVector, double);
168  vtkGetVector3Macro(ZViewUpVector, double);
170 
180  void SetImageOrientation(const double leftToRight[3],
181  const double bottomToTop[3]);
182 
193  virtual void SetCurrentImageNumber(int i);
194  int GetCurrentImageNumber() { return this->CurrentImageNumber; }
195 
203  return this->CurrentImageProperty; }
204 
205 protected:
208 
209  int WindowLevelStartPosition[2];
210  int WindowLevelCurrentPosition[2];
211  double WindowLevelInitial[2];
214 
216  double XViewRightVector[3];
217  double XViewUpVector[3];
218  double YViewRightVector[3];
219  double YViewUpVector[3];
220  double ZViewRightVector[3];
221  double ZViewUpVector[3];
222 
223 private:
224  vtkInteractorStyleImage(const vtkInteractorStyleImage&) VTK_DELETE_FUNCTION;
225  void operator=(const vtkInteractorStyleImage&) VTK_DELETE_FUNCTION;
226 };
227 
228 #endif
VTKIS_IMAGE_SLICING
#define VTKIS_IMAGE_SLICING
Definition: vtkInteractorStyleImage.h:81
vtkInteractorStyleImage::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkInteractorStyleImage::StartPick
virtual void StartPick()
vtkInteractorStyleImage::Pick
virtual void Pick()
VTKIS_IMAGE2D
#define VTKIS_IMAGE2D
Definition: vtkInteractorStyleImage.h:79
vtkInteractorStyleImage::OnMouseMove
virtual void OnMouseMove()
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
vtkInteractorStyleImage::SetCurrentImageNumber
virtual void SetCurrentImageNumber(int i)
Set the image to use for WindowLevel interaction.
vtkInteractorStyleImage::SetInteractionModeToImageSlicing
void SetInteractionModeToImageSlicing()
Definition: vtkInteractorStyleImage.h:148
vtkInteractorStyleImage::CurrentImageNumber
int CurrentImageNumber
Definition: vtkInteractorStyleImage.h:213
vtkInteractorStyleImage::SetInteractionModeToImage2D
void SetInteractionModeToImage2D()
Definition: vtkInteractorStyleImage.h:144
vtkInteractorStyleImage::OnRightButtonUp
virtual void OnRightButtonUp()
vtkInteractorStyleImage
interactive manipulation of the camera specialized for images
Definition: vtkInteractorStyleImage.h:86
vtkInteractorStyleImage::New
static vtkInteractorStyleImage * New()
vtkInteractorStyleImage::OnLeftButtonUp
virtual void OnLeftButtonUp()
vtkInteractorStyleImage::OnMiddleButtonDown
virtual void OnMiddleButtonDown()
vtkInteractorStyleImage::InteractionMode
int InteractionMode
Definition: vtkInteractorStyleImage.h:215
VTKIS_IMAGE3D
#define VTKIS_IMAGE3D
Definition: vtkInteractorStyleImage.h:80
vtkInteractorStyleImage::WindowLevel
virtual void WindowLevel()
vtkInteractorStyleImage::Slice
virtual void Slice()
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:43
vtkInteractorStyleImage::GetCurrentImageProperty
vtkImageProperty * GetCurrentImageProperty()
Get the current image property, which is set when StartWindowLevel is called immediately before Start...
Definition: vtkInteractorStyleImage.h:202
vtkInteractorStyleImage::StartWindowLevel
virtual void StartWindowLevel()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkInteractorStyleImage::OnMiddleButtonUp
virtual void OnMiddleButtonUp()
vtkInteractorStyleImage::OnLeftButtonDown
virtual void OnLeftButtonDown()
vtkInteractorStyleImage::vtkInteractorStyleImage
vtkInteractorStyleImage()
vtkInteractorStyleImage::EndPick
virtual void EndPick()
vtkInteractorStyleImage::EndSlice
virtual void EndSlice()
vtkInteractorStyleImage::~vtkInteractorStyleImage
~vtkInteractorStyleImage()
vtkInteractorStyleTrackballCamera
interactive manipulation of the camera
Definition: vtkInteractorStyleTrackballCamera.h:48
vtkInteractorStyleImage::StartSlice
virtual void StartSlice()
vtkInteractorStyleImage::SetImageOrientation
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.
vtkInteractorStyleImage::EndWindowLevel
virtual void EndWindowLevel()
vtkInteractorStyleImage::CurrentImageProperty
vtkImageProperty * CurrentImageProperty
Definition: vtkInteractorStyleImage.h:212
vtkX3D::leftToRight
@ leftToRight
Definition: vtkX3D.h:391
vtkInteractorStyleImage::OnRightButtonDown
virtual void OnRightButtonDown()
vtkInteractorStyleImage::GetCurrentImageNumber
int GetCurrentImageNumber()
Definition: vtkInteractorStyleImage.h:194
vtkInteractorStyleImage::SetInteractionModeToImage3D
void SetInteractionModeToImage3D()
Definition: vtkInteractorStyleImage.h:146
vtkInteractorStyleImage::OnChar
virtual void OnChar()
Override the "fly-to" (f keypress) for images.
vtkInteractorStyleTrackballCamera.h