VTK  9.0.1
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 =========================================================================*/
30 #ifndef vtkGenericOpenGLRenderWindow_h
31 #define vtkGenericOpenGLRenderWindow_h
32 
33 #include "vtkOpenGLRenderWindow.h"
34 #include "vtkRenderingOpenGL2Module.h" // For export macro
35 
36 class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43 protected:
45  ~vtkGenericOpenGLRenderWindow() override;
46 
47 public:
49  void Finalize() override;
50 
53  void Frame() override;
54 
57  void MakeCurrent() override;
58 
62  bool IsCurrent() override;
63 
67  int SupportsOpenGL() override;
68 
72  vtkTypeBool IsDirect() override;
73 
74  // {@
76  void SetFrontLeftBuffer(unsigned int);
77  void SetFrontRightBuffer(unsigned int);
78  void SetBackLeftBuffer(unsigned int);
79  void SetBackRightBuffer(unsigned int);
80  // }@
81 
82  void SetDefaultFrameBufferId(unsigned int);
83  void SetOwnContext(int);
84 
86  void PushState() {}
88  void PopState() {}
89 
90  // {@
92  void SetWindowId(void*) override;
93  void* GetGenericWindowId() override;
94  void SetDisplayId(void*) override;
95  void SetParentId(void*) override;
96  void* GetGenericDisplayId() override;
97  void* GetGenericParentId() override;
98  void* GetGenericContext() override;
99  void* GetGenericDrawable() override;
100  void SetWindowInfo(const char*) override;
101  void SetParentInfo(const char*) override;
102  int* GetScreenSize() VTK_SIZEHINT(2) override;
103  void HideCursor() override;
104  void ShowCursor() override;
105  void SetFullScreen(vtkTypeBool) override;
106  void WindowRemap() override;
107  vtkTypeBool GetEventPending() override;
108  void SetNextWindowId(void*) override;
109  void SetNextWindowInfo(const char*) override;
110  void CreateAWindow() override;
111  void DestroyWindow() override;
112  // }@
113 
115 
119  void SetIsDirect(vtkTypeBool newValue);
120  void SetSupportsOpenGL(int newValue);
121  void SetIsCurrent(bool newValue);
123 
131  void Render() override;
132 
136  float GetMaximumHardwareLineWidth() override;
137 
139 
143  vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
144  vtkGetMacro(ForceMaximumHardwareLineWidth, float);
146 
148 
153  vtkSetMacro(ReadyForRendering, bool);
154  vtkGetMacro(ReadyForRendering, bool);
155 
160  vtkSetVector2Macro(ScreenSize, int);
161 
165  void SetCurrentCursor(int cShape) override;
166 
167  // since we are using an external context it must
168  // specify if the window is mapped or not.
169  vtkSetMacro(Mapped, vtkTypeBool);
170 
174  VTK_LEGACY(bool IsDrawable() override);
175 
176 protected:
182  int ReadPixels(
183  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
184 
185  int SetPixelData(
186  int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
187  int SetPixelData(
188  int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
189  int SetRGBACharPixelData(
190  int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
191  int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
192  int blend = 0, int right = 0) override;
193 
194  int DirectStatus;
195  int SupportsOpenGLStatus;
196  bool CurrentStatus;
197  float ForceMaximumHardwareLineWidth;
198  bool ReadyForRendering;
199 
200 private:
202  void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
203 };
204 
205 #endif
OpenGL rendering window.
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on...
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
void PushState()
no-op (for API compat with OpenGL1).
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
virtual void Finalize()
Finalize the rendering process.
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
void SetWindowId(void *) override
Dummy stubs for vtkWindow API.
platform independent render window
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:104
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
#define VTK_SIZEHINT(...)
dynamic, self-adjusting array of unsigned char
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void PopState()
no-op (for API compat with OpenGL1).
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
virtual vtkTypeBool IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.