00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXOpenGLRenderWindow.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 =========================================================================*/ 00047 #ifndef __vtkXOpenGLRenderWindow_h 00048 #define __vtkXOpenGLRenderWindow_h 00049 00050 #include "vtkOpenGLRenderWindow.h" 00051 #include <X11/Xlib.h> // Needed for X types used in the public interface 00052 #include <X11/Xutil.h> // Needed for X types used in the public interface 00053 00054 class vtkIdList; 00055 class vtkXOpenGLRenderWindowInternal; 00056 00057 class VTK_RENDERING_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow 00058 { 00059 public: 00060 static vtkXOpenGLRenderWindow *New(); 00061 vtkTypeRevisionMacro(vtkXOpenGLRenderWindow,vtkOpenGLRenderWindow); 00062 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 virtual void Start(void); 00066 00068 virtual void Frame(void); 00069 00071 virtual void WindowInitialize(void); 00072 00077 virtual void Initialize(void); 00078 00083 virtual void Finalize(void); 00084 00086 virtual void SetFullScreen(int); 00087 00089 virtual void WindowRemap(void); 00090 00092 virtual void PrefFullScreen(void); 00093 00095 00096 virtual void SetSize(int,int); 00097 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);}; 00099 00101 00102 virtual Colormap GetDesiredColormap(); 00103 virtual Visual *GetDesiredVisual(); 00104 virtual XVisualInfo *GetDesiredVisualInfo(); 00105 virtual int GetDesiredDepth(); 00107 00112 virtual void SetStereoCapableWindow(int capable); 00113 00115 void MakeCurrent(); 00116 00120 void SetForceMakeCurrent(); 00121 00123 const char *ReportCapabilities(); 00124 00126 int SupportsOpenGL(); 00127 00129 int IsDirect(); 00130 00132 00133 virtual void *GetGenericDisplayId() {return (void *)this->GetDisplayId();}; 00134 virtual void *GetGenericWindowId(); 00135 virtual void *GetGenericParentId() {return (void *)this->ParentId;}; 00136 virtual void *GetGenericContext(); 00137 virtual void *GetGenericDrawable() {return (void *)this->WindowId;}; 00139 00141 virtual int *GetScreenSize(); 00142 00144 virtual int *GetPosition(); 00145 00147 Display *GetDisplayId(); 00148 00150 00152 void SetDisplayId(Display *); 00153 void SetDisplayId(void *); 00155 00157 Window GetParentId(); 00158 00160 00161 void SetParentId(Window); 00162 void SetParentId(void *); 00164 00166 Window GetWindowId(); 00167 00169 00170 void SetWindowId(Window); 00171 void SetWindowId(void *); 00173 00175 void SetNextWindowId(Window); 00176 00179 void SetNextWindowId(void *); 00180 00181 void SetWindowName(const char *); 00182 00184 00185 void SetPosition(int,int); 00186 void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);}; 00188 00190 00192 void HideCursor(); 00193 void ShowCursor(); 00195 00197 virtual void SetCurrentCursor(int); 00198 00202 virtual int GetEventPending(); 00203 00205 void SetWindowInfo(char *info); 00206 00208 void SetNextWindowInfo(char *info); 00209 00211 void SetParentInfo(char *info); 00212 00215 void Render(); 00216 00218 void SetOffScreenRendering(int i); 00219 00220 protected: 00221 vtkXOpenGLRenderWindow(); 00222 ~vtkXOpenGLRenderWindow(); 00223 00224 vtkXOpenGLRenderWindowInternal *Internal; 00225 00226 Window ParentId; 00227 Window WindowId; 00228 Window NextWindowId; 00229 Display *DisplayId; 00230 Colormap ColorMap; 00231 int OwnWindow; 00232 int OwnDisplay; 00233 int ScreenSize[2]; 00234 int CursorHidden; 00235 int ForceMakeCurrent; 00236 int UsingHardware; 00237 char *Capabilities; 00238 00239 // we must keep track of the cursors we are using 00240 Cursor XCArrow; 00241 Cursor XCSizeAll; 00242 Cursor XCSizeNS; 00243 Cursor XCSizeWE; 00244 Cursor XCSizeNE; 00245 Cursor XCSizeNW; 00246 Cursor XCSizeSE; 00247 Cursor XCSizeSW; 00248 00249 private: 00250 vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&); // Not implemented. 00251 void operator=(const vtkXOpenGLRenderWindow&); // Not implemented. 00252 }; 00253 00254 00255 00256 #endif