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 =========================================================================*/
33 #ifndef vtkXOpenGLRenderWindow_h
34 #define vtkXOpenGLRenderWindow_h
35 
36 #include "vtkRenderingOpenGLModule.h" // For export macro
37 #include "vtkOpenGLRenderWindow.h"
38 #include <X11/Xlib.h> // Needed for X types used in the public interface
39 #include <X11/Xutil.h> // Needed for X types used in the public interface
40 
41 class vtkIdList;
42 class vtkXOpenGLRenderWindowInternal;
43 
44 class VTKRENDERINGOPENGL_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow
45 {
46 public:
47  static vtkXOpenGLRenderWindow *New();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
52  virtual void Start(void);
53 
55  virtual void Frame(void);
56 
58  virtual void WindowInitialize(void);
59 
64  virtual void Initialize(void);
65 
70  virtual void Finalize(void);
71 
73  virtual void SetFullScreen(int);
74 
76  virtual void WindowRemap(void);
77 
79  virtual void PrefFullScreen(void);
80 
82 
83  virtual void SetSize(int,int);
84  virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);};
86 
88 
89  virtual Colormap GetDesiredColormap();
90  virtual Visual *GetDesiredVisual();
91  virtual XVisualInfo *GetDesiredVisualInfo();
92  virtual int GetDesiredDepth();
94 
99  virtual void SetStereoCapableWindow(int capable);
100 
102  void MakeCurrent();
103 
106  virtual bool IsCurrent();
107 
111  void SetForceMakeCurrent();
112 
114  const char *ReportCapabilities();
115 
117  int SupportsOpenGL();
118 
120  int IsDirect();
121 
123 
124  virtual void *GetGenericDisplayId()
125  {
126  return this->GetDisplayId();
127  }
129 
130  virtual void *GetGenericWindowId();
131  virtual void *GetGenericParentId()
132  {
133  return reinterpret_cast<void *>(this->ParentId);
134  }
135 
136  virtual void *GetGenericContext();
137  virtual void *GetGenericDrawable()
138  {
139  return reinterpret_cast<void *>(this->WindowId);
140  }
141 
143  virtual int *GetScreenSize();
144 
146  virtual int *GetPosition();
147 
149  Display *GetDisplayId();
150 
152 
154  void SetDisplayId(Display *);
155  void SetDisplayId(void *);
157 
159  Window GetParentId();
160 
162 
163  void SetParentId(Window);
164  void SetParentId(void *);
166 
168  Window GetWindowId();
169 
171 
172  void SetWindowId(Window);
173  void SetWindowId(void *);
175 
177  void SetNextWindowId(Window);
178 
181  void SetNextWindowId(void *);
182 
183  void SetWindowName(const char *);
184 
187  virtual bool InitializeFromCurrentContext();
188 
190 
191  void SetPosition(int,int);
192  void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);};
194 
196 
198  void HideCursor();
199  void ShowCursor();
201 
203  virtual void SetCurrentCursor(int);
204 
208  virtual int GetEventPending();
209 
211  void SetWindowInfo(char *info);
212 
214  void SetNextWindowInfo(char *info);
215 
217  void SetParentInfo(char *info);
218 
221  virtual void Render();
222 
224  void SetOffScreenRendering(int i);
225 
226 protected:
229 
230  vtkXOpenGLRenderWindowInternal *Internal;
231 
232  Window ParentId;
233  Window WindowId;
234  Window NextWindowId;
235  Display *DisplayId;
236  Colormap ColorMap;
239  int ScreenSize[2];
244 
245  // we must keep track of the cursors we are using
246  Cursor XCCrosshair;
247  Cursor XCArrow;
248  Cursor XCSizeAll;
249  Cursor XCSizeNS;
250  Cursor XCSizeWE;
251  Cursor XCSizeNE;
252  Cursor XCSizeNW;
253  Cursor XCSizeSE;
254  Cursor XCSizeSW;
255  Cursor XCHand;
256 
257 
258  void CreateAWindow();
259  void DestroyWindow();
260  void CreateOffScreenWindow(int width, int height);
261  void DestroyOffScreenWindow();
262  void ResizeOffScreenWindow(int width, int height);
263 
264 
265 private:
266  vtkXOpenGLRenderWindow(const vtkXOpenGLRenderWindow&); // Not implemented.
267  void operator=(const vtkXOpenGLRenderWindow&); // Not implemented.
268 };
269 
270 
271 
272 #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
static vtkRenderWindow * New()
virtual int * GetScreenSize()=0
vtkXOpenGLRenderWindowInternal * Internal
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