VTK  9.3.0
vtkXOpenGLRenderWindow.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
13#ifndef vtkXOpenGLRenderWindow_h
14#define vtkXOpenGLRenderWindow_h
15
16#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
18#include "vtkRenderingOpenGL2Module.h" // For export macro
19#include <X11/Xlib.h> // Needed for X types used in the public interface
20#include <stack> // for ivar
21
22VTK_ABI_NAMESPACE_BEGIN
23class vtkIdList;
24class vtkXOpenGLRenderWindowInternal;
25struct vtkXVisualInfo;
26
27class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindow : public vtkOpenGLRenderWindow
28{
29public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
37 void Start() override;
38
42 void Frame() override;
43
47 virtual void WindowInitialize();
48
55 void Initialize() override;
56
62 void Finalize() override;
63
67 void SetFullScreen(vtkTypeBool) override;
68
72 void WindowRemap() override;
73
74 // Call X funcs to map unmap
75 void SetShowWindow(bool val) override;
76
80 virtual void PrefFullScreen();
81
94 void SetSize(int width, int height) override;
95 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
96
101 VTK_DEPRECATED_IN_9_3_0("Use vtkRenderWindow::SetSize(w,h) instead")
102 void SetSizeNoXResize(int, int);
103
105
108 virtual Colormap GetDesiredColormap();
109 virtual Visual* GetDesiredVisual();
110 virtual vtkXVisualInfo* GetDesiredVisualInfo();
111 virtual int GetDesiredDepth();
113
120 void SetStereoCapableWindow(vtkTypeBool capable) override;
121
125 void MakeCurrent() override;
126
130 bool IsCurrent() override;
131
135 void ReleaseCurrent() override;
136
142 void SetForceMakeCurrent() override;
143
147 const char* ReportCapabilities() override;
148
152 vtkTypeBool IsDirect() override;
153
157 void* GetGenericDisplayId() override { return this->GetDisplayId(); }
158
159 void* GetGenericWindowId() override;
160 void* GetGenericParentId() override { return reinterpret_cast<void*>(this->ParentId); }
161
162 void* GetGenericContext() override;
163 void* GetGenericDrawable() override { return reinterpret_cast<void*>(this->WindowId); }
164
166
171 int* GetScreenSize() VTK_SIZEHINT(2) override;
172
177 int* GetPosition() VTK_SIZEHINT(2) override;
178
182 Display* GetDisplayId();
183
185
189 void SetDisplayId(Display*);
190 void SetDisplayId(void*) override;
192
196 Window GetParentId();
197
199
202 void SetParentId(Window);
203 void SetParentId(void*) override;
205
209 Window GetWindowId();
210
212
215 void SetWindowId(Window);
216 void SetWindowId(void*) override;
218
222 void SetNextWindowId(Window);
223
229 void SetNextWindowId(void*) override;
230
234 void SetWindowName(const char*) override;
235
240 void SetIcon(vtkImageData* img) override;
241
246 bool InitializeFromCurrentContext() override;
247
251 bool GetPlatformSupportsRenderWindowSharing() override { return true; }
252
254
259 void SetPosition(int x, int y) override;
260 void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
262
264
268 void HideCursor() override;
269 void ShowCursor() override;
271
275 void SetCurrentCursor(int) override;
276
283
287 void SetWindowInfo(const char* info) override;
288
292 void SetNextWindowInfo(const char* info) override;
293
297 void SetParentInfo(const char* info) override;
298
303 void Render() override;
304
306
313 void PushContext() override;
314 void PopContext() override;
316
326 bool SetSwapControl(int i) override;
327
328protected:
331
332 vtkXOpenGLRenderWindowInternal* Internal;
333
334 Window ParentId;
335 Window WindowId;
337 Display* DisplayId;
338 Colormap ColorMap;
344
345 std::stack<Display*> DisplayStack;
346 std::stack<Drawable> DrawableStack;
347 std::stack<void*> ContextStack;
348
349 // we must keep track of the cursors we are using
351 Cursor XCArrow;
352 Cursor XCSizeAll;
353 Cursor XCSizeNS;
354 Cursor XCSizeWE;
355 Cursor XCSizeNE;
356 Cursor XCSizeNW;
357 Cursor XCSizeSE;
358 Cursor XCSizeSW;
359 Cursor XCHand;
360 Cursor XCCustom;
361
362 void CreateAWindow() override;
363 void DestroyWindow() override;
365
366private:
368 void operator=(const vtkXOpenGLRenderWindow&) = delete;
369};
370
371VTK_ABI_NAMESPACE_END
372#endif
list of point or cell ids
Definition vtkIdList.h:23
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:29
OpenGL rendering window.
OpenGL rendering window.
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...
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.
int * GetScreenSize() override
Get the current size of the screen in pixels.
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.
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 SetSize(int width, int height) override
Set the size (width and height in pixels) of the rendering window.
void CreateAWindow() override
Create a not-off-screen window.
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 SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
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.
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.
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
virtual void PrefFullScreen()
Set the preferred window size to full screen.
void WindowRemap() override
Resize the window.
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 * 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
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.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_3_0(reason)
#define VTK_SIZEHINT(...)