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 =========================================================================*/
67 #ifndef vtkInteractorStyleImage_h
68 #define vtkInteractorStyleImage_h
69 
70 #include "vtkInteractionStyleModule.h" // For export macro
72 
73 // Motion flags
74 
75 #define VTKIS_WINDOW_LEVEL 1024
76 #define VTKIS_PICK 1025
77 #define VTKIS_SLICE 1026
78 
79 // Style flags
80 
81 #define VTKIS_IMAGE2D 2
82 #define VTKIS_IMAGE3D 3
83 #define VTKIS_IMAGE_SLICING 4
84 
85 class vtkImageProperty;
86 
88 {
89 public:
92  void PrintSelf(ostream& os, vtkIndent indent);
93 
95 
96  vtkGetVector2Macro(WindowLevelStartPosition,int);
97  vtkGetVector2Macro(WindowLevelCurrentPosition,int);
99 
101 
103  virtual void OnMouseMove();
104  virtual void OnLeftButtonDown();
105  virtual void OnLeftButtonUp();
106  virtual void OnMiddleButtonDown();
107  virtual void OnMiddleButtonUp();
108  virtual void OnRightButtonDown();
109  virtual void OnRightButtonUp();
111 
113  virtual void OnChar();
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 
137  vtkGetMacro(InteractionMode, int);
139  this->SetInteractionMode(VTKIS_IMAGE2D); }
141  this->SetInteractionMode(VTKIS_IMAGE3D); }
143  this->SetInteractionMode(VTKIS_IMAGE_SLICING); }
145 
147 
149  vtkSetVector3Macro(XViewRightVector, double);
150  vtkGetVector3Macro(XViewRightVector, double);
151  vtkSetVector3Macro(XViewUpVector, double);
152  vtkGetVector3Macro(XViewUpVector, double);
153  vtkSetVector3Macro(YViewRightVector, double);
154  vtkGetVector3Macro(YViewRightVector, double);
155  vtkSetVector3Macro(YViewUpVector, double);
156  vtkGetVector3Macro(YViewUpVector, double);
157  vtkSetVector3Macro(ZViewRightVector, double);
158  vtkGetVector3Macro(ZViewRightVector, double);
159  vtkSetVector3Macro(ZViewUpVector, double);
160  vtkGetVector3Macro(ZViewUpVector, double);
162 
164 
170  void SetImageOrientation(const double leftToRight[3],
171  const double bottomToTop[3]);
173 
175 
180  return this->CurrentImageProperty; }
182 
183 protected:
186 
188 
189  int WindowLevelStartPosition[2];
190  int WindowLevelCurrentPosition[2];
191  double WindowLevelInitial[2];
193 
195  double XViewRightVector[3];
196  double XViewUpVector[3];
197  double YViewRightVector[3];
198  double YViewUpVector[3];
199  double ZViewRightVector[3];
200  double ZViewUpVector[3];
201 
202 private:
203  vtkInteractorStyleImage(const vtkInteractorStyleImage&); // Not implemented.
204  void operator=(const vtkInteractorStyleImage&); // Not implemented.
205 };
206 
207 #endif
VTKIS_IMAGE_SLICING
#define VTKIS_IMAGE_SLICING
Definition: vtkInteractorStyleImage.h:83
vtkInteractorStyleImage::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkInteractorStyleImage::StartPick
virtual void StartPick()
vtkGetVector2Macro
#define vtkGetVector2Macro(name, type)
Definition: vtkSetGet.h:270
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkInteractorStyleImage::Pick
virtual void Pick()
VTKIS_IMAGE2D
#define VTKIS_IMAGE2D
Definition: vtkInteractorStyleImage.h:81
vtkInteractorStyleImage::OnMouseMove
virtual void OnMouseMove()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkInteractorStyleImage::SetInteractionModeToImageSlicing
void SetInteractionModeToImageSlicing()
Definition: vtkInteractorStyleImage.h:142
vtkInteractorStyleImage::SetInteractionModeToImage2D
void SetInteractionModeToImage2D()
Definition: vtkInteractorStyleImage.h:138
vtkInteractorStyleImage::OnRightButtonUp
virtual void OnRightButtonUp()
vtkInteractorStyleImage
interactive manipulation of the camera specialized for images
Definition: vtkInteractorStyleImage.h:88
vtkInteractorStyleImage::New
static vtkInteractorStyleImage * New()
VTKINTERACTIONSTYLE_EXPORT
#define VTKINTERACTIONSTYLE_EXPORT
Definition: vtkInteractionStyleModule.h:15
vtkInteractorStyleImage::OnLeftButtonUp
virtual void OnLeftButtonUp()
vtkInteractorStyleImage::OnMiddleButtonDown
virtual void OnMiddleButtonDown()
vtkInteractorStyleImage::InteractionMode
int InteractionMode
Definition: vtkInteractorStyleImage.h:194
VTKIS_IMAGE3D
#define VTKIS_IMAGE3D
Definition: vtkInteractorStyleImage.h:82
vtkInteractorStyleImage::WindowLevel
virtual void WindowLevel()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkInteractionStyleModule.h
vtkInteractorStyleImage::Slice
virtual void Slice()
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:42
vtkInteractorStyleImage::GetCurrentImageProperty
vtkImageProperty * GetCurrentImageProperty()
Definition: vtkInteractorStyleImage.h:179
vtkInteractorStyleImage::StartWindowLevel
virtual void StartWindowLevel()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInteractorStyleImage::OnMiddleButtonUp
virtual void OnMiddleButtonUp()
vtkInteractorStyleImage::OnLeftButtonDown
virtual void OnLeftButtonDown()
vtkInteractorStyleImage::vtkInteractorStyleImage
vtkInteractorStyleImage()
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkInteractorStyleImage::EndPick
virtual void EndPick()
vtkInteractorStyleImage::EndSlice
virtual void EndSlice()
vtkInteractorStyleImage::~vtkInteractorStyleImage
~vtkInteractorStyleImage()
vtkInteractorStyleTrackballCamera
interactive manipulation of the camera
Definition: vtkInteractorStyleTrackballCamera.h:50
vtkInteractorStyleImage::StartSlice
virtual void StartSlice()
vtkInteractorStyleImage::SetImageOrientation
void SetImageOrientation(const double leftToRight[3], const double bottomToTop[3])
vtkInteractorStyleImage::EndWindowLevel
virtual void EndWindowLevel()
vtkInteractorStyleImage::CurrentImageProperty
vtkImageProperty * CurrentImageProperty
Definition: vtkInteractorStyleImage.h:192
vtkX3D::leftToRight
@ leftToRight
Definition: vtkX3D.h:391
vtkInteractorStyleImage::OnRightButtonDown
virtual void OnRightButtonDown()
vtkInteractorStyleImage::SetCurrentImageToNthImage
void SetCurrentImageToNthImage(int i)
vtkInteractorStyleImage::SetInteractionModeToImage3D
void SetInteractionModeToImage3D()
Definition: vtkInteractorStyleImage.h:140
vtkInteractorStyleImage::OnChar
virtual void OnChar()
vtkInteractorStyleTrackballCamera.h