VTK
vtkXOpenGLRenderWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXOpenGLRenderWindow.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkXOpenGLRenderWindow_h
28 #define vtkXOpenGLRenderWindow_h
29 
30 #include "vtkRenderingOpenGL2Module.h" // For export macro
31 #include "vtkOpenGLRenderWindow.h"
32 #include <X11/Xlib.h> // Needed for X types used in the public interface
33 #include <X11/Xutil.h> // Needed for X types used in the public interface
34 
35 class vtkIdList;
36 class vtkXOpenGLRenderWindowInternal;
37 
39 {
40 public:
41  static vtkXOpenGLRenderWindow *New();
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46  virtual void Start(void);
47 
49  virtual void Frame(void);
50 
52  virtual void WindowInitialize(void);
53 
58  virtual void Initialize(void);
59 
64  virtual void Finalize(void);
65 
67  virtual void SetFullScreen(int);
68 
70  virtual void WindowRemap(void);
71 
73  virtual void PrefFullScreen(void);
74 
76 
77  virtual void SetSize(int,int);
78  virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);}
80 
82 
83  virtual Colormap GetDesiredColormap();
84  virtual Visual *GetDesiredVisual();
85  virtual XVisualInfo *GetDesiredVisualInfo();
86  virtual int GetDesiredDepth();
88 
93  virtual void SetStereoCapableWindow(int capable);
94 
96  void MakeCurrent();
97 
100  virtual bool IsCurrent();
101 
105  void SetForceMakeCurrent();
106 
108  const char *ReportCapabilities();
109 
111  int SupportsOpenGL();
112 
114  int IsDirect();
115 
117 
118  virtual void *GetGenericDisplayId()
119  {
120  return this->GetDisplayId();
121  }
123 
124  virtual void *GetGenericWindowId();
125  virtual void *GetGenericParentId()
126  {
127  return reinterpret_cast<void *>(this->ParentId);
128  }
129 
130  virtual void *GetGenericContext();
131  virtual void *GetGenericDrawable()
132  {
133  return reinterpret_cast<void *>(this->WindowId);
134  }
135 
137  virtual int *GetScreenSize();
138 
140  virtual int *GetPosition();
141 
143  Display *GetDisplayId();
144 
146 
148  void SetDisplayId(Display *);
149  void SetDisplayId(void *);
151 
153  Window GetParentId();
154 
156 
157  void SetParentId(Window);
158  void SetParentId(void *);
160 
162  Window GetWindowId();
163 
165 
166  void SetWindowId(Window);
167  void SetWindowId(void *);
169 
171  void SetNextWindowId(Window);
172 
175  void SetNextWindowId(void *);
176 
177  void SetWindowName(const char *);
178 
181  virtual bool InitializeFromCurrentContext();
182 
184 
185  void SetPosition(int,int);
186  void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);};
188 
190 
192  void HideCursor();
193  void ShowCursor();
195 
197  virtual void SetCurrentCursor(int);
198 
202  virtual int GetEventPending();
203 
205  void SetWindowInfo(char *info);
206 
208  void SetNextWindowInfo(char *info);
209 
211  void SetParentInfo(char *info);
212 
215  void Render();
216 
218  void SetOffScreenRendering(int i);
219 
220 protected:
223 
224  vtkXOpenGLRenderWindowInternal *Internal;
225 
226  Window ParentId;
227  Window WindowId;
228  Window NextWindowId;
229  Display *DisplayId;
230  Colormap ColorMap;
231  int OwnWindow;
232  int OwnDisplay;
233  int ScreenSize[2];
234  int CursorHidden;
235  int ForceMakeCurrent;
236  int UsingHardware;
237  char *Capabilities;
238 
239  // we must keep track of the cursors we are using
240  Cursor XCCrosshair;
241  Cursor XCArrow;
242  Cursor XCSizeAll;
243  Cursor XCSizeNS;
244  Cursor XCSizeWE;
245  Cursor XCSizeNE;
246  Cursor XCSizeNW;
247  Cursor XCSizeSE;
248  Cursor XCSizeSW;
249  Cursor XCHand;
250 
251 
252  void CreateAWindow();
253  void DestroyWindow();
254  void CreateOffScreenWindow(int width, int height);
255  void DestroyOffScreenWindow();
256  void ResizeOffScreenWindow(int width, int height);
257 
258 
259 private:
260  vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&); // Not implemented.
261  void operator=(const vtkXOpenGLRenderWindow&); // Not implemented.
262 };
263 
264 
265 
266 #endif
OpenGL rendering window.
virtual void SetOffScreenRendering(int)
virtual void Finalize()=0
virtual void SetForceMakeCurrent()
virtual void SetWindowInfo(char *)=0
virtual void SetSize(int a[2])
virtual void * GetGenericParentId()
virtual void WindowRemap()=0
virtual void * GetGenericContext()=0
void PrintSelf(ostream &os, vtkIndent indent)
virtual void HideCursor()=0
#define VTKRENDERINGOPENGL2_EXPORT
static vtkRenderWindow * New()
virtual int * GetScreenSize()=0
virtual void SetWindowId(void *)=0
virtual void SetCurrentCursor(int)
virtual void SetNextWindowInfo(char *)=0
virtual void SetFullScreen(int)=0
OpenGL rendering window.
virtual void * GetGenericDrawable()
virtual int GetEventPending()=0
virtual void SetSize(int, int)
virtual void SetStereoCapableWindow(int capable)
virtual const char * ReportCapabilities()
virtual int IsDirect()
virtual int SupportsOpenGL()
virtual void SetParentInfo(char *)=0
virtual bool IsCurrent()=0
virtual void SetParentId(void *)=0
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void DestroyWindow()=0
list of point or cell ids
Definition: vtkIdList.h:35
virtual void SetDisplayId(void *)=0
virtual void MakeCurrent()=0
virtual void SetNextWindowId(void *)=0
virtual void * GetGenericDisplayId()
virtual int * GetPosition()
virtual void Frame()=0
virtual bool InitializeFromCurrentContext()
virtual void Start()=0
virtual void SetWindowName(const char *)
virtual void SetPosition(int, int)
virtual void CreateAWindow()=0
virtual void ShowCursor()=0
virtual void * GetGenericWindowId()=0