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:
90  static vtkInteractorStyleImage *New();
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 
136  vtkSetClampMacro(InteractionMode, int, VTKIS_IMAGE2D, VTKIS_IMAGE_SLICING);
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 
187  void SetCurrentImageToNthImage(int i);
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
#define VTKIS_IMAGE2D
void PrintSelf(ostream &os, vtkIndent indent)
vtkImageProperty * GetCurrentImageProperty()
#define VTKINTERACTIONSTYLE_EXPORT
image display properties
static vtkInteractorStyleTrackballCamera * New()
interactive manipulation of the camera specialized for images
#define VTKIS_IMAGE3D
vtkImageProperty * CurrentImageProperty
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKIS_IMAGE_SLICING
virtual void OnChar()
interactive manipulation of the camera