VTK
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 "vtkRenderingOpenGL2Module.h" // For export macro
46 #include "vtkOpenGLRenderWindow.h"
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 
103  void SetSize(int a[2]) override;
104  void SetSize(int,int) override;
106 
110  int *GetSize() VTK_SIZEHINT(2) override;
111 
113 
116  void SetPosition(int a[2]) override;
117  void SetPosition(int,int) override;
119 
123  int *GetScreenSize() VTK_SIZEHINT(2) override;
124 
128  int *GetPosition() VTK_SIZEHINT(2) override;
129 
134  void SetWindowName(const char *) override;
135 
136  void SetNextWindowInfo(const char *) override
137  {
138  vtkWarningMacro("SetNextWindowInfo not implemented (WindowRemap not implemented).");
139  }
140  void* GetGenericDrawable() override
141  {
142  vtkWarningMacro("Method not implemented.");
143  return 0;
144  }
145  void SetDisplayId(void*) override
146  {
147  vtkWarningMacro("Method not implemented.");
148  }
149  void *GetGenericDisplayId() override
150  {
151  vtkWarningMacro("Method not implemented.");
152  return 0;
153  }
154 
160  void SetWindowInfo(const char*) override;
161 
167  void SetParentInfo(const char*) override;
168 
169  void SetNextWindowId(void*) override
170  {
171  vtkWarningMacro("SetNextWindowId not implemented (WindowRemap not implemented).");
172  }
173 
178  bool InitializeFromCurrentContext() override;
179 
186  void SetStereoCapableWindow(vtkTypeBool capable) override;
187 
191  void MakeCurrent() override;
192 
196  bool IsCurrent() override;
197 
204  bool IsDrawable() override;
205 
209  void UpdateContext();
210 
214  const char *ReportCapabilities() override;
215 
219  int SupportsOpenGL() override;
220 
224  int IsDirect() override;
225 
231  void SetForceMakeCurrent() override;
232 
237  int GetEventPending() override;
238 
240 
243  virtual void SetupPalette(void *hDC);
244  virtual void SetupPixelFormat(void *hDC, void *dwFlags, int debug,
245  int bpp=16, int zbpp=16);
247 
251  void Finalize() override;
252 
256  int GetDepthBufferSize() override;
257 
259 
265  void HideCursor() override;
266  void ShowCursor() override;
267  void SetCursorPosition(int x, int y) override;
269 
273  void SetCurrentCursor(int) override;
274 
279  virtual int GetWindowCreated();
280 
282 
285  void SetContextId(void *);
286  void *GetContextId();
287  void *GetGenericContext() override {return this->GetContextId();}
289 
300  virtual void SetRootWindow(void *);
301 
305  virtual void *GetRootWindow();
306 
317  void SetWindowId(void *) override;
318 
322  virtual void *GetWindowId();
323  void *GetGenericWindowId() override {return this->GetWindowId();}
324 
331  void SetParentId(void *UIView) override;
332 
338  virtual void *GetParentId();
339  void *GetGenericParentId() override { return this->GetParentId(); }
340 
342 
345  void SetPixelFormat(void *pixelFormat);
346  void *GetPixelFormat();
348 
349 protected:
351  ~vtkIOSRenderWindow() override;
352 
353  void CreateGLContext();
354 
355  void CreateAWindow() override;
356  void DestroyWindow() override;
357  void DestroyOffScreenWindow();
358 
361 
362  // IOS seems to have issues with getting RGB data
363  int ReadPixels(
364  const vtkRecti& rect, int front, int glFormat, int glType, void* data, int right=0) override;
365 
366 private:
367  vtkIOSRenderWindow(const vtkIOSRenderWindow&) = delete;
368  void operator=(const vtkIOSRenderWindow&) = delete;
369 
370 private:
371  int WindowCreated;
372  int ViewCreated;
373  int CursorHidden;
374 
375  int ForceMakeCurrent;
376 };
377 
378 #endif
vtkOpenGLRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLRenderWindow::SetSize
void SetSize(int a[2]) override
Set the size of the window in screen coordinates in pixels.
vtkOpenGLRenderWindow::SupportsOpenGL
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
vtkRenderWindow::Start
virtual void Start()=0
Initialize the rendering process.
vtkRenderWindow::ShowCursor
virtual void ShowCursor()=0
vtkX3D::data
Definition: vtkX3D.h:315
vtkWindow::GetSize
virtual int * GetSize()
Set/Get the size of the window in screen coordinates in pixels.
vtkIOSRenderWindow::OffScreenInitialized
int OffScreenInitialized
Definition: vtkIOSRenderWindow.h:359
vtkIOSRenderWindow::GetGenericDisplayId
void * GetGenericDisplayId() override
Definition: vtkIOSRenderWindow.h:149
vtkOpenGLRenderWindow::ReadPixels
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
vtkRenderWindow::HideCursor
virtual void HideCursor()=0
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
vtkRenderWindow::Finalize
virtual void Finalize()=0
Finalize the rendering process.
vtkRenderWindow::SetFullScreen
virtual void SetFullScreen(vtkTypeBool)=0
Turn on/off rendering full screen window size.
vtkRenderWindow::IsCurrent
virtual bool IsCurrent()=0
Tells if this window is the current graphics context for the calling thread.
vtkOpenGLRenderWindow::GetDepthBufferSize
int GetDepthBufferSize() override
Get the size of the depth buffer.
vtkRenderWindow::SetWindowId
void SetWindowId(void *) override=0
vtkRenderWindow::SetForceMakeCurrent
virtual void SetForceMakeCurrent()
If called, allow MakeCurrent() to skip cache-check when called.
Definition: vtkRenderWindow.h:613
vtkRenderWindow::WindowRemap
virtual void WindowRemap()=0
Remap the rendering window.
vtkRenderWindow::SetParentId
void SetParentId(void *) override=0
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:42
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:145
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override=0
vtkIOSRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Definition: vtkIOSRenderWindow.h:323
vtkRenderWindow::SetCurrentCursor
virtual void SetCurrentCursor(int)
Change the shape of the cursor.
vtkRenderWindow::MakeCurrent
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
vtkRenderWindow::SetStereoCapableWindow
virtual void SetStereoCapableWindow(vtkTypeBool capable)
vtkIOSRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Definition: vtkIOSRenderWindow.h:140
vtkOpenGLRenderWindow::ReportCapabilities
const char * ReportCapabilities() override
Get report of capabilities for the render window.
vtkRenderWindow::SetCursorPosition
virtual void SetCursorPosition(int, int)
Definition: vtkRenderWindow.h:201
vtkRenderWindow::IsDrawable
virtual bool IsDrawable()
Test if the window has a valid drawable.
Definition: vtkRenderWindow.h:606
vtkOpenGLRenderWindow::DestroyWindow
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
vtkIOSRenderWindow::GetGenericContext
void * GetGenericContext() override
Definition: vtkIOSRenderWindow.h:287
vtkRenderWindow::IsDirect
virtual int IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.
Definition: vtkRenderWindow.h:628
vtkIOSRenderWindow::SetNextWindowId
void SetNextWindowId(void *) override
Definition: vtkIOSRenderWindow.h:169
vtkRecti
Definition: vtkRect.h:323
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkIOSRenderWindow::OnScreenInitialized
int OnScreenInitialized
Definition: vtkIOSRenderWindow.h:360
vtkRenderWindow::Frame
virtual void Frame()=0
A termination method performed at the end of the rendering process to do things like swapping buffers...
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:339
vtkIOSRenderWindow
IOS OpenGL rendering window.
Definition: vtkIOSRenderWindow.h:48
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkRenderWindow::GetEventPending
virtual int GetEventPending()=0
Check to see if a mouse button has been pressed.
vtkOpenGLRenderWindow::Initialize
virtual void Initialize(void)
Initialize the rendering window.
Definition: vtkOpenGLRenderWindow.h:366
vtkOpenGLRenderWindow::CreateAWindow
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkOpenGLRenderWindow.h
vtkRenderWindow::SetParentInfo
void SetParentInfo(const char *) override=0