00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkInteractorStyleTrackballCamera.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00043 #ifndef __vtkInteractorStyleTrackballCamera_h 00044 #define __vtkInteractorStyleTrackballCamera_h 00045 00046 #include "vtkInteractorStyle.h" 00047 00048 class VTK_RENDERING_EXPORT vtkInteractorStyleTrackballCamera : public vtkInteractorStyle 00049 { 00050 public: 00051 static vtkInteractorStyleTrackballCamera *New(); 00052 vtkTypeMacro(vtkInteractorStyleTrackballCamera,vtkInteractorStyle); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00056 00058 virtual void OnMouseMove(); 00059 virtual void OnLeftButtonDown(); 00060 virtual void OnLeftButtonUp(); 00061 virtual void OnMiddleButtonDown(); 00062 virtual void OnMiddleButtonUp(); 00063 virtual void OnRightButtonDown(); 00064 virtual void OnRightButtonUp(); 00065 virtual void OnMouseWheelForward(); 00066 virtual void OnMouseWheelBackward(); 00068 00069 // These methods for the different interactions in different modes 00070 // are overridden in subclasses to perform the correct motion. Since 00071 // they are called by OnTimer, they do not have mouse coord parameters 00072 // (use interactor's GetEventPosition and GetLastEventPosition) 00073 virtual void Rotate(); 00074 virtual void Spin(); 00075 virtual void Pan(); 00076 virtual void Dolly(); 00077 00079 00080 vtkSetMacro(MotionFactor,double); 00081 vtkGetMacro(MotionFactor,double); 00083 00084 protected: 00085 vtkInteractorStyleTrackballCamera(); 00086 ~vtkInteractorStyleTrackballCamera(); 00087 00088 double MotionFactor; 00089 00090 virtual void Dolly(double factor); 00091 00092 private: 00093 vtkInteractorStyleTrackballCamera(const vtkInteractorStyleTrackballCamera&); // Not implemented. 00094 void operator=(const vtkInteractorStyleTrackballCamera&); // Not implemented. 00095 }; 00096 00097 #endif