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 =========================================================================*/
36 #ifndef vtkGenericOpenGLRenderWindow_h
37 #define vtkGenericOpenGLRenderWindow_h
38 
39 #include "vtkOpenGLRenderWindow.h"
40 #include "vtkRenderingOpenGL2Module.h" // For export macro
41 
42 class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow : public vtkOpenGLRenderWindow
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49 protected:
51  ~vtkGenericOpenGLRenderWindow() override;
52 
53 public:
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 
78  vtkTypeBool IsDirect() override;
79 
80  // {@
82  void SetFrontLeftBuffer(unsigned int);
83  void SetFrontRightBuffer(unsigned int);
84  void SetBackLeftBuffer(unsigned int);
85  void SetBackRightBuffer(unsigned int);
86  // }@
87 
88  void SetDefaultFrameBufferId(unsigned int);
89  void SetOwnContext(int);
90 
92  void PushState() {}
94  void PopState() {}
95 
96  // {@
98  void SetWindowId(void*) override;
99  void* GetGenericWindowId() override;
100  void SetDisplayId(void*) override;
101  void SetParentId(void*) override;
102  void* GetGenericDisplayId() override;
103  void* GetGenericParentId() override;
104  void* GetGenericContext() override;
105  void* GetGenericDrawable() override;
106  void SetWindowInfo(const char*) override;
107  void SetParentInfo(const char*) override;
108  int* GetScreenSize() VTK_SIZEHINT(2) override;
109  void HideCursor() override;
110  void ShowCursor() override;
111  void SetFullScreen(vtkTypeBool) override;
112  void WindowRemap() override;
113  vtkTypeBool GetEventPending() override;
114  void SetNextWindowId(void*) override;
115  void SetNextWindowInfo(const char*) override;
116  void CreateAWindow() override;
117  void DestroyWindow() override;
118  // }@
119 
121 
125  void SetIsDirect(vtkTypeBool newValue);
126  void SetSupportsOpenGL(int newValue);
127  void SetIsCurrent(bool newValue);
129 
137  void Render() override;
138 
142  float GetMaximumHardwareLineWidth() override;
143 
145 
149  vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
150  vtkGetMacro(ForceMaximumHardwareLineWidth, float);
152 
154 
159  vtkSetMacro(ReadyForRendering, bool);
160  vtkGetMacro(ReadyForRendering, bool);
161 
166  vtkSetVector2Macro(ScreenSize, int);
167 
171  void SetCurrentCursor(int cShape) override;
172 
173  // since we are using an external context it must
174  // specify if the window is mapped or not.
175  vtkSetMacro(Mapped, vtkTypeBool);
176 
180  VTK_LEGACY(bool IsDrawable() override);
181 
182 protected:
188  int ReadPixels(
189  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right) override;
190 
191  int SetPixelData(
192  int x1, int y1, int x2, int y2, unsigned char* data, int front, int right) override;
193  int SetPixelData(
194  int x1, int y1, int x2, int y2, vtkUnsignedCharArray* data, int front, int right) override;
195  int SetRGBACharPixelData(
196  int x1, int y1, int x2, int y2, unsigned char* data, int front, int blend, int right) override;
197  int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray* data, int front,
198  int blend = 0, int right = 0) override;
199 
200  int DirectStatus;
201  int SupportsOpenGLStatus;
202  bool CurrentStatus;
203  float ForceMaximumHardwareLineWidth;
204  bool ReadyForRendering;
205 
206 private:
208  void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
209 };
210 
211 #endif
vtkOpenGLRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLRenderWindow::SupportsOpenGL
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
vtkRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override
Definition: vtkRenderWindow.h:623
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkGenericOpenGLRenderWindow
platform independent render window
Definition: vtkGenericOpenGLRenderWindow.h:42
vtkRenderWindow::SetWindowId
void SetWindowId(void *) override
Definition: vtkRenderWindow.h:615
vtkRenderWindow::GetGenericParentId
void * GetGenericParentId() override
Definition: vtkRenderWindow.h:620
vtkRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Definition: vtkRenderWindow.h:622
vtkRenderWindow::GetGenericDisplayId
void * GetGenericDisplayId() override
Definition: vtkRenderWindow.h:618
vtkRenderWindow::SetDisplayId
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
Definition: vtkRenderWindow.h:614
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkRenderWindow::Finalize
virtual void Finalize()
Finalize the rendering process.
Definition: vtkRenderWindow.h:176
vtkRenderWindow::MakeCurrent
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:651
vtkRenderWindow::IsDirect
virtual vtkTypeBool IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
Definition: vtkRenderWindow.h:687
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkGenericOpenGLRenderWindow::PushState
void PushState()
no-op (for API compat with OpenGL1).
Definition: vtkGenericOpenGLRenderWindow.h:92
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:163
vtkRenderWindow::SetParentInfo
void SetParentInfo(const char *) override
Definition: vtkRenderWindow.h:625
vtkWindow::GetScreenSize
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:104
vtkRenderWindow::SetParentId
void SetParentId(void *) override
Definition: vtkRenderWindow.h:617
vtkOpenGLRenderWindow::Frame
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkGenericOpenGLRenderWindow::PopState
void PopState()
no-op (for API compat with OpenGL1).
Definition: vtkGenericOpenGLRenderWindow.h:94
vtkRecti
Definition: vtkRect.h:312
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:51
vtkRenderWindow::GetGenericContext
void * GetGenericContext() override
Definition: vtkRenderWindow.h:621
vtkRenderWindow::IsCurrent
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:657
vtkRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Definition: vtkRenderWindow.h:619
vtkRenderWindow::New
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on,...
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkOpenGLRenderWindow.h