OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkInteractorStyleImage.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkInteractorStyleImage.h,v $
5   Language:  C++
6   Date:      $Date: 2002/05/01 04:56:53 $
7   Version:   $Revision: 1.14 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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
34 //
35 // Note that the renderer's actors are not moved; instead the camera is moved.
36
37 // .SECTION See Also
38 // vtkInteractorStyle vtkInteractorStyleTrackballActor 
39 // vtkInteractorStyleJoystickCamera vtkInteractorStyleJoystickActor
40
41 #ifndef __vtkInteractorStyleImage_h
42 #define __vtkInteractorStyleImage_h
43
44 #include "vtkInteractorStyleTrackballCamera.h"
45
46 // Motion flags
47
48 #define VTKIS_WINDOW_LEVEL 1024
49 #define VTKIS_PICK         1025
50
51 class VTK_RENDERING_EXPORT vtkInteractorStyleImage : public vtkInteractorStyleTrackballCamera
52 {
53 public:
54   static vtkInteractorStyleImage *New();
55   vtkTypeRevisionMacro(vtkInteractorStyleImage, vtkInteractorStyleTrackballCamera);
56   void PrintSelf(ostream& os, vtkIndent indent);
57
58   // Description:
59   // Some useful information for handling window level
60   vtkGetVector2Macro(WindowLevelStartPosition,int);
61   vtkGetVector2Macro(WindowLevelCurrentPosition,int);
62   
63   // Description:
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();
71
72   // Description:
73   // Override the "fly-to" (f keypress) for images.
74   virtual void OnChar();
75
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();
81   virtual void Pick();
82   
83   // Interaction mode entry points used internally.  
84   virtual void StartWindowLevel();
85   virtual void EndWindowLevel();
86   virtual void StartPick();
87   virtual void EndPick();
88
89 protected:
90   vtkInteractorStyleImage();
91   ~vtkInteractorStyleImage();
92
93   int WindowLevelStartPosition[2];
94   int WindowLevelCurrentPosition[2];
95  
96 private:
97   vtkInteractorStyleImage(const vtkInteractorStyleImage&);  // Not implemented.
98   void operator=(const vtkInteractorStyleImage&);  // Not implemented.
99 };
100
101 #endif