VTK
dox/Rendering/OpenGL/vtkTDxUnixDevice.h
Go to the documentation of this file.
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 "vtkRenderingOpenGLModule.h" // For export macro
00031 #include "vtkTDxDevice.h"
00032 //#include <X11/Xlib.h> // Needed for X types used in the public interface
00033 class vtkRenderWindowInteractor;
00034 
00035 // We cannot include <X11/Xlib.h> (which defines "Display *",
00036 // "Window" and "XEvent *") because it defines macro like None that would
00037 // conflict with qt4/Qt/qcoreevent.h which defines None as a QEvent::Type
00038 // value.
00039 typedef void vtkTDxUnixDeviceDisplay;
00040 typedef unsigned int vtkTDxUnixDeviceWindow;
00041 typedef void vtkTDxUnixDeviceXEvent;
00042 
00043 class VTKRENDERINGOPENGL_EXPORT vtkTDxUnixDevice : public vtkTDxDevice
00044 {
00045 public:
00046   static vtkTDxUnixDevice *New();
00047   vtkTypeMacro(vtkTDxUnixDevice,vtkTDxDevice);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00052   vtkTDxUnixDeviceDisplay *GetDisplayId() const;
00053 
00056   vtkTDxUnixDeviceWindow GetWindowId() const;
00057 
00060   void SetDisplayId(vtkTDxUnixDeviceDisplay *id);
00061 
00064   void SetWindowId(vtkTDxUnixDeviceWindow id);
00065 
00076   void Initialize();
00077 
00079   virtual void Close();
00080 
00087   bool ProcessEvent(const vtkTDxUnixDeviceXEvent *e);
00088 
00090 
00092   vtkGetMacro(TranslationScale,double);
00093   vtkSetMacro(TranslationScale,double);
00095 
00097 
00099   vtkGetMacro(RotationScale,double);
00100   vtkSetMacro(RotationScale,double);
00102 
00105   void SetSensitivity(double sensitivity);
00106 
00107 protected:
00110   vtkTDxUnixDevice();
00111 
00114   virtual ~vtkTDxUnixDevice();
00115 
00116   vtkTDxUnixDeviceDisplay *DisplayId;
00117   vtkTDxUnixDeviceWindow WindowId;
00118 
00119   double TranslationScale;
00120   double RotationScale;
00121 
00122 private:
00123   vtkTDxUnixDevice(const vtkTDxUnixDevice&);  // Not implemented.
00124   void operator=(const vtkTDxUnixDevice&);  // Not implemented.
00125 };
00126 
00127 #endif