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=========================================================================*/
27#ifndef vtkGenericOpenGLRenderWindow_h
28#define vtkGenericOpenGLRenderWindow_h
29
31#include "vtkRenderingOpenGL2Module.h" // For export macro
32
33class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
40protected:
43
44public:
46 void Finalize() override;
47
50 void Frame() override;
51
54 void MakeCurrent() override;
55
59 bool IsCurrent() override;
60
64 int SupportsOpenGL() override;
65
70
71 // {@
73 void SetFrontLeftBuffer(unsigned int);
74 void SetFrontRightBuffer(unsigned int);
75 void SetBackLeftBuffer(unsigned int);
76 void SetBackRightBuffer(unsigned int);
77 // }@
78
80
82 void PushState() {}
84 void PopState() {}
85
86 // {@
88 void SetWindowId(void*) override;
89 void* GetGenericWindowId() override;
90 void SetDisplayId(void*) override;
91 void SetParentId(void*) override;
92 void* GetGenericDisplayId() override;
93 void* GetGenericParentId() override;
94 void* GetGenericContext() override;
95 void* GetGenericDrawable() override;
96 void SetWindowInfo(const char*) override;
97 void SetParentInfo(const char*) override;
98 int* GetScreenSize() VTK_SIZEHINT(2) override;
99 void HideCursor() override;
100 void ShowCursor() override;
101 void SetFullScreen(vtkTypeBool) override;
102 void WindowRemap() override;
103 vtkTypeBool GetEventPending() override;
104 void SetNextWindowId(void*) override;
105 void SetNextWindowInfo(const char*) override;
106 void CreateAWindow() override;
107 void DestroyWindow() override;
108 // }@
109
111
115 void SetIsDirect(vtkTypeBool newValue);
116 void SetSupportsOpenGL(int newValue);
117 void SetIsCurrent(bool newValue);
119
127 void Render() override;
128
132 float GetMaximumHardwareLineWidth() override;
133
135
139 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
140 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
142
144
149 vtkSetMacro(ReadyForRendering, bool);
150 vtkGetMacro(ReadyForRendering, bool);
151
156 vtkSetVector2Macro(ScreenSize, int);
157
161 void SetCurrentCursor(int cShape) override;
162
163 // since we are using an external context it must
164 // specify if the window is mapped or not.
165 vtkSetMacro(Mapped, vtkTypeBool);
166
171 "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
172 bool IsDrawable() override;
173
177 void OpenGLInit() override;
178
179protected:
185 int ReadPixels(
186 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
187
188 int SetPixelData(
189 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
190 int SetPixelData(
191 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
192 int SetRGBACharPixelData(
193 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
194 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
195 int blend = 0, int right = 0) override;
196
197 int DirectStatus;
198 int SupportsOpenGLStatus;
199 bool CurrentStatus;
200 float ForceMaximumHardwareLineWidth;
201 bool ReadyForRendering;
202
203private:
205 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
206};
207
208#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:34
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(...)