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
30#ifndef vtkGenericOpenGLRenderWindow_h
31#define vtkGenericOpenGLRenderWindow_h
32
34#include "vtkRenderingOpenGL2Module.h" // For export macro
35
36VTK_ABI_NAMESPACE_BEGIN
37class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
38{
39public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
44protected:
47
48public:
50 void Finalize() override;
51
54 void Frame() override;
55
58 void MakeCurrent() override;
59
63 bool IsCurrent() override;
64
68 int SupportsOpenGL() override;
69
74
75 // {@
77 void SetFrontLeftBuffer(unsigned int);
78 void SetFrontRightBuffer(unsigned int);
79 void SetBackLeftBuffer(unsigned int);
80 void SetBackRightBuffer(unsigned int);
81 // }@
82
84
86 void PushState() {}
88 void PopState() {}
89
90 // {@
92 void SetWindowId(void*) override;
93 void* GetGenericWindowId() override;
94 void SetDisplayId(void*) override;
95 void SetParentId(void*) override;
96 void* GetGenericDisplayId() override;
97 void* GetGenericParentId() override;
98 void* GetGenericContext() override;
99 void* GetGenericDrawable() override;
100 void SetWindowInfo(const char*) override;
101 void SetParentInfo(const char*) override;
102 int* GetScreenSize() VTK_SIZEHINT(2) override;
103 void HideCursor() override;
104 void ShowCursor() override;
105 void SetFullScreen(vtkTypeBool) override;
106 void WindowRemap() override;
107 vtkTypeBool GetEventPending() override;
108 void SetNextWindowId(void*) override;
109 void SetNextWindowInfo(const char*) override;
110 void CreateAWindow() override;
111 void DestroyWindow() override;
112 // }@
113
115
119 void SetIsDirect(vtkTypeBool newValue);
120 void SetSupportsOpenGL(int newValue);
121 void SetIsCurrent(bool newValue);
123
131 void Render() override;
132
136 float GetMaximumHardwareLineWidth() override;
137
139
143 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
144 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
146
148
153 vtkSetMacro(ReadyForRendering, bool);
154 vtkGetMacro(ReadyForRendering, bool);
155
160 vtkSetVector2Macro(ScreenSize, int);
161
165 void SetCurrentCursor(int cShape) override;
166
167 // since we are using an external context it must
168 // specify if the window is mapped or not.
169 vtkSetMacro(Mapped, vtkTypeBool);
170
174 void OpenGLInit() override;
175
176protected:
182 int ReadPixels(
183 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
184
185 int SetPixelData(
186 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
187 int SetPixelData(
188 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
189 int SetRGBACharPixelData(
190 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
191 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
192 int blend = 0, int right = 0) override;
193
194 int DirectStatus;
195 int SupportsOpenGLStatus;
196 bool CurrentStatus;
197 float ForceMaximumHardwareLineWidth;
198 bool ReadyForRendering;
199
200private:
202 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
203};
204
205VTK_ABI_NAMESPACE_END
206#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:38
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(...)