00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkInteractorStyleJoystickActor.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 =========================================================================*/ 00036 #ifndef __vtkInteractorStyleJoystickActor_h 00037 #define __vtkInteractorStyleJoystickActor_h 00038 00039 #include "vtkInteractorStyle.h" 00040 00041 class vtkCellPicker; 00042 00043 // motion flags 00044 00045 class VTK_RENDERING_EXPORT vtkInteractorStyleJoystickActor : public vtkInteractorStyle 00046 { 00047 public: 00048 static vtkInteractorStyleJoystickActor *New(); 00049 00050 vtkTypeRevisionMacro(vtkInteractorStyleJoystickActor,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 vtkInteractorStyleJoystickActor(); 00077 ~vtkInteractorStyleJoystickActor(); 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 vtkInteractorStyleJoystickActor(const vtkInteractorStyleJoystickActor&); // Not implemented. 00094 void operator=(const vtkInteractorStyleJoystickActor&); // Not implemented. 00095 }; 00096 00097 #endif