VTK  9.0.20200807
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:
51  static vtkIOSRenderWindow* New();
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 
180  bool InitializeFromCurrentContext() override;
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:
354  ~vtkIOSRenderWindow() override;
355 
356  void CreateGLContext();
357 
358  // blits the display buffers to the appropriate hardware buffers
359  void BlitDisplayFramebuffersToHardware() override;
360 
361  void CreateAWindow() override;
362  void DestroyWindow() override;
363  void DestroyOffScreenWindow();
364 
367 
368  // IOS seems to have issues with getting RGB data
369  int ReadPixels(
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
vtkOpenGLRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLRenderWindow::BlitDisplayFramebuffersToHardware
virtual void BlitDisplayFramebuffersToHardware()
vtkRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override
Definition: vtkRenderWindow.h:628
vtkX3D::data
Definition: vtkX3D.h:321
vtkWindow::GetSize
virtual int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkIOSRenderWindow::GetGenericDisplayId
void * GetGenericDisplayId() override
Definition: vtkIOSRenderWindow.h:151
vtkRenderWindow::SetWindowId
void SetWindowId(void *) override
Definition: vtkRenderWindow.h:620
vtkOpenGLRenderWindow::ReadPixels
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
vtkRenderWindow::WindowRemap
virtual void WindowRemap()
Remap the rendering window.
Definition: vtkRenderWindow.h:404
vtkWindow::SetSize
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkIOSRenderWindow::OnScreenInitialized
vtkTypeBool OnScreenInitialized
Definition: vtkIOSRenderWindow.h:366
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkX3D::height
Definition: vtkX3D.h:260
vtkOpenGLRenderWindow::InitializeFromCurrentContext
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
vtkIOSRenderWindow::SetDisplayId
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
Definition: vtkIOSRenderWindow.h:150
vtkRenderWindow::MakeCurrent
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:656
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIOSRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Definition: vtkIOSRenderWindow.h:326
vtkIOSRenderWindow::SetSize
void SetSize(int a[2]) override
Definition: vtkIOSRenderWindow.h:104
vtkRenderWindow::SetParentInfo
void SetParentInfo(const char *) override
Definition: vtkRenderWindow.h:630
vtkWindow::GetScreenSize
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:105
vtkRenderWindow::SetStereoCapableWindow
virtual void SetStereoCapableWindow(vtkTypeBool capable)
vtkRenderWindow::SetParentId
void SetParentId(void *) override
Definition: vtkRenderWindow.h:622
vtkIOSRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Definition: vtkIOSRenderWindow.h:145
vtkIOSRenderWindow::SetPosition
void SetPosition(int a[2]) override
Definition: vtkIOSRenderWindow.h:120
vtkOpenGLRenderWindow::Frame
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkIOSRenderWindow::OffScreenInitialized
vtkTypeBool OffScreenInitialized
Definition: vtkIOSRenderWindow.h:365
vtkRenderWindow::SetFullScreen
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
Definition: vtkRenderWindow.h:228
vtkOpenGLRenderWindow::DestroyWindow
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
vtkIOSRenderWindow::SetNextWindowId
void SetNextWindowId(void *) override
Definition: vtkIOSRenderWindow.h:171
vtkRecti
Definition: vtkRect.h:312
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkRenderWindow::IsCurrent
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:662
vtkRenderWindow::VTK_DEPRECATED_IN_9_1_0
VTK_DEPRECATED_IN_9_1_0("Deprecated in 9.1 because no one knows what it's for and nothing uses it") virtual bool IsDrawable()
Test if the window has a valid drawable.
vtkRenderWindow::New
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on,...
vtkIOSRenderWindow::GetGenericParentId
void * GetGenericParentId() override
Definition: vtkIOSRenderWindow.h:342
vtkIOSRenderWindow
IOS OpenGL rendering window.
Definition: vtkIOSRenderWindow.h:48
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkOpenGLRenderWindow::Initialize
virtual void Initialize(void)
Initialize the rendering window.
Definition: vtkOpenGLRenderWindow.h:302
vtkOpenGLRenderWindow::CreateAWindow
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkOpenGLRenderWindow.h