VTK  9.3.20240424
vtkCocoaRenderWindowInteractor.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 vtkCocoaRenderWindowInteractor_h
22#define vtkCocoaRenderWindowInteractor_h
23
25#include "vtkRenderingUIModule.h" // For export macro
26#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
27#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28#ifdef VTK_USE_TDX
29VTK_ABI_NAMESPACE_BEGIN
30class vtkTDxMacDevice;
31VTK_ABI_NAMESPACE_END
32#endif
33
34VTK_ABI_NAMESPACE_BEGIN
37{
38public:
43
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
50 void Initialize() override;
51
53
62 void Enable() override;
63 void Disable() override;
65
71 void TerminateApp() override;
72
77 void ProcessEvents() override;
78
80
86 static void SetClassExitMethod(void (*f)(void*), void* arg);
87 static void SetClassExitMethodArgDelete(void (*f)(void*));
89
94 void ExitCallback() override;
95
96 // int GetButtonDown();
97 // void SetButtonDown(int button);
98
99protected:
102
107 void SetTimerDictionary(void* dictionary); // Really an NSMutableDictionary*
109
111
116 static void (*ClassExitMethod)(void*);
117 static void (*ClassExitMethodArgDelete)(void*);
118 static void* ClassExitMethodArg;
120
122
126 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
127 int InternalDestroyTimer(int platformTimerId) override;
129
135 void StartEventLoop() override;
136
138
142 void SetCocoaManager(void* manager);
145
146#ifdef VTK_USE_TDX
147 vtkTDxMacDevice* Device;
148#endif
149
150private:
152 void operator=(const vtkCocoaRenderWindowInteractor&) = delete;
153
154 // Important: this class cannot contain Objective-C instance
155 // variables for 2 reasons:
156 // 1) C++ files include this header
157 // 2) because of garbage collection
158 // Instead, use the CocoaManager dictionary to keep a collection
159 // of what would otherwise be Objective-C instance variables.
160 void* CocoaManager; // Really an NSMutableDictionary*
161};
162
163VTK_ABI_NAMESPACE_END
164#endif
implements Cocoa specific functions required by vtkRenderWindowInteractor.
void StartEventLoop() override
This will start up the event loop and never return.
~vtkCocoaRenderWindowInteractor() override
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void * GetCocoaManager()
Accessors for the cocoa manager (Really an NSMutableDictionary*).
int InternalDestroyTimer(int platformTimerId) override
Cocoa-specific internal timer methods.
void ProcessEvents() override
Process all user-interaction, timer events and return.
void SetCocoaManager(void *manager)
Accessors for the cocoa manager (Really an NSMutableDictionary*).
static vtkCocoaRenderWindowInteractor * New()
Construct object so that light follows camera motion.
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
Cocoa-specific internal timer methods.
void Enable() override
Enable/Disable interactions.
void Initialize() override
Initialize the even handler.
void TerminateApp() override
Cocoa specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to terminat...
void Disable() override
Enable/Disable interactions.
void ExitCallback() override
These methods correspond to the Exit, User and Pick callbacks.
void SetTimerDictionary(void *dictionary)
Accessors for the Cocoa member variables.
static void SetClassExitMethodArgDelete(void(*f)(void *))
Methods to set the default exit method for the class.
static void * ClassExitMethodArg
Class variables so an exit method can be defined for this class (used to set different exit methods f...
a simple class to control print indentation
Definition vtkIndent.h:108
platform-independent render window interaction including picking and frame rate control.
#define VTK_MARSHALAUTO