VTK  9.5.2
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
109
110#ifndef vtkGenericOpenGLRenderWindow_h
111#define vtkGenericOpenGLRenderWindow_h
112
114#include "vtkRenderingOpenGL2Module.h" // For export macro
115
116VTK_ABI_NAMESPACE_BEGIN
117class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
118{
119public:
122 void PrintSelf(ostream& os, vtkIndent indent) override;
123
124protected:
127
128public:
130 void Finalize() override;
131
134 void Frame() override;
135
138 void MakeCurrent() override;
139
143 bool IsCurrent() override;
144
148 int SupportsOpenGL() override;
149
154
155 // {@
157 void SetFrontLeftBuffer(unsigned int);
158 void SetFrontRightBuffer(unsigned int);
159 void SetBackLeftBuffer(unsigned int);
160 void SetBackRightBuffer(unsigned int);
161 // }@
162
164
166 void PushState() {}
168 void PopState() {}
169
170 // {@
172 void SetWindowId(void*) override;
173 void* GetGenericWindowId() override;
174 void SetDisplayId(void*) override;
175 void SetParentId(void*) override;
176 void* GetGenericDisplayId() override;
177 void* GetGenericParentId() override;
178 void* GetGenericContext() override;
179 void* GetGenericDrawable() override;
180 void SetWindowInfo(const char*) override;
181 void SetParentInfo(const char*) override;
182 int* GetScreenSize() VTK_SIZEHINT(2) override;
183 void HideCursor() override;
184 void ShowCursor() override;
186 void WindowRemap() override;
188 void SetNextWindowId(void*) override;
189 void SetNextWindowInfo(const char*) override;
190 void CreateAWindow() override;
191 void DestroyWindow() override;
192 // }@
193
195
199 void SetIsDirect(vtkTypeBool newValue);
200 void SetSupportsOpenGL(int newValue);
201 void SetIsCurrent(bool newValue);
203
211 void Render() override;
212
217
219
223 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
224 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
226
228
233 vtkSetMacro(ReadyForRendering, bool);
234 vtkGetMacro(ReadyForRendering, bool);
235
240 vtkSetVector2Macro(ScreenSize, int);
241
245 void SetCurrentCursor(int cShape) override;
246
247 // since we are using an external context it must
248 // specify if the window is mapped or not.
249 vtkSetMacro(Mapped, vtkTypeBool);
250
254 void OpenGLInit() override;
255
256protected:
263 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
264
266 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
268 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
270 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
271 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
272 int blend = 0, int right = 0) override;
273
279
280private:
282 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
283};
284
285VTK_ABI_NAMESPACE_END
286#endif
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 CreateAWindow() override
Create a not-off-screen window.
int SetRGBACharPixelData(int x1, int y1, int x2, int y2, unsigned char *data, int front, int blend, int right) override
Set this to true to indicate that the context is now ready.
void WindowRemap() override
Remap the rendering window.
void SetWindowId(void *) override
does nothing
int SetPixelData(int x1, int y1, int x2, int y2, unsigned char *data, int front, int right) override
Set this to true to indicate that the context is now ready.
float GetMaximumHardwareLineWidth() override
Overridden to pass explicitly specified MaximumHardwareLineWidth, if any.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool ReadyForRendering
Set this to true to indicate that the context is now ready.
void SetIsDirect(vtkTypeBool newValue)
Allow to update state within observer callback without changing data argument and MTime.
static vtkGenericOpenGLRenderWindow * New()
~vtkGenericOpenGLRenderWindow() override
vtkTypeBool IsDirect() override
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 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 SetSupportsOpenGL(int newValue)
Allow to update state within observer callback without changing data argument and MTime.
void SetParentId(void *) override
These are window system independent methods that are used to help interface vtkWindow to native windo...
int DirectStatus
Set this to true to indicate that the context is now ready.
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)
float ForceMaximumHardwareLineWidth
Set this to true to indicate that the context is now ready.
void SetNextWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
void PopState()
no-op (for API compat with OpenGL1).
bool CurrentStatus
Set this to true to indicate that the context is now ready.
void SetFrontRightBuffer(unsigned int)
void * GetGenericContext() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetIsCurrent(bool newValue)
Allow to update state within observer callback without changing data argument and MTime.
void OpenGLInit() override
Initialize OpenGL for this window.
vtkTypeBool GetEventPending() override
Check to see if a mouse button has been pressed.
void Render() override
Override the Render method to do some state management.
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
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)
int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right) override
Overridden to not attempt to read pixels if this->ReadyForRendering is false.
void DestroyWindow() override
Destroy a not-off-screen window.
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
int SupportsOpenGLStatus
Set this to true to indicate that the context is now ready.
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 SetBackLeftBuffer(unsigned int)
void PushState()
no-op (for API compat with OpenGL1).
void SetCurrentCursor(int cShape) override
Overridden to invoke vtkCommand::CursorChangedEvent.
void * GetGenericDrawable() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetFullScreen(vtkTypeBool) override
Turn on/off rendering full screen window size.
a simple class to control print indentation
Definition vtkIndent.h:108
dynamic, self-adjusting array of unsigned char
vtkTypeBool Mapped
Definition vtkWindow.h:287
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FLOAT_MAX
Definition vtkType.h:169
#define VTK_SIZEHINT(...)