VTK  9.3.0
vtkGenericOpenGLRenderWindow.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
21#ifndef vtkGenericOpenGLRenderWindow_h
22#define vtkGenericOpenGLRenderWindow_h
23
25#include "vtkRenderingOpenGL2Module.h" // For export macro
26
27VTK_ABI_NAMESPACE_BEGIN
28class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
35protected:
38
39public:
41 void Finalize() override;
42
45 void Frame() override;
46
49 void MakeCurrent() override;
50
54 bool IsCurrent() override;
55
59 int SupportsOpenGL() override;
60
65
66 // {@
68 void SetFrontLeftBuffer(unsigned int);
69 void SetFrontRightBuffer(unsigned int);
70 void SetBackLeftBuffer(unsigned int);
71 void SetBackRightBuffer(unsigned int);
72 // }@
73
75
77 void PushState() {}
79 void PopState() {}
80
81 // {@
83 void SetWindowId(void*) override;
84 void* GetGenericWindowId() override;
85 void SetDisplayId(void*) override;
86 void SetParentId(void*) override;
87 void* GetGenericDisplayId() override;
88 void* GetGenericParentId() override;
89 void* GetGenericContext() override;
90 void* GetGenericDrawable() override;
91 void SetWindowInfo(const char*) override;
92 void SetParentInfo(const char*) override;
93 int* GetScreenSize() VTK_SIZEHINT(2) override;
94 void HideCursor() override;
95 void ShowCursor() override;
96 void SetFullScreen(vtkTypeBool) override;
97 void WindowRemap() override;
98 vtkTypeBool GetEventPending() override;
99 void SetNextWindowId(void*) override;
100 void SetNextWindowInfo(const char*) override;
101 void CreateAWindow() override;
102 void DestroyWindow() override;
103 // }@
104
106
110 void SetIsDirect(vtkTypeBool newValue);
111 void SetSupportsOpenGL(int newValue);
112 void SetIsCurrent(bool newValue);
114
122 void Render() override;
123
127 float GetMaximumHardwareLineWidth() override;
128
130
134 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
135 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
137
139
144 vtkSetMacro(ReadyForRendering, bool);
145 vtkGetMacro(ReadyForRendering, bool);
146
151 vtkSetVector2Macro(ScreenSize, int);
152
156 void SetCurrentCursor(int cShape) override;
157
158 // since we are using an external context it must
159 // specify if the window is mapped or not.
160 vtkSetMacro(Mapped, vtkTypeBool);
161
165 void OpenGLInit() override;
166
167protected:
173 int ReadPixels(
174 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
175
176 int SetPixelData(
177 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
178 int SetPixelData(
179 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
180 int SetRGBACharPixelData(
181 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
182 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
183 int blend = 0, int right = 0) override;
184
185 int DirectStatus;
186 int SupportsOpenGLStatus;
187 bool CurrentStatus;
188 float ForceMaximumHardwareLineWidth;
189 bool ReadyForRendering;
190
191private:
193 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
194};
195
196VTK_ABI_NAMESPACE_END
197#endif
platform independent render window
void * GetGenericWindowId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void Finalize() override
Cleans up graphics resources allocated in the context for this VTK scene.
void SetWindowId(void *) override
does nothing
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkGenericOpenGLRenderWindow * New()
~vtkGenericOpenGLRenderWindow() override
vtkTypeBool IsDirect() override
Returns if the context is direct.
void SetParentInfo(const char *) override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetDisplayId(void *) override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void Frame() override
flush the pending drawing operations Class user may to watch for WindowFrameEvent and act on it
void SetParentId(void *) override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetWindowInfo(const char *) override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetBackRightBuffer(unsigned int)
void MakeCurrent() override
Makes the context current.
int SupportsOpenGL() override
Returns if OpenGL is supported.
void PopState()
no-op (for API compat with OpenGL1).
void SetFrontRightBuffer(unsigned int)
void * GetGenericContext() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void * GetGenericParentId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
int * GetScreenSize() override
Get the current size of the screen in pixels.
void SetOwnContext(vtkTypeBool)
void * GetGenericDisplayId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetFrontLeftBuffer(unsigned int)
set the drawing buffers to use
void SetBackLeftBuffer(unsigned int)
void PushState()
no-op (for API compat with OpenGL1).
bool IsCurrent() override
Returns if the context is current.
void * GetGenericDrawable() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
a simple class to control print indentation
Definition vtkIndent.h:29
OpenGL rendering window.
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FLOAT_MAX
Definition vtkType.h:152
#define VTK_SIZEHINT(...)