VTK  9.2.6
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=========================================================================*/
35
36#ifndef vtkGenericOpenGLRenderWindow_h
37#define vtkGenericOpenGLRenderWindow_h
38
40#include "vtkRenderingOpenGL2Module.h" // For export macro
41
42class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
49protected:
52
53public:
55 void Finalize() override;
56
59 void Frame() override;
60
63 void MakeCurrent() override;
64
68 bool IsCurrent() override;
69
73 int SupportsOpenGL() override;
74
79
80 // {@
82 void SetFrontLeftBuffer(unsigned int);
83 void SetFrontRightBuffer(unsigned int);
84 void SetBackLeftBuffer(unsigned int);
85 void SetBackRightBuffer(unsigned int);
86 // }@
87
89
91 void PushState() {}
93 void PopState() {}
94
95 // {@
97 void SetWindowId(void*) override;
98 void* GetGenericWindowId() override;
99 void SetDisplayId(void*) override;
100 void SetParentId(void*) override;
101 void* GetGenericDisplayId() override;
102 void* GetGenericParentId() override;
103 void* GetGenericContext() override;
104 void* GetGenericDrawable() override;
105 void SetWindowInfo(const char*) override;
106 void SetParentInfo(const char*) override;
107 int* GetScreenSize() VTK_SIZEHINT(2) override;
108 void HideCursor() override;
109 void ShowCursor() override;
111 void WindowRemap() override;
113 void SetNextWindowId(void*) override;
114 void SetNextWindowInfo(const char*) override;
115 void CreateAWindow() override;
116 void DestroyWindow() override;
117 // }@
118
120
124 void SetIsDirect(vtkTypeBool newValue);
125 void SetSupportsOpenGL(int newValue);
126 void SetIsCurrent(bool newValue);
128
136 void Render() override;
137
142
144
148 vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
149 vtkGetMacro(ForceMaximumHardwareLineWidth, float);
151
153
158 vtkSetMacro(ReadyForRendering, bool);
159 vtkGetMacro(ReadyForRendering, bool);
160
165 vtkSetVector2Macro(ScreenSize, int);
166
170 void SetCurrentCursor(int cShape) override;
171
172 // since we are using an external context it must
173 // specify if the window is mapped or not.
174 vtkSetMacro(Mapped, vtkTypeBool);
175
180 "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
181 bool IsDrawable() override;
182
186 void OpenGLInit() override;
187
188protected:
195 const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
196
198 int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
200 int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
202 int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
203 int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
204 int blend = 0, int right = 0) override;
205
211
212private:
214 void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
215};
216
217#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.
bool IsDrawable() override
Overridden to simply call GetReadyForRendering
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:40
dynamic, self-adjusting array of unsigned char
vtkTypeBool Mapped
Definition vtkWindow.h:275
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(...)