1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkInteractorStyleImage.h,v $
6 Date: $Date: 2002/05/01 04:56:53 $
7 Version: $Revision: 1.14 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkInteractorStyleImage - interactive manipulation of the camera specialized for images
19 // .SECTION Description
20 // vtkInteractorStyleImage allows the user to interactively manipulate
21 // (rotate, pan, zoomm etc.) the camera. vtkInteractorStyleImage is specially
22 // designed to work with images that are being rendered with
23 // vtkImageActor. Several events are overloaded from its superclass
24 // vtkInteractorStyle, hence the mouse bindings are different. (The bindings
25 // keep the camera's view plane normal perpendicular to the x-y plane.) In
26 // summary the mouse events are as follows:
27 // + Left Mouse button triggers window level events
28 // + CTRL Left Mouse spins the camera around its view plane normal
29 // + SHIFT Left Mouse pans the camera
30 // + CTRL SHIFT Left Mouse dollys (a positional zoom) the camera
31 // + Middle mouse button pans the camera
32 // + Right mouse button dollys the camera.
33 // + SHIFT Right Mouse triggers pick events
35 // Note that the renderer's actors are not moved; instead the camera is moved.
38 // vtkInteractorStyle vtkInteractorStyleTrackballActor
39 // vtkInteractorStyleJoystickCamera vtkInteractorStyleJoystickActor
41 #ifndef __vtkInteractorStyleImage_h
42 #define __vtkInteractorStyleImage_h
44 #include "vtkInteractorStyleTrackballCamera.h"
48 #define VTKIS_WINDOW_LEVEL 1024
49 #define VTKIS_PICK 1025
51 class VTK_RENDERING_EXPORT vtkInteractorStyleImage : public vtkInteractorStyleTrackballCamera
54 static vtkInteractorStyleImage *New();
55 vtkTypeRevisionMacro(vtkInteractorStyleImage, vtkInteractorStyleTrackballCamera);
56 void PrintSelf(ostream& os, vtkIndent indent);
59 // Some useful information for handling window level
60 vtkGetVector2Macro(WindowLevelStartPosition,int);
61 vtkGetVector2Macro(WindowLevelCurrentPosition,int);
64 // Event bindings controlling the effects of pressing mouse buttons
65 // or moving the mouse.
66 virtual void OnMouseMove();
67 virtual void OnLeftButtonDown();
68 virtual void OnLeftButtonUp();
69 virtual void OnRightButtonDown();
70 virtual void OnRightButtonUp();
73 // Override the "fly-to" (f keypress) for images.
74 virtual void OnChar();
76 // These methods for the different interactions in different modes
77 // are overridden in subclasses to perform the correct motion. Since
78 // they might be called from OnTimer, they do not have mouse coord parameters
79 // (use interactor's GetEventPosition and GetLastEventPosition)
80 virtual void WindowLevel();
83 // Interaction mode entry points used internally.
84 virtual void StartWindowLevel();
85 virtual void EndWindowLevel();
86 virtual void StartPick();
87 virtual void EndPick();
90 vtkInteractorStyleImage();
91 ~vtkInteractorStyleImage();
93 int WindowLevelStartPosition[2];
94 int WindowLevelCurrentPosition[2];
97 vtkInteractorStyleImage(const vtkInteractorStyleImage&); // Not implemented.
98 void operator=(const vtkInteractorStyleImage&); // Not implemented.