00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkInteractorStyleSwitch.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 =========================================================================*/ 00034 #ifndef __vtkInteractorStyleSwitch_h 00035 #define __vtkInteractorStyleSwitch_h 00036 00037 #include "vtkInteractorStyle.h" 00038 00039 #define VTKIS_JOYSTICK 0 00040 #define VTKIS_TRACKBALL 1 00041 00042 #define VTKIS_CAMERA 0 00043 #define VTKIS_ACTOR 1 00044 00045 class vtkInteractorStyleJoystickActor; 00046 class vtkInteractorStyleJoystickCamera; 00047 class vtkInteractorStyleTrackballActor; 00048 class vtkInteractorStyleTrackballCamera; 00049 00050 class VTK_RENDERING_EXPORT vtkInteractorStyleSwitch : public vtkInteractorStyle 00051 { 00052 public: 00053 static vtkInteractorStyleSwitch *New(); 00054 vtkTypeMacro(vtkInteractorStyleSwitch, vtkInteractorStyle); 00055 void PrintSelf(ostream& os, vtkIndent indent); 00056 00058 void SetInteractor(vtkRenderWindowInteractor *iren); 00059 00062 void SetAutoAdjustCameraClippingRange( int value ); 00063 00065 00066 vtkGetObjectMacro(CurrentStyle, vtkInteractorStyle); 00067 void SetCurrentStyleToJoystickActor(); 00068 void SetCurrentStyleToJoystickCamera(); 00069 void SetCurrentStyleToTrackballActor(); 00070 void SetCurrentStyleToTrackballCamera(); 00072 00075 virtual void OnChar(); 00076 00078 00080 virtual void SetDefaultRenderer(vtkRenderer*); 00081 virtual void SetCurrentRenderer(vtkRenderer*); 00083 00084 protected: 00085 vtkInteractorStyleSwitch(); 00086 ~vtkInteractorStyleSwitch(); 00087 00088 void SetCurrentStyle(); 00089 00090 vtkInteractorStyleJoystickActor *JoystickActor; 00091 vtkInteractorStyleJoystickCamera *JoystickCamera; 00092 vtkInteractorStyleTrackballActor *TrackballActor; 00093 vtkInteractorStyleTrackballCamera *TrackballCamera; 00094 vtkInteractorStyle* CurrentStyle; 00095 00096 int JoystickOrTrackball; 00097 int CameraOrActor; 00098 00099 private: 00100 vtkInteractorStyleSwitch(const vtkInteractorStyleSwitch&); // Not implemented. 00101 void operator=(const vtkInteractorStyleSwitch&); // Not implemented. 00102 }; 00103 00104 #endif