VTK  9.7.1
vtkIOSRenderWindow.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
30 #ifndef vtkIOSRenderWindow_h
31 #define vtkIOSRenderWindow_h
32 
33 #include "vtkOpenGLRenderWindow.h"
34 #include "vtkRenderingOpenGL2Module.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
38 class VTKRENDERINGOPENGL2_EXPORT vtkIOSRenderWindow : public vtkOpenGLRenderWindow
39 {
40 public:
41  static vtkIOSRenderWindow* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void Frame() override;
51 
55  virtual void WindowConfigure();
56 
65  void Initialize() override;
66 
73  void SetFullScreen(vtkTypeBool) override;
74 
78  void WindowRemap() override;
79 
84  virtual void PrefFullScreen();
85 
87 
95  void SetSize(int width, int height) override;
96  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
98 
103  int* GetSize() VTK_SIZEHINT(2) override;
104 
106 
111  void SetPosition(int x, int y) override;
112  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
114 
119  int* GetScreenSize() VTK_SIZEHINT(2) override;
120 
125  int* GetPosition() VTK_SIZEHINT(2) override;
126 
131  void SetWindowName(const char*) override;
132 
133  void SetNextWindowInfo(const char*) override
134  {
135  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
136  }
137  void* GetGenericDrawable() override
138  {
139  vtkWarningMacro("Method not implemented.");
140  return 0;
141  }
142  void SetDisplayId(void*) override { vtkWarningMacro("Method not implemented."); }
143  void* GetGenericDisplayId() override
144  {
145  vtkWarningMacro("Method not implemented.");
146  return 0;
147  }
148 
154  void SetWindowInfo(const char*) override;
155 
161  void SetParentInfo(const char*) override;
162 
163  void SetNextWindowId(void*) override
164  {
165  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
166  }
167 
172  bool InitializeFromCurrentContext() override;
173 
180  void SetStereoCapableWindow(vtkTypeBool capable) override;
181 
185  void MakeCurrent() override;
186 
190  bool IsCurrent() override;
191 
195  void UpdateContext();
196 
200  const char* ReportCapabilities() override;
201 
205  int SupportsOpenGL() override;
206 
210  vtkTypeBool IsDirect() override;
211 
217  void SetForceMakeCurrent() override;
218 
223  vtkTypeBool GetEventPending() override;
224 
226 
229  virtual void SetupPalette(void* hDC);
230  virtual void SetupPixelFormat(void* hDC, void* dwFlags, int debug, int bpp = 16, int zbpp = 16);
232 
236  void Finalize() override;
237 
241  int GetDepthBufferSize() override;
242 
244 
250  void HideCursor() override;
251  void ShowCursor() override;
252  void SetCursorPosition(int x, int y) override;
254 
258  void SetCurrentCursor(int) override;
259 
264  virtual int GetWindowCreated();
265 
267 
270  void SetContextId(void*);
271  void* GetContextId();
272  void* GetGenericContext() override { return this->GetContextId(); }
274 
285  virtual void SetRootWindow(void*);
286 
290  virtual void* GetRootWindow();
291 
302  void SetWindowId(void*) override;
303 
307  virtual void* GetWindowId();
308  void* GetGenericWindowId() override { return this->GetWindowId(); }
309 
316  void SetParentId(void* UIView) override;
317 
323  virtual void* GetParentId();
324  void* GetGenericParentId() override { return this->GetParentId(); }
325 
327 
330  void SetPixelFormat(void* pixelFormat);
331  void* GetPixelFormat();
333 
334 protected:
336  ~vtkIOSRenderWindow() override;
337 
338  void CreateGLContext();
339 
340  // blits the display buffers to the appropriate hardware buffers
341  void BlitDisplayFramebuffersToHardware() override;
342 
343  void CreateAWindow() override;
344  void DestroyWindow() override;
345  void DestroyOffScreenWindow();
346 
349 
350  // IOS seems to have issues with getting RGB data
351  int ReadPixels(
352  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right = 0) override;
353 
354 private:
355  vtkIOSRenderWindow(const vtkIOSRenderWindow&) = delete;
356  void operator=(const vtkIOSRenderWindow&) = delete;
357 
358  vtkTypeBool WindowCreated;
359  vtkTypeBool ViewCreated;
360  vtkTypeBool CursorHidden;
361 
362  vtkTypeBool ForceMakeCurrent;
363 };
364 
365 #define vtkIOSRenderWindow_OVERRIDE_ATTRIBUTES vtkIOSRenderWindow::CreateOverrideAttributes()
366 VTK_ABI_NAMESPACE_END
367 #endif
int GetDepthBufferSize() override
Get the size of the depth buffer.
OpenGL rendering window.
virtual void SetCursorPosition(int, int)
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkWindow.h:297
virtual void SetForceMakeCurrent()
If called, allow MakeCurrent() to skip cache-check when called.
Attribute for vtkObjectFactory overrides.
virtual void HideCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkWindow.h:295
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
virtual void WindowRemap()
Remap the rendering window.
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
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.
virtual void BlitDisplayFramebuffersToHardware()
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
int vtkTypeBool
Definition: vtkABI.h:64
virtual void SetStereoCapableWindow(vtkTypeBool capable)
Prescribe that the window be created in a stereo-capable mode.
static vtkOpenGLRenderWindow * New()
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
void SetWindowId(void *) override
Dummy stubs for vtkWindow API.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
void * GetGenericContext() override
Accessors for the OpenGL context (Really an NSOpenGLContext*).
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:110
void Initialize() override
Initialize the rendering window.
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
static vtkOverrideAttribute * CreateOverrideAttributes()
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:255
#define VTK_SIZEHINT(...)
const char * ReportCapabilities() override
Get report of capabilities for the render window.
#define VTK_NEWINSTANCE
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkTypeBool OnScreenInitialized
void SetSize(int a[2]) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
virtual int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels)...
vtkTypeBool OffScreenInitialized
virtual vtkTypeBool GetEventPending()
Check to see if a mouse button has been pressed.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
IOS OpenGL rendering window.
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
virtual void ShowCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkWindow.h:296
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void SetCurrentCursor(int)
Change the shape of the cursor.
virtual void CreateAWindow()=0
Create a not-off-screen window.
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
virtual vtkTypeBool IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.