1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkInteractorStyleTrackballCamera.h,v $
6 Date: $Date: 2003/01/08 17:26:58 $
7 Version: $Revision: 1.16 $
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 vtkInteractorStyleTrackballCamera - interactive manipulation of the camera
19 // .SECTION Description
20 // vtkInteractorStyleTrackballCamera allows the user to interactively
21 // manipulate (rotate, pan, etc.) the camera, the viewpoint of the scene. In
22 // trackball interaction, the magnitude of the mouse motion is proportional
23 // to the camera motion associated with a particular mouse binding. For
24 // example, small left-button motions cause small changes in the rotation of
25 // the camera around its focal point. For a 3-button mouse, the left button
26 // is for rotation, the right button for zooming, the middle button for
27 // panning, and ctrl + left button for spinning. (With fewer mouse buttons,
28 // ctrl + shift + left button is for zooming, and shift + left button is for
32 // vtkInteractorStyleTrackballActor vtkInteractorStyleJoystickCamera
33 // vtkInteractorStyleJoystickActor
35 #ifndef __vtkInteractorStyleTrackballCamera_h
36 #define __vtkInteractorStyleTrackballCamera_h
38 #include "vtkInteractorStyle.h"
40 class VTK_RENDERING_EXPORT vtkInteractorStyleTrackballCamera : public vtkInteractorStyle
43 static vtkInteractorStyleTrackballCamera *New();
44 vtkTypeRevisionMacro(vtkInteractorStyleTrackballCamera,vtkInteractorStyle);
45 void PrintSelf(ostream& os, vtkIndent indent);
48 // Event bindings controlling the effects of pressing mouse buttons
49 // or moving the mouse.
50 virtual void OnMouseMove();
51 virtual void OnLeftButtonDown();
52 virtual void OnLeftButtonUp();
53 virtual void OnMiddleButtonDown();
54 virtual void OnMiddleButtonUp();
55 virtual void OnRightButtonDown();
56 virtual void OnRightButtonUp();
58 // These methods for the different interactions in different modes
59 // are overridden in subclasses to perform the correct motion. Since
60 // they are called by OnTimer, they do not have mouse coord parameters
61 // (use interactor's GetEventPosition and GetLastEventPosition)
62 virtual void Rotate();
68 vtkInteractorStyleTrackballCamera();
69 ~vtkInteractorStyleTrackballCamera();
74 vtkInteractorStyleTrackballCamera(const vtkInteractorStyleTrackballCamera&); // Not implemented.
75 void operator=(const vtkInteractorStyleTrackballCamera&); // Not implemented.