VTK  9.0.1
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 Start() override;
59 
63  void Frame() override;
64 
68  virtual void WindowConfigure();
69 
78  void Initialize() override;
79 
86  void SetFullScreen(vtkTypeBool) override;
87 
91  void WindowRemap() override;
92 
97  virtual void PrefFullScreen();
98 
100 
108  void SetSize(int width, int height) override;
109  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
111 
116  int* GetSize() VTK_SIZEHINT(2) override;
117 
119 
124  void SetPosition(int x, int y) override;
125  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
127 
132  int* GetScreenSize() VTK_SIZEHINT(2) override;
133 
138  int* GetPosition() VTK_SIZEHINT(2) override;
139 
144  void SetWindowName(const char*) override;
145 
146  void SetNextWindowInfo(const char*) override
147  {
148  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
149  }
150  void* GetGenericDrawable() override
151  {
152  vtkWarningMacro("Method not implemented.");
153  return 0;
154  }
155  void SetDisplayId(void*) override { vtkWarningMacro("Method not implemented."); }
156  void* GetGenericDisplayId() override
157  {
158  vtkWarningMacro("Method not implemented.");
159  return 0;
160  }
161 
167  void SetWindowInfo(const char*) override;
168 
174  void SetParentInfo(const char*) override;
175 
176  void SetNextWindowId(void*) override
177  {
178  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
179  }
180 
185  bool InitializeFromCurrentContext() override;
186 
193  void SetStereoCapableWindow(vtkTypeBool capable) override;
194 
198  void MakeCurrent() override;
199 
203  bool IsCurrent() override;
204 
211  VTK_LEGACY(bool IsDrawable() override);
212 
216  void UpdateContext();
217 
221  const char* ReportCapabilities() override;
222 
226  int SupportsOpenGL() override;
227 
231  vtkTypeBool IsDirect() override;
232 
238  void SetForceMakeCurrent() override;
239 
244  vtkTypeBool GetEventPending() override;
245 
247 
250  virtual void SetupPalette(void* hDC);
251  virtual void SetupPixelFormat(void* hDC, void* dwFlags, int debug, int bpp = 16, int zbpp = 16);
253 
257  void Finalize() override;
258 
262  int GetDepthBufferSize() override;
263 
265 
271  void HideCursor() override;
272  void ShowCursor() override;
273  void SetCursorPosition(int x, int y) override;
275 
279  void SetCurrentCursor(int) override;
280 
285  virtual int GetWindowCreated();
286 
288 
291  void SetContextId(void*);
292  void* GetContextId();
293  void* GetGenericContext() override { return this->GetContextId(); }
295 
306  virtual void SetRootWindow(void*);
307 
311  virtual void* GetRootWindow();
312 
323  void SetWindowId(void*) override;
324 
328  virtual void* GetWindowId();
329  void* GetGenericWindowId() override { return this->GetWindowId(); }
330 
337  void SetParentId(void* UIView) override;
338 
344  virtual void* GetParentId();
345  void* GetGenericParentId() override { return this->GetParentId(); }
346 
348 
351  void SetPixelFormat(void* pixelFormat);
352  void* GetPixelFormat();
354 
355 protected:
357  ~vtkIOSRenderWindow() override;
358 
359  void CreateGLContext();
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::SupportsOpenGL
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
vtkRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override
Definition: vtkRenderWindow.h:623
vtkX3D::data
@ 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:156
vtkRenderWindow::SetWindowId
void SetWindowId(void *) override
Definition: vtkRenderWindow.h:615
vtkOpenGLRenderWindow::ReadPixels
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
vtkOpenGLRenderWindow::GetDepthBufferSize
int GetDepthBufferSize() override
Get the size of the depth buffer.
vtkRenderWindow::SetForceMakeCurrent
virtual void SetForceMakeCurrent()
If called, allow MakeCurrent() to skip cache-check when called.
Definition: vtkRenderWindow.h:672
vtkRenderWindow::WindowRemap
virtual void WindowRemap()
Remap the rendering window.
Definition: vtkRenderWindow.h:403
vtkRenderWindow::ShowCursor
virtual void ShowCursor()
Definition: vtkRenderWindow.h:211
vtkRenderWindow::HideCursor
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: vtkRenderWindow.h:210
vtkIOSRenderWindow::OnScreenInitialized
vtkTypeBool OnScreenInitialized
Definition: vtkIOSRenderWindow.h:366
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkRenderWindow::Finalize
virtual void Finalize()
Finalize the rendering process.
Definition: vtkRenderWindow.h:176
vtkX3D::height
@ 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:155
vtkRenderWindow::MakeCurrent
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:651
vtkRenderWindow::IsDirect
virtual vtkTypeBool IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
Definition: vtkRenderWindow.h:687
vtkRenderWindow::GetEventPending
virtual vtkTypeBool GetEventPending()
Check to see if a mouse button has been pressed.
Definition: vtkRenderWindow.h:556
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIOSRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Definition: vtkIOSRenderWindow.h:329
vtkRenderWindow::SetCurrentCursor
virtual void SetCurrentCursor(int)
Change the shape of the cursor.
vtkIOSRenderWindow::SetSize
void SetSize(int a[2]) override
Definition: vtkIOSRenderWindow.h:109
vtkRenderWindow::SetParentInfo
void SetParentInfo(const char *) override
Definition: vtkRenderWindow.h:625
vtkWindow::GetScreenSize
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:104
vtkRenderWindow::SetStereoCapableWindow
virtual void SetStereoCapableWindow(vtkTypeBool capable)
vtkRenderWindow::SetParentId
void SetParentId(void *) override
Definition: vtkRenderWindow.h:617
vtkIOSRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Definition: vtkIOSRenderWindow.h:150
vtkIOSRenderWindow::SetPosition
void SetPosition(int a[2]) override
Definition: vtkIOSRenderWindow.h:125
vtkOpenGLRenderWindow::ReportCapabilities
const char * ReportCapabilities() override
Get report of capabilities for the render window.
vtkOpenGLRenderWindow::SetSize
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkRenderWindow::SetCursorPosition
virtual void SetCursorPosition(int, int)
Definition: vtkRenderWindow.h:212
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::IsDrawable
virtual bool IsDrawable()
Test if the window has a valid drawable.
vtkRenderWindow::SetFullScreen
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
Definition: vtkRenderWindow.h:227
vtkOpenGLRenderWindow::DestroyWindow
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
vtkIOSRenderWindow::GetGenericContext
void * GetGenericContext() override
Definition: vtkIOSRenderWindow.h:293
vtkIOSRenderWindow::SetNextWindowId
void SetNextWindowId(void *) override
Definition: vtkIOSRenderWindow.h:176
vtkRecti
Definition: vtkRect.h:312
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:51
vtkOpenGLRenderWindow::Start
void Start(void) override
Begin the rendering process.
vtkRenderWindow::IsCurrent
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:657
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:345
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:342
vtkOpenGLRenderWindow::CreateAWindow
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkOpenGLRenderWindow.h