VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXOpenGLRenderWindow.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 vtkXOpenGLRenderWindow_h 00028 #define vtkXOpenGLRenderWindow_h 00029 00030 #include "vtkRenderingOpenGL2Module.h" // For export macro 00031 #include "vtkOpenGLRenderWindow.h" 00032 #include <X11/Xlib.h> // Needed for X types used in the public interface 00033 #include <X11/Xutil.h> // Needed for X types used in the public interface 00034 00035 class vtkIdList; 00036 class vtkXOpenGLRenderWindowInternal; 00037 00038 class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow 00039 { 00040 public: 00041 static vtkXOpenGLRenderWindow *New(); 00042 vtkTypeMacro(vtkXOpenGLRenderWindow, vtkOpenGLRenderWindow); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 virtual void Start(void); 00047 00049 virtual void Frame(void); 00050 00052 virtual void WindowInitialize(void); 00053 00058 virtual void Initialize(void); 00059 00064 virtual void Finalize(void); 00065 00067 virtual void SetFullScreen(int); 00068 00070 virtual void WindowRemap(void); 00071 00073 virtual void PrefFullScreen(void); 00074 00076 00077 virtual void SetSize(int,int); 00078 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);} 00080 00082 00083 virtual Colormap GetDesiredColormap(); 00084 virtual Visual *GetDesiredVisual(); 00085 virtual XVisualInfo *GetDesiredVisualInfo(); 00086 virtual int GetDesiredDepth(); 00088 00093 virtual void SetStereoCapableWindow(int capable); 00094 00096 void MakeCurrent(); 00097 00100 virtual bool IsCurrent(); 00101 00105 void SetForceMakeCurrent(); 00106 00108 const char *ReportCapabilities(); 00109 00111 int SupportsOpenGL(); 00112 00114 int IsDirect(); 00115 00117 00118 virtual void *GetGenericDisplayId() 00119 { 00120 return this->GetDisplayId(); 00121 } 00123 00124 virtual void *GetGenericWindowId(); 00125 virtual void *GetGenericParentId() 00126 { 00127 return reinterpret_cast<void *>(this->ParentId); 00128 } 00129 00130 virtual void *GetGenericContext(); 00131 virtual void *GetGenericDrawable() 00132 { 00133 return reinterpret_cast<void *>(this->WindowId); 00134 } 00135 00137 virtual int *GetScreenSize(); 00138 00140 virtual int *GetPosition(); 00141 00143 Display *GetDisplayId(); 00144 00146 00148 void SetDisplayId(Display *); 00149 void SetDisplayId(void *); 00151 00153 Window GetParentId(); 00154 00156 00157 void SetParentId(Window); 00158 void SetParentId(void *); 00160 00162 Window GetWindowId(); 00163 00165 00166 void SetWindowId(Window); 00167 void SetWindowId(void *); 00169 00171 void SetNextWindowId(Window); 00172 00175 void SetNextWindowId(void *); 00176 00177 void SetWindowName(const char *); 00178 00181 virtual bool InitializeFromCurrentContext(); 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 XCCrosshair; 00241 Cursor XCArrow; 00242 Cursor XCSizeAll; 00243 Cursor XCSizeNS; 00244 Cursor XCSizeWE; 00245 Cursor XCSizeNE; 00246 Cursor XCSizeNW; 00247 Cursor XCSizeSE; 00248 Cursor XCSizeSW; 00249 Cursor XCHand; 00250 00251 00252 void CreateAWindow(); 00253 void DestroyWindow(); 00254 void CreateOffScreenWindow(int width, int height); 00255 void DestroyOffScreenWindow(); 00256 void ResizeOffScreenWindow(int width, int height); 00257 00258 00259 private: 00260 vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&); // Not implemented. 00261 void operator=(const vtkXOpenGLRenderWindow&); // Not implemented. 00262 }; 00263 00264 00265 00266 #endif