VTK  9.1.0
vtkGenericOpenGLRenderWindow.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkRenderWindow.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=========================================================================*/
125#ifndef vtkGenericOpenGLRenderWindow_h
126#define vtkGenericOpenGLRenderWindow_h
127
129#include "vtkRenderingOpenGL2Module.h" // For export macro
130
131class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
132{
133public:
136 void PrintSelf(ostream& os, vtkIndent indent) override;
137
138protected:
141
142public:
144 void Finalize() override;
145
148 void Frame() override;
149
152 void MakeCurrent() override;
153
157 bool IsCurrent() override;
158
162 int SupportsOpenGL() override;
163
168
169 // {@
171 void SetFrontLeftBuffer(unsigned int);
172 void SetFrontRightBuffer(unsigned int);
173 void SetBackLeftBuffer(unsigned int);
174 void SetBackRightBuffer(unsigned int);
175 // }@
176
178
180 void PushState() {}
182 void PopState() {}
183
184 // {@
186 void SetWindowId(void*) override;
187 void* GetGenericWindowId() override;
188 void SetDisplayId(void*) override;
189 void SetParentId(void*) override;
190 void* GetGenericDisplayId() override;
191 void* GetGenericParentId() override;
192 void* GetGenericContext() override;
193 void* GetGenericDrawable() override;
194 void SetWindowInfo(const char*) override;
195 void SetParentInfo(const char*) override;
196 int* GetScreenSize() VTK_SIZEHINT(2) override;
197 void HideCursor() override;
198 void ShowCursor() override;
199 void SetFullScreen(vtkTypeBool) override;
200 void WindowRemap() override;
201 vtkTypeBool GetEventPending() override;
202 void SetNextWindowId(void*) override;
203 void SetNextWindowInfo(const char*) override;
204 void CreateAWindow() override;
205 void DestroyWindow() override;
206 // }@
207
209
213 void SetIsDirect(vtkTypeBool newValue);
214 void SetSupportsOpenGL(int newValue);
215 void SetIsCurrent(bool newValue);
217
225 void Render() override;
226
230 float GetMaximumHardwareLineWidth() override;
231
233
237 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
238 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
240
242
247 vtkSetMacro(ReadyForRendering, bool);
248 vtkGetMacro(ReadyForRendering, bool);
249
254 vtkSetVector2Macro(ScreenSize, int);
255
259 void SetCurrentCursor(int cShape) override;
260
261 // since we are using an external context it must
262 // specify if the window is mapped or not.
263 vtkSetMacro(Mapped, vtkTypeBool);
264
269 "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
270 bool IsDrawable() override;
271
275 void OpenGLInit() override;
276
277protected:
283 int ReadPixels(
284 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
285
286 int SetPixelData(
287 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
288 int SetPixelData(
289 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
290 int SetRGBACharPixelData(
291 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
292 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
293 int blend = 0, int right = 0) override;
294
295 int DirectStatus;
296 int SupportsOpenGLStatus;
297 bool CurrentStatus;
298 float ForceMaximumHardwareLineWidth;
299 bool ReadyForRendering;
300
301private:
303 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
304};
305
306#endif
platform independent render window
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
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
Dummy stubs for vtkWindow API.
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
void Frame() override
flush the pending drawing operations Class user may to watch for WindowFrameEvent and act on it
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
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
Dummy stubs for vtkWindow API.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
int * GetScreenSize() override
Get the current size of the screen in pixels.
void SetOwnContext(vtkTypeBool)
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
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
Dummy stubs for vtkWindow API.
a simple class to control print indentation
Definition: vtkIndent.h:113
OpenGL rendering window.
dynamic, self-adjusting array of unsigned char
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_1_0(reason)
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
#define VTK_SIZEHINT(...)