VTK  9.7.1
vtkCocoaHardwareWindow.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
12 #ifndef vtkCocoaHardwareWindow_h
13 #define vtkCocoaHardwareWindow_h
14 
15 #include "vtkHardwareWindow.h"
16 #include "vtkRenderingUIModule.h" // For export macro
17 
18 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
19 
20 // Forward declare Objective-C classes
21 #ifdef __OBJC__
22 @class NSWindow;
23 @class NSView;
24 @class vtkCocoaWindowDelegate;
25 #else
26 class NSWindow;
27 class NSView;
28 class vtkCocoaWindowDelegate;
29 #endif
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 
33 class VTKRENDERINGUI_EXPORT VTK_MARSHALAUTO vtkCocoaHardwareWindow : public vtkHardwareWindow
34 {
35 public:
39  static vtkCocoaHardwareWindow* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  NSWindow* GetWindowId();
47 
51  NSView* GetViewId();
52 
56  void* GetMetalLayer();
57 
58  // vtkHardwareWindow overrides
59  void Create() override;
60  void Destroy() override;
61 
62  void* GetGenericWindowId() override;
63  void* GetGenericParentId() override;
64 
66 
69  void SetSize(int, int) override;
72 
74 
77  void SetPosition(int, int) override;
80 
84  void SetWindowName(const char*) override;
85 
87 
90  void HideCursor() override;
91  void ShowCursor() override;
93 
97  void SetCurrentCursor(int) override;
98 
99 protected:
101  ~vtkCocoaHardwareWindow() override;
102 
103  NSWindow* WindowId = nullptr;
104  NSView* ViewId = nullptr;
105  vtkCocoaWindowDelegate* Delegate = nullptr;
106 
107  bool OwnsWindow = false;
108  bool CursorHidden = false;
109 
110 private:
112  void operator=(const vtkCocoaHardwareWindow&) = delete;
113 };
114 
115 VTK_ABI_NAMESPACE_END
116 #endif // vtkCocoaHardwareWindow_h
create a window for renderers to draw into
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: vtkWindow.h:295
static vtkHardwareWindow * New()
virtual void * GetGenericParentId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:57
virtual void Create()
virtual void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
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()
represents a window in a Cocoa GUI
virtual void * GetGenericWindowId()
These are window system independent methods that are used to help interface vtkWindow to native windo...
Definition: vtkWindow.h:56
virtual void SetWindowName(const char *)
Get name of rendering window.
virtual void ShowCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkWindow.h:296
#define VTK_MARSHALAUTO
virtual void SetCurrentCursor(int)
Change the shape of the cursor.