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

vtkInteractorStyleSwitch.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInteractorStyleSwitch.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 =========================================================================*/
00046 #ifndef __vtkInteractorStyleSwitch_h
00047 #define __vtkInteractorStyleSwitch_h
00048 
00049 #include "vtkInteractorStyle.h"
00050 
00051 #define VTKIS_JOYSTICK  0
00052 #define VTKIS_TRACKBALL 1
00053 
00054 #define VTKIS_CAMERA    0
00055 #define VTKIS_ACTOR     1
00056 
00057 class vtkInteractorStyleJoystickActor;
00058 class vtkInteractorStyleJoystickCamera;
00059 class vtkInteractorStyleTrackballActor;
00060 class vtkInteractorStyleTrackballCamera;
00061 
00062 class VTK_RENDERING_EXPORT vtkInteractorStyleSwitch : public vtkInteractorStyle
00063 {
00064 public:
00065   static vtkInteractorStyleSwitch *New();
00066   vtkTypeRevisionMacro(vtkInteractorStyleSwitch, vtkInteractorStyle);
00067   void PrintSelf(ostream& os, vtkIndent indent);
00068 
00070   void SetInteractor(vtkRenderWindowInteractor *iren);
00071   
00074   void SetAutoAdjustCameraClippingRange( int value );
00075   
00077 
00078   vtkGetObjectMacro(CurrentStyle, vtkInteractorStyle);
00079   void SetCurrentStyleToJoystickActor();
00080   void SetCurrentStyleToJoystickCamera();
00081   void SetCurrentStyleToTrackballActor();
00082   void SetCurrentStyleToTrackballCamera();
00084 
00087   virtual void OnChar();
00088   
00089 protected:
00090   vtkInteractorStyleSwitch();
00091   ~vtkInteractorStyleSwitch();
00092   
00093   void SetCurrentStyle();
00094   
00095   vtkInteractorStyleJoystickActor *JoystickActor;
00096   vtkInteractorStyleJoystickCamera *JoystickCamera;
00097   vtkInteractorStyleTrackballActor *TrackballActor;
00098   vtkInteractorStyleTrackballCamera *TrackballCamera;
00099   vtkInteractorStyle* CurrentStyle;
00100 
00101   int JoystickOrTrackball;
00102   int CameraOrActor;
00103 
00104 private:
00105   vtkInteractorStyleSwitch(const vtkInteractorStyleSwitch&);  // Not implemented.
00106   void operator=(const vtkInteractorStyleSwitch&);  // Not implemented.
00107 };
00108 
00109 #endif