VTK  9.7.1
vtkWebAssemblyHardwareWindow.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkWebAssemblyHardwareWindow_h
22 #define vtkWebAssemblyHardwareWindow_h
23 
24 #if !defined(__EMSCRIPTEN__)
25 #error "vtkWebAssemblyHardwareWindow cannot be built without emscripten!"
26 #endif
27 
28 #include "vtkHardwareWindow.h"
29 
30 #include "vtkRenderingUIModule.h" // For export macro
31 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
32 
33 VTK_ABI_NAMESPACE_BEGIN
35 
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
43  static vtkOverrideAttribute* CreateOverrideAttributes();
44 
48  void SetFullScreen(vtkTypeBool) override;
49 
51 
54  void SetSize(int, int) override;
55  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
57 
58  // /**
59  // * Get the current size of the screen in pixels.
60  // */
61  // int* GetScreenSize() VTK_SIZEHINT(2) override;
62 
66  int* GetPosition() VTK_SIZEHINT(2) override;
67 
69 
73  void* GetGenericWindowId() override;
74  void* GetGenericDrawable() override;
76 
78 
82  void HideCursor() override;
83  void ShowCursor() override;
85 
89  vtkGetStringMacro(CanvasSelector);
90  vtkSetStringMacro(CanvasSelector);
91 
96  void SetShowWindow(bool) override {}
97 
98  void Create() override;
99  void Destroy() override;
100 
101 protected:
103  ~vtkWebAssemblyHardwareWindow() override;
104 
105  void* WindowId = nullptr;
106  char* CanvasSelector = nullptr;
107 
108 private:
110  void operator=(const vtkWebAssemblyHardwareWindow&) = delete;
111 };
112 
113 #define vtkWebAssemblyHardwareWindow_OVERRIDE_ATTRIBUTES \
114  vtkWebAssemblyHardwareWindow::CreateOverrideAttributes()
115 VTK_ABI_NAMESPACE_END
116 #endif
create a window for renderers to draw into
Attribute for vtkObjectFactory overrides.
WebAssembly hardware window that interfaces with HTML5 canvas.
static vtkHardwareWindow * New()
virtual void Create()
int vtkTypeBool
Definition: vtkABI.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void Destroy()
virtual int * GetPosition()
Get the position (x and y) of the rendering window in screen coordinates (in pixels).
#define VTK_SIZEHINT(...)
#define VTK_NEWINSTANCE
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
#define VTK_MARSHALAUTO
void SetSize(int a[2]) override
Set the size of the window in pixels.