VTK
dox/Interaction/Style/vtkInteractorStyleSwitch.h
Go to the documentation of this file.
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 "vtkInteractionStyleModule.h" // For export macro
00038 #include "vtkInteractorStyleSwitchBase.h"
00039 
00040 #define VTKIS_JOYSTICK  0
00041 #define VTKIS_TRACKBALL 1
00042 
00043 #define VTKIS_CAMERA    0
00044 #define VTKIS_ACTOR     1
00045 
00046 class vtkInteractorStyleJoystickActor;
00047 class vtkInteractorStyleJoystickCamera;
00048 class vtkInteractorStyleTrackballActor;
00049 class vtkInteractorStyleTrackballCamera;
00050 
00051 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleSwitch
00052   : public vtkInteractorStyleSwitchBase
00053 {
00054 public:
00055   static vtkInteractorStyleSwitch *New();
00056   vtkTypeMacro(vtkInteractorStyleSwitch, vtkInteractorStyleSwitchBase);
00057   void PrintSelf(ostream& os, vtkIndent indent);
00058 
00060   void SetInteractor(vtkRenderWindowInteractor *iren);
00061 
00064   void SetAutoAdjustCameraClippingRange( int value );
00065 
00067 
00068   vtkGetObjectMacro(CurrentStyle, vtkInteractorStyle);
00069   void SetCurrentStyleToJoystickActor();
00070   void SetCurrentStyleToJoystickCamera();
00071   void SetCurrentStyleToTrackballActor();
00072   void SetCurrentStyleToTrackballCamera();
00074 
00077   virtual void OnChar();
00078 
00080 
00082   virtual void SetDefaultRenderer(vtkRenderer*);
00083   virtual void SetCurrentRenderer(vtkRenderer*);
00085 
00086 protected:
00087   vtkInteractorStyleSwitch();
00088   ~vtkInteractorStyleSwitch();
00089 
00090   void SetCurrentStyle();
00091 
00092   vtkInteractorStyleJoystickActor *JoystickActor;
00093   vtkInteractorStyleJoystickCamera *JoystickCamera;
00094   vtkInteractorStyleTrackballActor *TrackballActor;
00095   vtkInteractorStyleTrackballCamera *TrackballCamera;
00096   vtkInteractorStyle* CurrentStyle;
00097 
00098   int JoystickOrTrackball;
00099   int CameraOrActor;
00100 
00101 private:
00102   vtkInteractorStyleSwitch(const vtkInteractorStyleSwitch&);  // Not implemented.
00103   void operator=(const vtkInteractorStyleSwitch&);  // Not implemented.
00104 };
00105 
00106 #endif