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 =========================================================================*/
33 #ifndef vtkGenericOpenGLRenderWindow_h
34 #define vtkGenericOpenGLRenderWindow_h
35 
36 #include "vtkRenderingOpenGL2Module.h" // For export macro
37 #include "vtkOpenGLRenderWindow.h"
38 
39 class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow :
41 {
42 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 protected:
48  ~vtkGenericOpenGLRenderWindow() override;
49 
50 public:
51 
53  void Finalize() override;
54 
57  void Frame() override;
58 
61  void MakeCurrent() override;
62 
66  bool IsCurrent() override;
67 
71  int SupportsOpenGL() override;
72 
76  int IsDirect() override;
77 
78  // {@
80  void SetFrontBuffer(unsigned int);
81  void SetFrontLeftBuffer(unsigned int);
82  void SetFrontRightBuffer(unsigned int);
83  void SetBackBuffer(unsigned int);
84  void SetBackLeftBuffer(unsigned int);
85  void SetBackRightBuffer(unsigned int);
86  // }@
87 
89  void PushState() {}
91  void PopState() {}
92 
93  // {@
95  void SetWindowId(void*) override;
96  void* GetGenericWindowId() override;
97  void SetDisplayId(void*) override;
98  void SetParentId(void*) override;
99  void* GetGenericDisplayId() override;
100  void* GetGenericParentId() override;
101  void* GetGenericContext() override;
102  void* GetGenericDrawable() override;
103  void SetWindowInfo(char*) override;
104  void SetParentInfo(char*) override;
105  int* GetScreenSize() override;
106  void Start() override;
107  void HideCursor() override;
108  void ShowCursor() override;
109  void SetFullScreen(int) override;
110  void WindowRemap() override;
111  int GetEventPending() override;
112  void SetNextWindowId(void*) override;
113  void SetNextWindowInfo(char*) override;
114  void CreateAWindow() override;
115  void DestroyWindow() override;
116  // }@
117 
119 
123  void SetIsDirect(int newValue);
124  void SetSupportsOpenGL(int newValue);
125  void SetIsCurrent(bool newValue);
127 
135  void Render() override;
136 
140  float GetMaximumHardwareLineWidth() override;
141 
143 
147  vtkSetClampMacro(ForceMaximumHardwareLineWidth, float, 0, VTK_FLOAT_MAX);
148  vtkGetMacro(ForceMaximumHardwareLineWidth, float);
150 
152 
157  vtkSetMacro(ReadyForRendering, bool);
158  vtkGetMacro(ReadyForRendering, bool);
159 
163  vtkSetVector2Macro(ScreenSize,int);
164 
169  void SetIsPicking(int isPicking) override;
170 
171 protected:
172  int DirectStatus;
173  int SupportsOpenGLStatus;
174  bool CurrentStatus;
177  int ScreenSize[2];
178 
179 private:
181  void operator=(const vtkGenericOpenGLRenderWindow&) = delete;
182 };
183 
184 #endif
OpenGL rendering window.
virtual void Finalize()=0
Finalize the rendering process.
virtual void SetIsPicking(int)
virtual void WindowRemap()=0
Remap the rendering window.
virtual void HideCursor()=0
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
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 Render() override
Ask each renderer owned by this RenderWindow to render its image and synchronize this process.
virtual void SetNextWindowInfo(char *)=0
Dummy stubs for vtkWindow API.
virtual void SetFullScreen(int)=0
Turn on/off rendering full screen window size.
void * GetGenericParentId() override=0
Dummy stubs for vtkWindow API.
virtual int GetEventPending()=0
Check to see if a mouse button has been pressed.
void * GetGenericDisplayId() override=0
Dummy stubs for vtkWindow API.
virtual int IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
float ForceMaximumHardwareLineWidth
Set this to true to indicate that the context is now ready.
virtual bool IsCurrent()=0
Tells if this window is the current graphics context for the calling thread.
#define VTK_FLOAT_MAX
Definition: vtkType.h:165
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:39
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
void SetWindowInfo(char *) override=0
Dummy stubs for vtkWindow API.
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
virtual void SetNextWindowId(void *)=0
Dummy stubs for vtkWindow API.
virtual void Frame()=0
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetParentId(void *) override=0
Dummy stubs for vtkWindow API.
void SetParentInfo(char *) 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.
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
virtual void Start()=0
Initialize the rendering process.
void PopState()
no-op (for API compat with OpenGL1).
void * GetGenericWindowId() override=0
Dummy stubs for vtkWindow API.
virtual void CreateAWindow()=0
Create a not-off-screen window.
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
virtual void ShowCursor()=0
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
bool ReadyForRendering
Set this to true to indicate that the context is now ready.