VTK  9.2.20230327
vtkIOSRenderWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkIOSRenderWindow.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 =========================================================================*/
42 #ifndef vtkIOSRenderWindow_h
43 #define vtkIOSRenderWindow_h
44 
45 #include "vtkOpenGLRenderWindow.h"
46 #include "vtkRenderingOpenGL2Module.h" // For export macro
47 
48 VTK_ABI_NAMESPACE_BEGIN
49 class VTKRENDERINGOPENGL2_EXPORT vtkIOSRenderWindow : public vtkOpenGLRenderWindow
50 {
51 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
59  void Frame() override;
60 
64  virtual void WindowConfigure();
65 
74  void Initialize() override;
75 
82  void SetFullScreen(vtkTypeBool) override;
83 
87  void WindowRemap() override;
88 
93  virtual void PrefFullScreen();
94 
96 
104  void SetSize(int width, int height) override;
105  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
107 
112  int* GetSize() VTK_SIZEHINT(2) override;
113 
115 
120  void SetPosition(int x, int y) override;
121  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
123 
128  int* GetScreenSize() VTK_SIZEHINT(2) override;
129 
134  int* GetPosition() VTK_SIZEHINT(2) override;
135 
140  void SetWindowName(const char*) override;
141 
142  void SetNextWindowInfo(const char*) override
143  {
144  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
145  }
146  void* GetGenericDrawable() override
147  {
148  vtkWarningMacro("Method not implemented.");
149  return 0;
150  }
151  void SetDisplayId(void*) override { vtkWarningMacro("Method not implemented."); }
152  void* GetGenericDisplayId() override
153  {
154  vtkWarningMacro("Method not implemented.");
155  return 0;
156  }
157 
163  void SetWindowInfo(const char*) override;
164 
170  void SetParentInfo(const char*) override;
171 
172  void SetNextWindowId(void*) override
173  {
174  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
175  }
176 
182 
189  void SetStereoCapableWindow(vtkTypeBool capable) override;
190 
194  void MakeCurrent() override;
195 
199  bool IsCurrent() override;
200 
205 
209  const char* ReportCapabilities() override;
210 
214  int SupportsOpenGL() override;
215 
219  vtkTypeBool IsDirect() override;
220 
226  void SetForceMakeCurrent() override;
227 
233 
235 
238  virtual void SetupPalette(void* hDC);
239  virtual void SetupPixelFormat(void* hDC, void* dwFlags, int debug, int bpp = 16, int zbpp = 16);
241 
245  void Finalize() override;
246 
250  int GetDepthBufferSize() override;
251 
253 
259  void HideCursor() override;
260  void ShowCursor() override;
261  void SetCursorPosition(int x, int y) override;
263 
267  void SetCurrentCursor(int) override;
268 
273  virtual int GetWindowCreated();
274 
276 
279  void SetContextId(void*);
280  void* GetContextId();
281  void* GetGenericContext() override { return this->GetContextId(); }
283 
294  virtual void SetRootWindow(void*);
295 
299  virtual void* GetRootWindow();
300 
311  void SetWindowId(void*) override;
312 
316  virtual void* GetWindowId();
317  void* GetGenericWindowId() override { return this->GetWindowId(); }
318 
325  void SetParentId(void* UIView) override;
326 
332  virtual void* GetParentId();
333  void* GetGenericParentId() override { return this->GetParentId(); }
334 
336 
339  void SetPixelFormat(void* pixelFormat);
340  void* GetPixelFormat();
342 
343 protected:
346 
348 
349  // blits the display buffers to the appropriate hardware buffers
351 
352  void CreateAWindow() override;
353  void DestroyWindow() override;
355 
358 
359  // IOS seems to have issues with getting RGB data
361  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right = 0) override;
362 
363 private:
364  vtkIOSRenderWindow(const vtkIOSRenderWindow&) = delete;
365  void operator=(const vtkIOSRenderWindow&) = delete;
366 
367 private:
368  vtkTypeBool WindowCreated;
369  vtkTypeBool ViewCreated;
370  vtkTypeBool CursorHidden;
371 
372  vtkTypeBool ForceMakeCurrent;
373 };
374 
375 VTK_ABI_NAMESPACE_END
376 #endif
IOS OpenGL rendering window.
void SetPixelFormat(void *pixelFormat)
Accessors for the pixel format object (Really an NSOpenGLPixelFormat*).
void * GetContextId()
Accessors for the OpenGL context (Really an NSOpenGLContext*).
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
void * GetGenericContext() override
Accessors for the OpenGL context (Really an NSOpenGLContext*).
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
void Frame() override
Finish the rendering process.
void ShowCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
void CreateAWindow() override
Create a not-off-screen window.
~vtkIOSRenderWindow() override
virtual void PrefFullScreen()
Set the preferred window size to full screen.
void SetSize(int a[2]) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
void DestroyWindow() override
Destroy a not-off-screen window.
virtual void SetRootWindow(void *)
Sets the NSWindow* associated with this vtkRenderWindow.
void BlitDisplayFramebuffersToHardware() override
void SetContextId(void *)
Accessors for the OpenGL context (Really an NSOpenGLContext*).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
void SetParentId(void *UIView) override
Set the UIView* for the vtkRenderWindow to be parented within.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
vtkTypeBool IsDirect() override
Is this render window using hardware acceleration? 0-false, 1-true.
vtkTypeBool OnScreenInitialized
void SetForceMakeCurrent() override
If called, allow MakeCurrent() to skip cache-check when called.
void SetCursorPosition(int x, int y) override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
void Initialize() override
Initialize the window for rendering.
void DestroyOffScreenWindow()
void Finalize() override
Clean up device contexts, rendering contexts, etc.
void HideCursor() override
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 SetupPixelFormat(void *hDC, void *dwFlags, int debug, int bpp=16, int zbpp=16)
Initialize OpenGL for this window.
int * GetSize() override
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
virtual void * GetRootWindow()
Returns the NSWindow* associated with this vtkRenderWindow.
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
int * GetScreenSize() override
Get the current size of the screen in pixels.
virtual void * GetWindowId()
Returns the UIView* associated with this vtkRenderWindow.
virtual void * GetParentId()
Get the parent UIView* for this vtkRenderWindow.
vtkTypeBool GetEventPending() override
Check to see if an event is pending for this window.
void SetStereoCapableWindow(vtkTypeBool capable) override
Prescribe that the window be created in a stereo-capable mode.
void WindowRemap() override
Remap the window.
virtual int GetWindowCreated()
Get the WindowCreated flag.
void MakeCurrent() override
Make this windows OpenGL context the current context.
void UpdateContext()
Update this window's OpenGL context, e.g.
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
static vtkIOSRenderWindow * New()
void * GetPixelFormat()
Accessors for the pixel format object (Really an NSOpenGLPixelFormat*).
int GetDepthBufferSize() override
Get the size of the depth buffer.
void SetCurrentCursor(int) override
Change the shape of the cursor.
const char * ReportCapabilities() override
Get report of capabilities for the render window.
vtkTypeBool OffScreenInitialized
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
void SetWindowInfo(const char *) override
Set this RenderWindow's window id to a pre-existing window.
void SetParentInfo(const char *) override
See the documentation for SetParentId().
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
void SetWindowId(void *) override
Sets the UIView* associated with this vtkRenderWindow.
virtual void SetupPalette(void *hDC)
Initialize OpenGL for this window.
int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0) override
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
virtual void WindowConfigure()
Specify various window parameters.
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
a simple class to control print indentation
Definition: vtkIndent.h:120
OpenGL rendering window.
@ height
Definition: vtkX3D.h:266
@ data
Definition: vtkX3D.h:327
int vtkTypeBool
Definition: vtkABI.h:71
#define VTK_SIZEHINT(...)