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 =========================================================================*/ 00033 #ifndef vtkXOpenGLRenderWindow_h 00034 #define vtkXOpenGLRenderWindow_h 00035 00036 #include "vtkRenderingOpenGLModule.h" // For export macro 00037 #include "vtkOpenGLRenderWindow.h" 00038 #include <X11/Xlib.h> // Needed for X types used in the public interface 00039 #include <X11/Xutil.h> // Needed for X types used in the public interface 00040 00041 class vtkIdList; 00042 class vtkXOpenGLRenderWindowInternal; 00043 00044 class VTKRENDERINGOPENGL_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow 00045 { 00046 public: 00047 static vtkXOpenGLRenderWindow *New(); 00048 vtkTypeMacro(vtkXOpenGLRenderWindow,vtkOpenGLRenderWindow); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 virtual void Start(void); 00053 00055 virtual void Frame(void); 00056 00058 virtual void WindowInitialize(void); 00059 00064 virtual void Initialize(void); 00065 00070 virtual void Finalize(void); 00071 00073 virtual void SetFullScreen(int); 00074 00076 virtual void WindowRemap(void); 00077 00079 virtual void PrefFullScreen(void); 00080 00082 00083 virtual void SetSize(int,int); 00084 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);}; 00086 00088 00089 virtual Colormap GetDesiredColormap(); 00090 virtual Visual *GetDesiredVisual(); 00091 virtual XVisualInfo *GetDesiredVisualInfo(); 00092 virtual int GetDesiredDepth(); 00094 00099 virtual void SetStereoCapableWindow(int capable); 00100 00102 void MakeCurrent(); 00103 00106 virtual bool IsCurrent(); 00107 00111 void SetForceMakeCurrent(); 00112 00114 const char *ReportCapabilities(); 00115 00117 int SupportsOpenGL(); 00118 00120 int IsDirect(); 00121 00123 00124 virtual void *GetGenericDisplayId() 00125 { 00126 return this->GetDisplayId(); 00127 } 00129 00130 virtual void *GetGenericWindowId(); 00131 virtual void *GetGenericParentId() 00132 { 00133 return reinterpret_cast<void *>(this->ParentId); 00134 } 00135 00136 virtual void *GetGenericContext(); 00137 virtual void *GetGenericDrawable() 00138 { 00139 return reinterpret_cast<void *>(this->WindowId); 00140 } 00141 00143 virtual int *GetScreenSize(); 00144 00146 virtual int *GetPosition(); 00147 00149 Display *GetDisplayId(); 00150 00152 00154 void SetDisplayId(Display *); 00155 void SetDisplayId(void *); 00157 00159 Window GetParentId(); 00160 00162 00163 void SetParentId(Window); 00164 void SetParentId(void *); 00166 00168 Window GetWindowId(); 00169 00171 00172 void SetWindowId(Window); 00173 void SetWindowId(void *); 00175 00177 void SetNextWindowId(Window); 00178 00181 void SetNextWindowId(void *); 00182 00183 void SetWindowName(const char *); 00184 00187 virtual bool InitializeFromCurrentContext(); 00188 00190 00191 void SetPosition(int,int); 00192 void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);}; 00194 00196 00198 void HideCursor(); 00199 void ShowCursor(); 00201 00203 virtual void SetCurrentCursor(int); 00204 00208 virtual int GetEventPending(); 00209 00211 void SetWindowInfo(char *info); 00212 00214 void SetNextWindowInfo(char *info); 00215 00217 void SetParentInfo(char *info); 00218 00221 virtual void Render(); 00222 00224 void SetOffScreenRendering(int i); 00225 00226 protected: 00227 vtkXOpenGLRenderWindow(); 00228 ~vtkXOpenGLRenderWindow(); 00229 00230 vtkXOpenGLRenderWindowInternal *Internal; 00231 00232 Window ParentId; 00233 Window WindowId; 00234 Window NextWindowId; 00235 Display *DisplayId; 00236 Colormap ColorMap; 00237 int OwnWindow; 00238 int OwnDisplay; 00239 int ScreenSize[2]; 00240 int CursorHidden; 00241 int ForceMakeCurrent; 00242 int UsingHardware; 00243 char *Capabilities; 00244 00245 // we must keep track of the cursors we are using 00246 Cursor XCCrosshair; 00247 Cursor XCArrow; 00248 Cursor XCSizeAll; 00249 Cursor XCSizeNS; 00250 Cursor XCSizeWE; 00251 Cursor XCSizeNE; 00252 Cursor XCSizeNW; 00253 Cursor XCSizeSE; 00254 Cursor XCSizeSW; 00255 Cursor XCHand; 00256 00257 00258 void CreateAWindow(); 00259 void DestroyWindow(); 00260 void CreateOffScreenWindow(int width, int height); 00261 void DestroyOffScreenWindow(); 00262 void ResizeOffScreenWindow(int width, int height); 00263 00264 00265 private: 00266 vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&); // Not implemented. 00267 void operator=(const vtkXOpenGLRenderWindow&); // Not implemented. 00268 }; 00269 00270 00271 00272 #endif