VTK  9.3.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
37 class VTKRENDERINGOPENGL2_EXPORT vtkIOSRenderWindow : public vtkOpenGLRenderWindow
38 {
39 public:
40  static vtkIOSRenderWindow* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void Frame() override;
48 
52  virtual void WindowConfigure();
53 
62  void Initialize() override;
63 
70  void SetFullScreen(vtkTypeBool) override;
71 
75  void WindowRemap() override;
76 
81  virtual void PrefFullScreen();
82 
84 
92  void SetSize(int width, int height) override;
93  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
95 
100  int* GetSize() VTK_SIZEHINT(2) override;
101 
103 
108  void SetPosition(int x, int y) override;
109  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
111 
116  int* GetScreenSize() VTK_SIZEHINT(2) override;
117 
122  int* GetPosition() VTK_SIZEHINT(2) override;
123 
128  void SetWindowName(const char*) override;
129 
130  void SetNextWindowInfo(const char*) override
131  {
132  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
133  }
134  void* GetGenericDrawable() override
135  {
136  vtkWarningMacro("Method not implemented.");
137  return 0;
138  }
139  void SetDisplayId(void*) override { vtkWarningMacro("Method not implemented."); }
140  void* GetGenericDisplayId() override
141  {
142  vtkWarningMacro("Method not implemented.");
143  return 0;
144  }
145 
151  void SetWindowInfo(const char*) override;
152 
158  void SetParentInfo(const char*) override;
159 
160  void SetNextWindowId(void*) override
161  {
162  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
163  }
164 
169  bool InitializeFromCurrentContext() override;
170 
177  void SetStereoCapableWindow(vtkTypeBool capable) override;
178 
182  void MakeCurrent() override;
183 
187  bool IsCurrent() override;
188 
192  void UpdateContext();
193 
197  const char* ReportCapabilities() override;
198 
202  int SupportsOpenGL() override;
203 
207  vtkTypeBool IsDirect() override;
208 
214  void SetForceMakeCurrent() override;
215 
220  vtkTypeBool GetEventPending() override;
221 
223 
226  virtual void SetupPalette(void* hDC);
227  virtual void SetupPixelFormat(void* hDC, void* dwFlags, int debug, int bpp = 16, int zbpp = 16);
229 
233  void Finalize() override;
234 
238  int GetDepthBufferSize() override;
239 
241 
247  void HideCursor() override;
248  void ShowCursor() override;
249  void SetCursorPosition(int x, int y) override;
251 
255  void SetCurrentCursor(int) override;
256 
261  virtual int GetWindowCreated();
262 
264 
267  void SetContextId(void*);
268  void* GetContextId();
269  void* GetGenericContext() override { return this->GetContextId(); }
271 
282  virtual void SetRootWindow(void*);
283 
287  virtual void* GetRootWindow();
288 
299  void SetWindowId(void*) override;
300 
304  virtual void* GetWindowId();
305  void* GetGenericWindowId() override { return this->GetWindowId(); }
306 
313  void SetParentId(void* UIView) override;
314 
320  virtual void* GetParentId();
321  void* GetGenericParentId() override { return this->GetParentId(); }
322 
324 
327  void SetPixelFormat(void* pixelFormat);
328  void* GetPixelFormat();
330 
331 protected:
333  ~vtkIOSRenderWindow() override;
334 
335  void CreateGLContext();
336 
337  // blits the display buffers to the appropriate hardware buffers
338  void BlitDisplayFramebuffersToHardware() override;
339 
340  void CreateAWindow() override;
341  void DestroyWindow() override;
342  void DestroyOffScreenWindow();
343 
346 
347  // IOS seems to have issues with getting RGB data
348  int ReadPixels(
349  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right = 0) override;
350 
351 private:
352  vtkIOSRenderWindow(const vtkIOSRenderWindow&) = delete;
353  void operator=(const vtkIOSRenderWindow&) = delete;
354 
355 private:
356  vtkTypeBool WindowCreated;
357  vtkTypeBool ViewCreated;
358  vtkTypeBool CursorHidden;
359 
360  vtkTypeBool ForceMakeCurrent;
361 };
362 
363 VTK_ABI_NAMESPACE_END
364 #endif
int GetDepthBufferSize() override
Get the size of the depth buffer.
OpenGL rendering window.
virtual void SetForceMakeCurrent()
If called, allow MakeCurrent() to skip cache-check when called.
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
virtual void WindowRemap()
Remap the rendering window.
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...
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on...
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 void SetCurrentCursor(int)
Change the shape of the cursor.
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.
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 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...
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:94
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
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...
virtual void Initialize()
Initialize the rendering window.
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:235
#define VTK_SIZEHINT(...)
const char * ReportCapabilities() override
Get report of capabilities for the render window.
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.
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 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.