VTK
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 "vtkRenderingOpenGL2Module.h" // For export macro
31 #include "vtkOpenGLRenderWindow.h"
32 
33 class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow :
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 protected:
42  ~vtkGenericOpenGLRenderWindow() override;
43 
44 public:
45 
47  void Finalize() override;
48 
51  void Frame() override;
52 
55  void MakeCurrent() override;
56 
60  bool IsCurrent() override;
61 
65  int SupportsOpenGL() override;
66 
70  int IsDirect() override;
71 
72  // {@
74  void SetFrontBuffer(unsigned int);
75  void SetFrontLeftBuffer(unsigned int);
76  void SetFrontRightBuffer(unsigned int);
77  void SetBackBuffer(unsigned int);
78  void SetBackLeftBuffer(unsigned int);
79  void SetBackRightBuffer(unsigned int);
80  // }@
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 Start() override;
101  void HideCursor() override;
102  void ShowCursor() override;
103  void SetFullScreen(vtkTypeBool) override;
104  void WindowRemap() override;
105  int GetEventPending() override;
106  void SetNextWindowId(void*) override;
107  void SetNextWindowInfo(const char*) override;
108  void CreateAWindow() override;
109  void DestroyWindow() override;
110  // }@
111 
113 
117  void SetIsDirect(int newValue);
118  void SetSupportsOpenGL(int newValue);
119  void SetIsCurrent(bool newValue);
121 
129  void Render() override;
130 
134  float GetMaximumHardwareLineWidth() override;
135 
137 
141  vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
142  vtkGetMacro(ForceMaximumHardwareLineWidth, float);
144 
146 
151  vtkSetMacro(ReadyForRendering, bool);
152  vtkGetMacro(ReadyForRendering, bool);
153 
157  vtkSetVector2Macro(ScreenSize,int);
158 
163  void SetIsPicking(vtkTypeBool isPicking) override;
164 
165 protected:
166  int DirectStatus;
167  int SupportsOpenGLStatus;
168  bool CurrentStatus;
169  float ForceMaximumHardwareLineWidth;
170  bool ReadyForRendering;
171  int ScreenSize[2];
172 
173 private:
175  void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
176 };
177 
178 #endif
OpenGL rendering window.
virtual void Finalize()=0
Finalize the rendering process.
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on,...
virtual int * GetScreenSize()=0
Get the current size of the screen in pixels.
void PushState()
no-op (for API compat with OpenGL1).
void * GetGenericContext() override=0
Dummy stubs for vtkWindow API.
void SetWindowInfo(const char *) override=0
Dummy stubs for vtkWindow API.
void * GetGenericParentId() override=0
Dummy stubs for vtkWindow API.
int vtkTypeBool
Definition: vtkABI.h:69
void * GetGenericDisplayId() override=0
Dummy stubs for vtkWindow API.
virtual int IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
virtual bool IsCurrent()=0
Tells if this window is the current graphics context for the calling thread.
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
void SetWindowId(void *) override=0
Dummy stubs for vtkWindow API.
platform independent render window
void SetDisplayId(void *) override=0
Dummy stubs for vtkWindow API.
a simple class to control print indentation
Definition: vtkIndent.h:33
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
void SetParentInfo(const char *) override=0
Dummy stubs for vtkWindow API.
#define VTK_SIZEHINT(...)
virtual void Frame()=0
A termination method performed at the end of the rendering process to do things like swapping buffers...
void SetParentId(void *) override=0
Dummy stubs for vtkWindow API.
void * GetGenericDrawable() override=0
Dummy stubs for vtkWindow API.
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 * GetGenericWindowId() override=0
Dummy stubs for vtkWindow API.
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.