VTK  9.2.6
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
28#ifndef vtkXOpenGLRenderWindow_h
29#define vtkXOpenGLRenderWindow_h
30
32#include "vtkRenderingOpenGL2Module.h" // For export macro
33#include <X11/Xlib.h> // Needed for X types used in the public interface
34#include <stack> // for ivar
35
36class vtkIdList;
37class vtkXOpenGLRenderWindowInternal;
38struct vtkXVisualInfo;
39
40class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
50 void Start() override;
51
55 void Frame() override;
56
60 virtual void WindowInitialize();
61
68 void Initialize() override;
69
75 void Finalize() override;
76
80 void SetFullScreen(vtkTypeBool) override;
81
85 void WindowRemap() override;
86
87 // Call X funcs to map unmap
88 void SetShowWindow(bool val) override;
89
93 virtual void PrefFullScreen();
94
103 void SetSize(int width, int height) override;
104 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
105
110 void SetSizeNoXResize(int, int);
111
113
116 virtual Colormap GetDesiredColormap();
117 virtual Visual* GetDesiredVisual();
118 virtual vtkXVisualInfo* GetDesiredVisualInfo();
119 virtual int GetDesiredDepth();
121
128 void SetStereoCapableWindow(vtkTypeBool capable) override;
129
133 void MakeCurrent() override;
134
138 bool IsCurrent() override;
139
143 void ReleaseCurrent() override;
144
150 void SetForceMakeCurrent() override;
151
155 const char* ReportCapabilities() override;
156
161
165 void* GetGenericDisplayId() override { return this->GetDisplayId(); }
166
167 void* GetGenericWindowId() override;
168 void* GetGenericParentId() override { return reinterpret_cast<void*>(this->ParentId); }
169
170 void* GetGenericContext() override;
171 void* GetGenericDrawable() override { return reinterpret_cast<void*>(this->WindowId); }
172
174
179 int* GetScreenSize() VTK_SIZEHINT(2) override;
180
185 int* GetPosition() VTK_SIZEHINT(2) override;
186
190 Display* GetDisplayId();
191
193
197 void SetDisplayId(Display*);
198 void SetDisplayId(void*) override;
200
204 Window GetParentId();
205
207
210 void SetParentId(Window);
211 void SetParentId(void*) override;
213
217 Window GetWindowId();
218
220
223 void SetWindowId(Window);
224 void SetWindowId(void*) override;
226
230 void SetNextWindowId(Window);
231
237 void SetNextWindowId(void*) override;
238
242 void SetWindowName(const char*) override;
243
248 void SetIcon(vtkImageData* img) override;
249
255
259 bool GetPlatformSupportsRenderWindowSharing() override { return true; }
260
262
267 void SetPosition(int x, int y) override;
268 void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
270
272
276 void HideCursor() override;
277 void ShowCursor() override;
279
283 void SetCurrentCursor(int) override;
284
291
295 void SetWindowInfo(const char* info) override;
296
300 void SetNextWindowInfo(const char* info) override;
301
305 void SetParentInfo(const char* info) override;
306
311 void Render() override;
312
314
321 void PushContext() override;
322 void PopContext() override;
324
334 bool SetSwapControl(int i) override;
335
336protected:
339
340 vtkXOpenGLRenderWindowInternal* Internal;
341
342 Window ParentId;
343 Window WindowId;
345 Display* DisplayId;
346 Colormap ColorMap;
352
353 std::stack<Display*> DisplayStack;
354 std::stack<Drawable> DrawableStack;
355 std::stack<void*> ContextStack;
356
357 // we must keep track of the cursors we are using
359 Cursor XCArrow;
360 Cursor XCSizeAll;
361 Cursor XCSizeNS;
362 Cursor XCSizeWE;
363 Cursor XCSizeNE;
364 Cursor XCSizeNW;
365 Cursor XCSizeSE;
366 Cursor XCSizeSW;
367 Cursor XCHand;
368 Cursor XCCustom;
369
370 void CreateAWindow() override;
371 void DestroyWindow() override;
373
374private:
376 void operator=(const vtkXOpenGLRenderWindow&) = delete;
377};
378
379#endif
list of point or cell ids
Definition vtkIdList.h:34
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:40
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
void HideCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
vtkTypeBool IsDirect() override
Is this render window using hardware acceleration?
int * GetPosition() override
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
void DestroyWindow() override
Destroy a not-off-screen window.
void PopContext() override
Ability to push and pop this window's context as the current context.
void SetForceMakeCurrent() override
If called, allow MakeCurrent() to skip cache-check when called.
int * GetScreenSize() override
Get the current size of the screen in pixels.
virtual Colormap GetDesiredColormap()
Get the X properties of an ideal rendering window.
void ShowCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
const char * ReportCapabilities() override
Get report of capabilities for the render window.
void Initialize() override
Initialize the rendering window.
void SetSize(int a[2]) override
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
void SetNextWindowId(Window)
Specify the X window id to use if a WindowRemap is done.
void ReleaseCurrent() override
Release the current context.
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
virtual Visual * GetDesiredVisual()
Get the X properties of an ideal rendering window.
void CreateAWindow() override
Create a not-off-screen window.
Window GetParentId()
Get this RenderWindow's parent X window id.
void SetParentInfo(const char *info) override
Sets the X window id of the window that WILL BE created.
void Start() override
Begin the rendering process.
bool SetSwapControl(int i) override
Set the number of vertical syncs required between frames.
void * GetGenericDisplayId() override
Xwindow get set functions.
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
virtual int GetDesiredDepth()
Get the X properties of an ideal rendering window.
void MakeCurrent() override
Make this window the current OpenGL context.
vtkTypeBool GetEventPending() override
Check to see if a mouse button has been pressed or mouse wheel activated.
void SetWindowInfo(const char *info) override
Set this RenderWindow's X window id to a pre-existing window.
Window GetWindowId()
Get this RenderWindow's X window id.
Display * GetDisplayId()
Get this RenderWindow's X display id.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetCurrentCursor(int) override
Change the shape of the cursor.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
void SetWindowName(const char *) override
Set name of rendering window.
void SetSizeNoXResize(int, int)
Specify the size of the rendering window in pixels but do not resize the XWindow.
vtkXOpenGLRenderWindowInternal * Internal
void Finalize() override
"Deinitialize" the rendering window.
void SetNextWindowInfo(const char *info) override
Set the window info that will be used after WindowRemap()
void Frame() override
End the rendering process and display the image.
std::stack< Drawable > DrawableStack
~vtkXOpenGLRenderWindow() override
bool GetPlatformSupportsRenderWindowSharing() override
Does this platform support render window data sharing.
virtual void PrefFullScreen()
Set the preferred window size to full screen.
void WindowRemap() override
Resize the window.
void SetStereoCapableWindow(vtkTypeBool capable) override
Prescribe that the window be created in a stereo-capable mode.
virtual void WindowInitialize()
Initialize the window for rendering.
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
std::stack< void * > ContextStack
void SetDisplayId(Display *)
Set the X display id for this RenderWindow to use to a pre-existing X display id.
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
void Render() override
This computes the size of the render window before calling the supper classes render.
void SetPosition(int x, int y) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
static vtkXOpenGLRenderWindow * New()
std::stack< Display * > DisplayStack
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
void SetParentId(Window)
Sets the parent of the window that WILL BE created.
void SetIcon(vtkImageData *img) override
For window manager that supports it, set the icon displayed in the taskbar and the title bar.
void SetShowWindow(bool val) override
Show or not Show the window.
void PushContext() override
Ability to push and pop this window's context as the current context.
virtual vtkXVisualInfo * GetDesiredVisualInfo()
Get the X properties of an ideal rendering window.
void SetWindowId(Window)
Set this RenderWindow's X window id to a pre-existing window.
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SIZEHINT(...)