VTK  9.7.20260923
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
11
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 CAMetalLayer;
25@class vtkCocoaWindowDelegate;
26#else
27class NSWindow;
28class NSView;
29class CAMetalLayer;
30class vtkCocoaWindowDelegate;
31#endif
32
33VTK_ABI_NAMESPACE_BEGIN
34
35class VTKRENDERINGUI_EXPORT VTK_MARSHALAUTO vtkCocoaHardwareWindow : public vtkHardwareWindow
36{
37public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
48 NSWindow* GetWindowId();
49
53 NSView* GetViewId();
54
58 CAMetalLayer* GetMetalLayer();
59
60 // vtkHardwareWindow overrides
61 void Create() override;
62 void Destroy() override;
63
64 void* GetGenericWindowId() override;
65 void* GetGenericParentId() override;
66
68
71 void SetSize(int, int) override;
74
76
79 void SetPosition(int, int) override;
82
86 void SetWindowName(const char*) override;
87
89
92 void HideCursor() override;
93 void ShowCursor() override;
95
99 void SetCurrentCursor(int) override;
100
101protected:
104
105 NSWindow* WindowId = nullptr;
106 NSView* ViewId = nullptr;
107 vtkCocoaWindowDelegate* Delegate = nullptr;
108
109 bool OwnsWindow = false;
110 bool CursorHidden = false;
111
112private:
114 void operator=(const vtkCocoaHardwareWindow&) = delete;
115};
116
117VTK_ABI_NAMESPACE_END
118#endif // vtkCocoaHardwareWindow_h
CAMetalLayer * GetMetalLayer()
Get the metal layer object.
void Destroy() override
void SetCurrentCursor(int) override
Change the shape of the cursor.
static vtkCocoaHardwareWindow * New()
Instantiate the class.
~vtkCocoaHardwareWindow() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ShowCursor() override
Hide or show the mouse cursor.
void * GetGenericWindowId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetPosition(int, int) override
Set the position of the window in screen coordinates.
NSWindow * GetWindowId()
Get the native Cocoa window object.
vtkCocoaWindowDelegate * Delegate
void * GetGenericParentId() override
These are window system independent methods that are used to help interface vtkWindow to native windo...
void SetWindowName(const char *) override
Set the name (title) of the window.
void SetSize(int, int) override
Set the size of the window in screen coordinates.
void Create() override
void HideCursor() override
Hide or show the mouse cursor.
NSView * GetViewId()
Get the native Cocoa view object.
a simple class to control print indentation
Definition vtkIndent.h:108
virtual void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
#define VTK_MARSHALAUTO