Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Rendering/vtkInteractorStyleJoystickActor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInteractorStyleJoystickActor.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00040 #ifndef __vtkInteractorStyleJoystickActor_h
00041 #define __vtkInteractorStyleJoystickActor_h
00042 
00043 #include "vtkInteractorStyle.h"
00044 
00045 class vtkCellPicker;
00046 
00047 // motion flags
00048 
00049 class VTK_RENDERING_EXPORT vtkInteractorStyleJoystickActor : public vtkInteractorStyle
00050 {
00051 public:
00052   static vtkInteractorStyleJoystickActor *New();
00053 
00054   vtkTypeRevisionMacro(vtkInteractorStyleJoystickActor,vtkInteractorStyle);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00060   virtual void OnMouseMove();
00061   virtual void OnLeftButtonDown();
00062   virtual void OnLeftButtonUp();
00063   virtual void OnMiddleButtonDown();
00064   virtual void OnMiddleButtonUp();
00065   virtual void OnRightButtonDown();
00066   virtual void OnRightButtonUp();
00068 
00069   // These methods for the different interactions in different modes
00070   // are overridden in subclasses to perform the correct motion. Since
00071   // they might be called from 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   virtual void UniformScale();
00078 
00079 protected:
00080   vtkInteractorStyleJoystickActor();
00081   ~vtkInteractorStyleJoystickActor();
00082 
00083   void FindPickedActor(int x, int y);
00084 
00085   void Prop3DTransform(vtkProp3D *prop3D, 
00086                        double *boxCenter,
00087                        int numRotation, 
00088                        double **rotate,
00089                        double *scale);
00090 
00091   void Prop3DTransform(vtkProp3D *prop3D,
00092                        float *boxCenter,
00093                        int NumRotation,
00094                        double **rotate,
00095                        double *scale);
00096   
00097   float MotionFactor;
00098 
00099   vtkProp3D *InteractionProp;
00100   vtkCellPicker *InteractionPicker;
00101 
00102 private:
00103   vtkInteractorStyleJoystickActor(const vtkInteractorStyleJoystickActor&);  // Not implemented.
00104   void operator=(const vtkInteractorStyleJoystickActor&);  // Not implemented.
00105 };
00106 
00107 #endif