VTK  9.0.3
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 
30 #include "vtkOpenGLRenderWindow.h"
31 #include "vtkRenderingOpenGL2Module.h" // For export macro
32 
33 class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
34 {
35 public:
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40 protected:
43 
44 public:
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 
69  vtkTypeBool IsDirect() override;
70 
71  // {@
73  void SetFrontLeftBuffer(unsigned int);
74  void SetFrontRightBuffer(unsigned int);
75  void SetBackLeftBuffer(unsigned int);
76  void SetBackRightBuffer(unsigned int);
77  // }@
78 
79  void SetDefaultFrameBufferId(unsigned int);
80  void SetOwnContext(int);
81 
83  void PushState() {}
85  void PopState() {}
86 
87  // {@
89  void SetWindowId(void*) override;
90  void* GetGenericWindowId() override;
91  void SetDisplayId(void*) override;
92  void SetParentId(void*) override;
93  void* GetGenericDisplayId() override;
94  void* GetGenericParentId() override;
95  void* GetGenericContext() override;
96  void* GetGenericDrawable() override;
97  void SetWindowInfo(const char*) override;
98  void SetParentInfo(const char*) override;
99  int* GetScreenSize() VTK_SIZEHINT(2) override;
100  void HideCursor() override;
101  void ShowCursor() override;
102  void SetFullScreen(vtkTypeBool) override;
103  void WindowRemap() override;
104  vtkTypeBool GetEventPending() override;
105  void SetNextWindowId(void*) override;
106  void SetNextWindowInfo(const char*) override;
107  void CreateAWindow() override;
108  void DestroyWindow() override;
109  // }@
110 
112 
116  void SetIsDirect(vtkTypeBool newValue);
117  void SetSupportsOpenGL(int newValue);
118  void SetIsCurrent(bool newValue);
120 
128  void Render() override;
129 
133  float GetMaximumHardwareLineWidth() override;
134 
136 
140  vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
141  vtkGetMacro(ForceMaximumHardwareLineWidth, float);
143 
145 
150  vtkSetMacro(ReadyForRendering, bool);
151  vtkGetMacro(ReadyForRendering, bool);
152 
157  vtkSetVector2Macro(ScreenSize, int);
158 
162  void SetCurrentCursor(int cShape) override;
163 
164  // since we are using an external context it must
165  // specify if the window is mapped or not.
166  vtkSetMacro(Mapped, vtkTypeBool);
167 
171  VTK_LEGACY(bool IsDrawable() override);
172 
173 protected:
179  int ReadPixels(
180  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
181 
182  int SetPixelData(
183  int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
184  int SetPixelData(
185  int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
186  int SetRGBACharPixelData(
187  int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
188  int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
189  int blend = 0, int right = 0) override;
190 
191  int DirectStatus;
192  int SupportsOpenGLStatus;
193  bool CurrentStatus;
194  float ForceMaximumHardwareLineWidth;
195  bool ReadyForRendering;
196 
197 private:
199  void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
200 };
201 
202 #endif
platform independent render window
void Finalize() override
Cleans up graphics resources allocated in the context for this VTK scene.
void * GetGenericDisplayId() override
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.
int * GetScreenSize() override
Get the current size of the screen in pixels.
~vtkGenericOpenGLRenderWindow() override
vtkTypeBool IsDirect() override
Returns if the context is direct.
void SetParentInfo(const char *) override
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
void SetWindowInfo(const char *) override
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 * GetGenericDrawable() override
void * GetGenericContext() override
void * GetGenericParentId() override
void SetFrontLeftBuffer(unsigned int)
set the drawing buffers to use
void SetDefaultFrameBufferId(unsigned int)
void SetBackLeftBuffer(unsigned int)
void PushState()
no-op (for API compat with OpenGL1).
bool IsCurrent() override
Returns if the context is current.
void * GetGenericWindowId() override
static vtkGenericOpenGLRenderWindow * New()
a simple class to control print indentation
Definition: vtkIndent.h:34
OpenGL rendering window.
dynamic, self-adjusting array of unsigned char
@ data
Definition: vtkX3D.h:321
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
#define VTK_SIZEHINT(...)