GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vtkInteractorStyleImage2D.h
Go to the documentation of this file.
1 /*========================================================================
2  Copyright (c) INRIA - ASCLEPIOS Project (http://www-sop.inria.fr/asclepios).
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10 
11  * Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  * Neither the name of INRIA or ASCLEPIOS, nor the names of any contributors
16  may be used to endorse or promote products derived from this software
17  without specific prior written permission.
18 
19  * Modified source versions must be plainly marked as such, and must not be
20  misrepresented as being the original software.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
23  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
26  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  =========================================================================*/
33 
34 /*=========================================================================
35  Modifications were made by the GoFigure Dev. Team.
36  while at Megason Lab, Systems biology, Harvard Medical school, 2009-11
37 
38  Copyright (c) 2009-11, President and Fellows of Harvard College.
39  All rights reserved.
40 
41  Redistribution and use in source and binary forms, with or without
42  modification, are permitted provided that the following conditions are met:
43 
44  Redistributions of source code must retain the above copyright notice,
45  this list of conditions and the following disclaimer.
46  Redistributions in binary form must reproduce the above copyright notice,
47  this list of conditions and the following disclaimer in the documentation
48  and/or other materials provided with the distribution.
49  Neither the name of the President and Fellows of Harvard College
50  nor the names of its contributors may be used to endorse or promote
51  products derived from this software without specific prior written
52  permission.
53 
54  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
56  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
58  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
59  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
60  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
61  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
62  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
63  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
64  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 
66  =========================================================================*/
67 
68 #ifndef _vtk_InteractorStyleImage2D_h_
69 #define _vtk_InteractorStyleImage2D_h_
70 
71 #include <vtkInteractorStyleImage.h>
72 #include "MegaVTK2Configure.h"
73 
74 #include "vtkActor.h"
75 #include "vtkProp.h"
76 #include <vector>
77 
78 #define VTKIS_SLICE_MOVE 5051
79 
87 class VTK_RENDERINGADDON2_EXPORT vtkInteractorStyleImage2D:
88  public vtkInteractorStyleImage
89 {
90 public:
94  static vtkInteractorStyleImage2D * New();
95 
96  vtkTypeRevisionMacro (vtkInteractorStyleImage2D, vtkInteractorStyleImage);
97 
98  //BTX
100  InteractionTypeWindowLevel = 0,
104  InteractionTypeDefault
105  };
106 
107  virtual void OnMouseMove();
108 
109  virtual void OnLeftButtonDown();
110 
111  virtual void OnLeftButtonUp();
112 
113  virtual void OnMiddleButtonDown();
114 
115  virtual void OnMiddleButtonUp();
116 
117  virtual void OnRightButtonDown();
118 
119  virtual void OnRightButtonUp();
120 
121  virtual void OnMouseWheelForward();
122 
123  virtual void OnMouseWheelBackward();
124 
125  virtual void OnChar();
126 
127  virtual void OnKeyDown();
128 
129  virtual void OnKeyUp();
130 
131  virtual void OnKeyPress();
132 
133  virtual void OnKeyRelease();
134 
135  virtual void StartSliceMove();
136 
137  virtual void SliceMove();
138 
139  virtual void EndSliceMove();
140 
141  virtual void DefaultMoveAction();
142 
143  // Different modes
147  void SetDefaultMode();
148 
152  void SetZoomMode();
153 
157  void SetPanMode();
158 
162  void SetPickMode();
163 
167  void HighlightCurrentActor();
168 
169  vtkGetMacro(SliceStep, int);
171  { return this->RequestedPosition; }
172 
176  vtkProp * GetCurrentProp();
177 
178  /*
179  * \brief Synchronize the views
180  * \param[in] iSynchronize Enable/disable synchronization
181  */
182  void SynchronizeViews( bool iSynchronize);
183 
184  /*
185  * \brief Add plane actors to be able to get rid of them while picking,
186  * wireframe mode. and surface mode
187  * \param[in] iSynchronize Enable/disable synchronization
188  */
189  void SetPlanesActors( std::vector< vtkProp3D * > iBounds);
190 
191 protected:
194 
197 private:
198 
200  // implemented.
201  void operator=(const vtkInteractorStyleImage2D &); // Not
202  // implemented.
203 
204  unsigned int m_Mode;
207  std::vector< vtkProp3D * > m_PlanesActors;
208 };
209 
210 #endif
Define the interactor behavior withing a vtkImage2D. 4 modes (Default, Zoom, Pan and Pick) ...
std::vector< vtkProp3D * > m_PlanesActors