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 =========================================================================*/
106 #ifndef vtkGenericOpenGLRenderWindow_h
107 #define vtkGenericOpenGLRenderWindow_h
108 
109 #include "vtkOpenGLRenderWindow.h"
110 #include "vtkRenderingOpenGL2Module.h" // For export macro
111 
112 class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
113 {
114 public:
117  void PrintSelf(ostream& os, vtkIndent indent) override;
118 
119 protected:
122 
123 public:
125  void Finalize() override;
126 
129  void Frame() override;
130 
133  void MakeCurrent() override;
134 
138  bool IsCurrent() override;
139 
143  int SupportsOpenGL() override;
144 
148  vtkTypeBool IsDirect() override;
149 
150  // {@
152  void SetFrontLeftBuffer(unsigned int);
153  void SetFrontRightBuffer(unsigned int);
154  void SetBackLeftBuffer(unsigned int);
155  void SetBackRightBuffer(unsigned int);
156  // }@
157 
159 
161  void PushState() {}
163  void PopState() {}
164 
165  // {@
167  void SetWindowId(void*) override;
168  void* GetGenericWindowId() override;
169  void SetDisplayId(void*) override;
170  void SetParentId(void*) override;
171  void* GetGenericDisplayId() override;
172  void* GetGenericParentId() override;
173  void* GetGenericContext() override;
174  void* GetGenericDrawable() override;
175  void SetWindowInfo(const char*) override;
176  void SetParentInfo(const char*) override;
177  int* GetScreenSize() VTK_SIZEHINT(2) override;
178  void HideCursor() override;
179  void ShowCursor() override;
180  void SetFullScreen(vtkTypeBool) override;
181  void WindowRemap() override;
182  vtkTypeBool GetEventPending() override;
183  void SetNextWindowId(void*) override;
184  void SetNextWindowInfo(const char*) override;
185  void CreateAWindow() override;
186  void DestroyWindow() override;
187  // }@
188 
190 
194  void SetIsDirect(vtkTypeBool newValue);
195  void SetSupportsOpenGL(int newValue);
196  void SetIsCurrent(bool newValue);
198 
206  void Render() override;
207 
211  float GetMaximumHardwareLineWidth() override;
212 
214 
218  vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
219  vtkGetMacro(ForceMaximumHardwareLineWidth, float);
221 
223 
228  vtkSetMacro(ReadyForRendering, bool);
229  vtkGetMacro(ReadyForRendering, bool);
230 
235  vtkSetVector2Macro(ScreenSize, int);
236 
240  void SetCurrentCursor(int cShape) override;
241 
242  // since we are using an external context it must
243  // specify if the window is mapped or not.
244  vtkSetMacro(Mapped, vtkTypeBool);
245 
250  "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
251  bool IsDrawable() override;
252 
256  void OpenGLInit() override;
257 
258 protected:
264  int ReadPixels(
265  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
266 
267  int SetPixelData(
268  int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
269  int SetPixelData(
270  int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
271  int SetRGBACharPixelData(
272  int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
273  int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
274  int blend = 0, int right = 0) override;
275 
276  int DirectStatus;
277  int SupportsOpenGLStatus;
278  bool CurrentStatus;
279  float ForceMaximumHardwareLineWidth;
280  bool ReadyForRendering;
281 
282 private:
284  void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
285 };
286 
287 #endif
platform independent render window
void Finalize() override
Cleans up graphics resources allocated in the context for this VTK scene.
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
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
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 * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
void SetOwnContext(vtkTypeBool)
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 * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
static vtkGenericOpenGLRenderWindow * New()
a simple class to control print indentation
Definition: vtkIndent.h:113
OpenGL rendering window.
dynamic, self-adjusting array of unsigned char
@ data
Definition: vtkX3D.h:321
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(...)