VTK  9.2.6
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
OpenGL rendering window.
#define VTK_DEPRECATED_IN_9_1_0(reason)
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
virtual void WindowRemap()
Remap the rendering window.
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on...
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
virtual void BlitDisplayFramebuffersToHardware()
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
int vtkTypeBool
Definition: vtkABI.h:69
virtual void SetStereoCapableWindow(vtkTypeBool capable)
Prescribe that the window be created in a stereo-capable mode.
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
void SetWindowId(void *) override
Dummy stubs for vtkWindow API.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
void SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:105
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:246
#define VTK_SIZEHINT(...)
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkTypeBool OnScreenInitialized
void SetSize(int a[2]) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
virtual int * GetSize()
Get the size (width and height) of the rendering window in screen coordinates (in pixels)...
vtkTypeBool OffScreenInitialized
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
IOS OpenGL rendering window.
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void Initialize(void)
Initialize the rendering window.
virtual void CreateAWindow()=0
Create a not-off-screen window.
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)