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