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