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=========================================================================*/
45#ifndef vtkGenericOpenGLRenderWindow_h
46#define vtkGenericOpenGLRenderWindow_h
47
49#include "vtkRenderingOpenGL2Module.h" // For export macro
50
51class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
52{
53public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
58protected:
61
62public:
64 void Finalize() override;
65
68 void Frame() override;
69
72 void MakeCurrent() override;
73
77 bool IsCurrent() override;
78
82 int SupportsOpenGL() override;
83
88
89 // {@
91 void SetFrontLeftBuffer(unsigned int);
92 void SetFrontRightBuffer(unsigned int);
93 void SetBackLeftBuffer(unsigned int);
94 void SetBackRightBuffer(unsigned int);
95 // }@
96
98
100 void PushState() {}
102 void PopState() {}
103
104 // {@
106 void SetWindowId(void*) override;
107 void* GetGenericWindowId() override;
108 void SetDisplayId(void*) override;
109 void SetParentId(void*) override;
110 void* GetGenericDisplayId() override;
111 void* GetGenericParentId() override;
112 void* GetGenericContext() override;
113 void* GetGenericDrawable() override;
114 void SetWindowInfo(const char*) override;
115 void SetParentInfo(const char*) override;
116 int* GetScreenSize() VTK_SIZEHINT(2) override;
117 void HideCursor() override;
118 void ShowCursor() override;
119 void SetFullScreen(vtkTypeBool) override;
120 void WindowRemap() override;
121 vtkTypeBool GetEventPending() override;
122 void SetNextWindowId(void*) override;
123 void SetNextWindowInfo(const char*) override;
124 void CreateAWindow() override;
125 void DestroyWindow() override;
126 // }@
127
129
133 void SetIsDirect(vtkTypeBool newValue);
134 void SetSupportsOpenGL(int newValue);
135 void SetIsCurrent(bool newValue);
137
145 void Render() override;
146
150 float GetMaximumHardwareLineWidth() override;
151
153
157 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
158 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
160
162
167 vtkSetMacro(ReadyForRendering, bool);
168 vtkGetMacro(ReadyForRendering, bool);
169
174 vtkSetVector2Macro(ScreenSize, int);
175
179 void SetCurrentCursor(int cShape) override;
180
181 // since we are using an external context it must
182 // specify if the window is mapped or not.
183 vtkSetMacro(Mapped, vtkTypeBool);
184
189 "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
190 bool IsDrawable() override;
191
195 void OpenGLInit() override;
196
197protected:
203 int ReadPixels(
204 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
205
206 int SetPixelData(
207 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
208 int SetPixelData(
209 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
210 int SetRGBACharPixelData(
211 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
212 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
213 int blend = 0, int right = 0) override;
214
215 int DirectStatus;
216 int SupportsOpenGLStatus;
217 bool CurrentStatus;
218 float ForceMaximumHardwareLineWidth;
219 bool ReadyForRendering;
220
221private:
223 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
224};
225
226#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:43
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(...)