00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkInteractorStyleTrackballActor.h,v $ 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 =========================================================================*/ 00039 #ifndef __vtkInteractorStyleTrackballActor_h 00040 #define __vtkInteractorStyleTrackballActor_h 00041 00042 #include "vtkInteractorStyle.h" 00043 00044 class vtkCellPicker; 00045 00046 class VTK_RENDERING_EXPORT vtkInteractorStyleTrackballActor : public vtkInteractorStyle 00047 { 00048 public: 00049 static vtkInteractorStyleTrackballActor *New(); 00050 vtkTypeRevisionMacro(vtkInteractorStyleTrackballActor,vtkInteractorStyle); 00051 void PrintSelf(ostream& os, vtkIndent indent); 00052 00054 00056 virtual void OnMouseMove(); 00057 virtual void OnLeftButtonDown(); 00058 virtual void OnLeftButtonUp(); 00059 virtual void OnMiddleButtonDown(); 00060 virtual void OnMiddleButtonUp(); 00061 virtual void OnRightButtonDown(); 00062 virtual void OnRightButtonUp(); 00064 00065 // These methods for the different interactions in different modes 00066 // are overridden in subclasses to perform the correct motion. Since 00067 // they might be called from OnTimer, they do not have mouse coord parameters 00068 // (use interactor's GetEventPosition and GetLastEventPosition) 00069 virtual void Rotate(); 00070 virtual void Spin(); 00071 virtual void Pan(); 00072 virtual void Dolly(); 00073 virtual void UniformScale(); 00074 00075 protected: 00076 vtkInteractorStyleTrackballActor(); 00077 ~vtkInteractorStyleTrackballActor(); 00078 00079 void FindPickedActor(int x, int y); 00080 00081 void Prop3DTransform(vtkProp3D *prop3D, 00082 double *boxCenter, 00083 int NumRotation, 00084 double **rotate, 00085 double *scale); 00086 00087 double MotionFactor; 00088 00089 vtkProp3D *InteractionProp; 00090 vtkCellPicker *InteractionPicker; 00091 00092 private: 00093 vtkInteractorStyleTrackballActor(const vtkInteractorStyleTrackballActor&); // Not implemented. 00094 void operator=(const vtkInteractorStyleTrackballActor&); // Not implemented. 00095 }; 00096 00097 #endif