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 =========================================================================*/
25 #ifndef vtkXOpenGLRenderWindow_h
26 #define vtkXOpenGLRenderWindow_h
27 
28 #include "vtkRenderingOpenGLModule.h" // For export macro
29 #include "vtkOpenGLRenderWindow.h"
30 #include <X11/Xlib.h> // Needed for X types used in the public interface
31 #include <X11/Xutil.h> // Needed for X types used in the public interface
32 
33 class vtkIdList;
34 class vtkXOpenGLRenderWindowInternal;
35 
36 class VTKRENDERINGOPENGL_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow
37 {
38 public:
39  static vtkXOpenGLRenderWindow *New();
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
46  void Start() VTK_OVERRIDE;
47 
51  void Frame() VTK_OVERRIDE;
52 
56  virtual void WindowInitialize();
57 
64  virtual void Initialize();
65 
71  void Finalize() VTK_OVERRIDE;
72 
76  void SetFullScreen(int) VTK_OVERRIDE;
77 
81  void WindowRemap() VTK_OVERRIDE;
82 
86  virtual void PrefFullScreen();
87 
89 
92  void SetSize(int,int) VTK_OVERRIDE;
93  void SetSize(int a[2]) VTK_OVERRIDE { this->SetSize(a[0], a[1]); }
95 
97 
100  virtual Colormap GetDesiredColormap();
101  virtual Visual *GetDesiredVisual();
102  virtual XVisualInfo *GetDesiredVisualInfo();
103  virtual int GetDesiredDepth();
105 
112  void SetStereoCapableWindow(int capable) VTK_OVERRIDE;
113 
117  void MakeCurrent() VTK_OVERRIDE;
118 
122  bool IsCurrent() VTK_OVERRIDE;
123 
129  void SetForceMakeCurrent() VTK_OVERRIDE;
130 
134  const char *ReportCapabilities() VTK_OVERRIDE;
135 
139  int SupportsOpenGL() VTK_OVERRIDE;
140 
144  int IsDirect() VTK_OVERRIDE;
145 
149  void *GetGenericDisplayId() VTK_OVERRIDE
150  {
151  return this->GetDisplayId();
152  }
153 
154  void *GetGenericWindowId() VTK_OVERRIDE;
155  void *GetGenericParentId() VTK_OVERRIDE
156  {
157  return reinterpret_cast<void *>(this->ParentId);
158  }
159 
160  void *GetGenericContext() VTK_OVERRIDE;
161  void *GetGenericDrawable() VTK_OVERRIDE
162  {
163  return reinterpret_cast<void *>(this->WindowId);
164  }
165 
169  int *GetScreenSize() VTK_OVERRIDE;
170 
174  int *GetPosition() VTK_OVERRIDE;
175 
179  Display *GetDisplayId();
180 
182 
186  void SetDisplayId(Display *);
187  void SetDisplayId(void *) VTK_OVERRIDE;
189 
193  Window GetParentId();
194 
196 
199  void SetParentId(Window);
200  void SetParentId(void *) VTK_OVERRIDE;
202 
206  Window GetWindowId();
207 
209 
212  void SetWindowId(Window);
213  void SetWindowId(void *) VTK_OVERRIDE;
215 
219  void SetNextWindowId(Window);
220 
226  void SetNextWindowId(void *) VTK_OVERRIDE;
227 
231  void SetWindowName(const char *) VTK_OVERRIDE;
232 
237  bool InitializeFromCurrentContext() VTK_OVERRIDE;
238 
240 
243  void SetPosition(int,int) VTK_OVERRIDE;
244  void SetPosition(int a[2]) VTK_OVERRIDE { this->SetPosition(a[0], a[1]); }
246 
248 
252  void HideCursor() VTK_OVERRIDE;
253  void ShowCursor() VTK_OVERRIDE;
255 
259  void SetCurrentCursor(int) VTK_OVERRIDE;
260 
266  int GetEventPending() VTK_OVERRIDE;
267 
271  void SetWindowInfo(char *info) VTK_OVERRIDE;
272 
276  void SetNextWindowInfo(char *info) VTK_OVERRIDE;
277 
281  void SetParentInfo(char *info) VTK_OVERRIDE;
282 
287  void Render() VTK_OVERRIDE;
288 
292  void SetOffScreenRendering(int i) VTK_OVERRIDE;
293 
294 protected:
296  ~vtkXOpenGLRenderWindow() VTK_OVERRIDE;
297 
298  vtkXOpenGLRenderWindowInternal *Internal;
299 
300  Window ParentId;
301  Window WindowId;
302  Window NextWindowId;
303  Display *DisplayId;
304  Colormap ColorMap;
305  int OwnWindow;
306  int OwnDisplay;
307  int ScreenSize[2];
308  int CursorHidden;
309  int ForceMakeCurrent;
310  int UsingHardware;
311  char *Capabilities;
312 
313  // we must keep track of the cursors we are using
314  Cursor XCCrosshair;
315  Cursor XCArrow;
316  Cursor XCSizeAll;
317  Cursor XCSizeNS;
318  Cursor XCSizeWE;
319  Cursor XCSizeNE;
320  Cursor XCSizeNW;
321  Cursor XCSizeSE;
322  Cursor XCSizeSW;
323  Cursor XCHand;
324 
325 
326  void CreateAWindow() VTK_OVERRIDE;
327  void DestroyWindow() VTK_OVERRIDE;
328  void CreateOffScreenWindow(int width, int height);
329  void DestroyOffScreenWindow();
330  void ResizeOffScreenWindow(int width, int height);
331 
332 
333 private:
334  vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&) VTK_DELETE_FUNCTION;
335  void operator=(const vtkXOpenGLRenderWindow&) VTK_DELETE_FUNCTION;
336 };
337 
338 
339 
340 #endif
OpenGL rendering window.
virtual void HideCursor()=0
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on...
virtual int * GetScreenSize()=0
Get the current size of the screen in pixels.
void * GetGenericContext() override=0
Dummy stubs for vtkWindow API.
OpenGL rendering window.
virtual void SetStereoCapableWindow(int capable)
Prescribe that the window be created in a stereo-capable mode.
void SetSize(int a[2]) override
Specify the size of the rendering window in pixels.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
void SetPosition(int a[2]) override
Move the window to a new position on the display.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void Start()=0
Initialize the rendering process.
void * GetGenericWindowId() override=0
Dummy stubs for vtkWindow API.
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.