00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTDxUnixDevice.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 =========================================================================*/ 00027 #ifndef __vtkTDxUnixDevice_h 00028 #define __vtkTDxUnixDevice_h 00029 00030 #include "vtkTDxDevice.h" 00031 //#include <X11/Xlib.h> // Needed for X types used in the public interface 00032 class vtkRenderWindowInteractor; 00033 00034 // We cannot include <X11/Xlib.h> (which defines "Display *", 00035 // "Window" and "XEvent *") because it defines macro like None that would 00036 // conflict with qt4/Qt/qcoreevent.h which defines None as a QEvent::Type 00037 // value. 00038 typedef void vtkTDxUnixDeviceDisplay; 00039 typedef unsigned int vtkTDxUnixDeviceWindow; 00040 typedef void vtkTDxUnixDeviceXEvent; 00041 00042 class VTK_RENDERING_EXPORT vtkTDxUnixDevice : public vtkTDxDevice 00043 { 00044 public: 00045 static vtkTDxUnixDevice *New(); 00046 vtkTypeMacro(vtkTDxUnixDevice,vtkTDxDevice); 00047 void PrintSelf(ostream& os, vtkIndent indent); 00048 00051 vtkTDxUnixDeviceDisplay *GetDisplayId() const; 00052 00055 vtkTDxUnixDeviceWindow GetWindowId() const; 00056 00059 void SetDisplayId(vtkTDxUnixDeviceDisplay *id); 00060 00063 void SetWindowId(vtkTDxUnixDeviceWindow id); 00064 00072 void Initialize(); 00073 00075 virtual void Close(); 00076 00082 bool ProcessEvent(const vtkTDxUnixDeviceXEvent *e); 00083 00085 00087 vtkGetMacro(TranslationScale,double); 00088 vtkSetMacro(TranslationScale,double); 00090 00092 00094 vtkGetMacro(RotationScale,double); 00095 vtkSetMacro(RotationScale,double); 00097 00100 void SetSensitivity(double sensitivity); 00101 00102 protected: 00105 vtkTDxUnixDevice(); 00106 00109 virtual ~vtkTDxUnixDevice(); 00110 00111 vtkTDxUnixDeviceDisplay *DisplayId; 00112 vtkTDxUnixDeviceWindow WindowId; 00113 00114 double TranslationScale; 00115 double RotationScale; 00116 00117 private: 00118 vtkTDxUnixDevice(const vtkTDxUnixDevice&); // Not implemented. 00119 void operator=(const vtkTDxUnixDevice&); // Not implemented. 00120 }; 00121 00122 #endif