VTK  9.1.0
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 class VTKRENDERINGOPENGL2_EXPORT vtkIOSRenderWindow : public vtkOpenGLRenderWindow
49 {
50 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  void Frame() override;
59 
63  virtual void WindowConfigure();
64 
73  void Initialize() override;
74 
81  void SetFullScreen(vtkTypeBool) override;
82 
86  void WindowRemap() override;
87 
92  virtual void PrefFullScreen();
93 
95 
103  void SetSize(int width, int height) override;
104  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
106 
111  int* GetSize() VTK_SIZEHINT(2) override;
112 
114 
119  void SetPosition(int x, int y) override;
120  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
122 
127  int* GetScreenSize() VTK_SIZEHINT(2) override;
128 
133  int* GetPosition() VTK_SIZEHINT(2) override;
134 
139  void SetWindowName(const char*) override;
140 
141  void SetNextWindowInfo(const char*) override
142  {
143  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
144  }
145  void* GetGenericDrawable() override
146  {
147  vtkWarningMacro("Method not implemented.");
148  return 0;
149  }
150  void SetDisplayId(void*) override { vtkWarningMacro("Method not implemented."); }
151  void* GetGenericDisplayId() override
152  {
153  vtkWarningMacro("Method not implemented.");
154  return 0;
155  }
156 
162  void SetWindowInfo(const char*) override;
163 
169  void SetParentInfo(const char*) override;
170 
171  void SetNextWindowId(void*) override
172  {
173  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
174  }
175 
181 
188  void SetStereoCapableWindow(vtkTypeBool capable) override;
189 
193  void MakeCurrent() override;
194 
198  bool IsCurrent() override;
199 
207  "Deprecated in 9.1 because no one knows what it's for and nothing uses it")
208  bool IsDrawable() override;
209 
213  void UpdateContext();
214 
218  const char* ReportCapabilities() override;
219 
223  int SupportsOpenGL() override;
224 
228  vtkTypeBool IsDirect() override;
229 
235  void SetForceMakeCurrent() override;
236 
241  vtkTypeBool GetEventPending() override;
242 
244 
247  virtual void SetupPalette(void* hDC);
248  virtual void SetupPixelFormat(void* hDC, void* dwFlags, int debug, int bpp = 16, int zbpp = 16);
250 
254  void Finalize() override;
255 
259  int GetDepthBufferSize() override;
260 
262 
268  void HideCursor() override;
269  void ShowCursor() override;
270  void SetCursorPosition(int x, int y) override;
272 
276  void SetCurrentCursor(int) override;
277 
282  virtual int GetWindowCreated();
283 
285 
288  void SetContextId(void*);
289  void* GetContextId();
290  void* GetGenericContext() override { return this->GetContextId(); }
292 
303  virtual void SetRootWindow(void*);
304 
308  virtual void* GetRootWindow();
309 
320  void SetWindowId(void*) override;
321 
325  virtual void* GetWindowId();
326  void* GetGenericWindowId() override { return this->GetWindowId(); }
327 
334  void SetParentId(void* UIView) override;
335 
341  virtual void* GetParentId();
342  void* GetGenericParentId() override { return this->GetParentId(); }
343 
345 
348  void SetPixelFormat(void* pixelFormat);
349  void* GetPixelFormat();
351 
352 protected:
355 
357 
358  // blits the display buffers to the appropriate hardware buffers
360 
361  void CreateAWindow() override;
362  void DestroyWindow() override;
364 
367 
368  // IOS seems to have issues with getting RGB data
370  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right = 0) override;
371 
372 private:
373  vtkIOSRenderWindow(const vtkIOSRenderWindow&) = delete;
374  void operator=(const vtkIOSRenderWindow&) = delete;
375 
376 private:
377  vtkTypeBool WindowCreated;
378  vtkTypeBool ViewCreated;
379  vtkTypeBool CursorHidden;
380 
381  vtkTypeBool ForceMakeCurrent;
382 };
383 
384 #endif
vtkIOSRenderWindow::SetFullScreen
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
vtkIOSRenderWindow::CreateGLContext
void CreateGLContext()
vtkIOSRenderWindow::PrefFullScreen
virtual void PrefFullScreen()
Set the preferred window size to full screen.
vtkIOSRenderWindow::BlitDisplayFramebuffersToHardware
void BlitDisplayFramebuffersToHardware() override
vtkIOSRenderWindow::SetRootWindow
virtual void SetRootWindow(void *)
Sets the NSWindow* associated with this vtkRenderWindow.
vtkIOSRenderWindow::SetParentInfo
void SetParentInfo(const char *) override
See the documentation for SetParentId().
vtkIOSRenderWindow::SetSize
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkIOSRenderWindow::GetSize
int * GetSize() override
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkIOSRenderWindow::GetGenericDisplayId
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:151
vtkIOSRenderWindow::Frame
void Frame() override
Finish the rendering process.
VTK_DEPRECATED_IN_9_1_0
#define VTK_DEPRECATED_IN_9_1_0(reason)
Definition: vtkDeprecation.h:117
vtkIOSRenderWindow::New
static vtkIOSRenderWindow * New()
vtkIOSRenderWindow::DestroyOffScreenWindow
void DestroyOffScreenWindow()
vtkIOSRenderWindow::GetPixelFormat
void * GetPixelFormat()
Accessors for the pixel format object (Really an NSOpenGLPixelFormat*).
vtkIOSRenderWindow::vtkIOSRenderWindow
vtkIOSRenderWindow()
vtkIOSRenderWindow::SetParentId
void SetParentId(void *UIView) override
Set the UIView* for the vtkRenderWindow to be parented within.
vtkIOSRenderWindow::Initialize
void Initialize() override
Initialize the window for rendering.
vtkIOSRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override
Set this RenderWindow's window id to a pre-existing window.
vtkIOSRenderWindow::WindowConfigure
virtual void WindowConfigure()
Specify various window parameters.
vtkIOSRenderWindow::OnScreenInitialized
vtkTypeBool OnScreenInitialized
Definition: vtkIOSRenderWindow.h:366
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
vtkIOSRenderWindow::GetWindowId
virtual void * GetWindowId()
Returns the UIView* associated with this vtkRenderWindow.
vtkX3D::height
@ height
Definition: vtkX3D.h:260
vtkIOSRenderWindow::SetDisplayId
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:150
vtkIOSRenderWindow::IsCurrent
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
vtkIOSRenderWindow::GetScreenSize
int * GetScreenSize() override
Get the current size of the screen in pixels.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkIOSRenderWindow::DestroyWindow
void DestroyWindow() override
Destroy a not-off-screen window.
vtkIOSRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:326
vtkIOSRenderWindow::SetWindowId
void SetWindowId(void *) override
Sets the UIView* associated with this vtkRenderWindow.
vtkIOSRenderWindow::SetSize
void SetSize(int a[2]) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
Definition: vtkIOSRenderWindow.h:104
vtkIOSRenderWindow::WindowRemap
void WindowRemap() override
Remap the window.
vtkIOSRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:145
vtkIOSRenderWindow::SetPixelFormat
void SetPixelFormat(void *pixelFormat)
Accessors for the pixel format object (Really an NSOpenGLPixelFormat*).
vtkIOSRenderWindow::SetPosition
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
Definition: vtkIOSRenderWindow.h:120
vtkIOSRenderWindow::GetRootWindow
virtual void * GetRootWindow()
Returns the NSWindow* associated with this vtkRenderWindow.
vtkIOSRenderWindow::CreateAWindow
void CreateAWindow() override
Create a not-off-screen window.
vtkIOSRenderWindow::~vtkIOSRenderWindow
~vtkIOSRenderWindow() override
vtkIOSRenderWindow::OffScreenInitialized
vtkTypeBool OffScreenInitialized
Definition: vtkIOSRenderWindow.h:365
vtkIOSRenderWindow::InitializeFromCurrentContext
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
vtkIOSRenderWindow::ReadPixels
int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0) override
vtkIOSRenderWindow::MakeCurrent
void MakeCurrent() override
Make this windows OpenGL context the current context.
vtkIOSRenderWindow::SetNextWindowId
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:171
vtkRecti
Definition: vtkRect.h:322
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:83
vtkIOSRenderWindow::GetParentId
virtual void * GetParentId()
Get the parent UIView* for this vtkRenderWindow.
vtkIOSRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIOSRenderWindow::GetGenericParentId
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:342
vtkIOSRenderWindow
IOS OpenGL rendering window.
Definition: vtkIOSRenderWindow.h:49
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkOpenGLRenderWindow.h
vtkIOSRenderWindow::SetStereoCapableWindow
void SetStereoCapableWindow(vtkTypeBool capable) override
Prescribe that the window be created in a stereo-capable mode.