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=========================================================================*/
116#ifndef vtkGenericOpenGLRenderWindow_h
117#define vtkGenericOpenGLRenderWindow_h
118
120#include "vtkRenderingOpenGL2Module.h" // For export macro
121
122class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
123{
124public:
127 void PrintSelf(ostream& os, vtkIndent indent) override;
128
129protected:
132
133public:
135 void Finalize() override;
136
139 void Frame() override;
140
143 void MakeCurrent() override;
144
148 bool IsCurrent() override;
149
153 int SupportsOpenGL() override;
154
159
160 // {@
162 void SetFrontLeftBuffer(unsigned int);
163 void SetFrontRightBuffer(unsigned int);
164 void SetBackLeftBuffer(unsigned int);
165 void SetBackRightBuffer(unsigned int);
166 // }@
167
169
171 void PushState() {}
173 void PopState() {}
174
175 // {@
177 void SetWindowId(void*) override;
178 void* GetGenericWindowId() override;
179 void SetDisplayId(void*) override;
180 void SetParentId(void*) override;
181 void* GetGenericDisplayId() override;
182 void* GetGenericParentId() override;
183 void* GetGenericContext() override;
184 void* GetGenericDrawable() override;
185 void SetWindowInfo(const char*) override;
186 void SetParentInfo(const char*) override;
187 int* GetScreenSize() VTK_SIZEHINT(2) override;
188 void HideCursor() override;
189 void ShowCursor() override;
190 void SetFullScreen(vtkTypeBool) override;
191 void WindowRemap() override;
192 vtkTypeBool GetEventPending() override;
193 void SetNextWindowId(void*) override;
194 void SetNextWindowInfo(const char*) override;
195 void CreateAWindow() override;
196 void DestroyWindow() override;
197 // }@
198
200
204 void SetIsDirect(vtkTypeBool newValue);
205 void SetSupportsOpenGL(int newValue);
206 void SetIsCurrent(bool newValue);
208
216 void Render() override;
217
221 float GetMaximumHardwareLineWidth() override;
222
224
228 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
229 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
231
233
238 vtkSetMacro(ReadyForRendering, bool);
239 vtkGetMacro(ReadyForRendering, bool);
240
245 vtkSetVector2Macro(ScreenSize, int);
246
250 void SetCurrentCursor(int cShape) override;
251
252 // since we are using an external context it must
253 // specify if the window is mapped or not.
254 vtkSetMacro(Mapped, vtkTypeBool);
255
260 "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
261 bool IsDrawable() override;
262
266 void OpenGLInit() override;
267
268protected:
274 int ReadPixels(
275 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
276
277 int SetPixelData(
278 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
279 int SetPixelData(
280 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
281 int SetRGBACharPixelData(
282 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
283 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
284 int blend = 0, int right = 0) override;
285
286 int DirectStatus;
287 int SupportsOpenGLStatus;
288 bool CurrentStatus;
289 float ForceMaximumHardwareLineWidth;
290 bool ReadyForRendering;
291
292private:
294 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
295};
296
297#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
@ data
Definition: vtkX3D.h:321
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(...)