VTK  9.4.20250114
vtkAndroidRenderWindowInteractor.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
24#ifndef vtkAndroidRenderWindowInteractor_h
25#define vtkAndroidRenderWindowInteractor_h
26
28#include "vtkRenderingUIModule.h" // For export macro
29
30VTK_ABI_NAMESPACE_BEGIN
31struct AInputEvent;
32
34{
35public:
40
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
47 void Initialize() override;
48
50
59 void Enable() override;
60 void Disable() override;
62
68 void TerminateApp() override;
69
71
77 static void SetClassExitMethod(void (*f)(void*), void* arg);
78 static void SetClassExitMethodArgDelete(void (*f)(void*));
80
85 void ExitCallback() override;
86
87 virtual void SetAndroidApplication(struct android_app* app) { this->AndroidApplication = app; }
88
92 void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
93
98 int actionType, int actionId, int numPtrs, int* xPtr, int* yPtr, int* idPtr, int metaState);
99
103 const char* GetKeySym(int keyCode);
104
105 void HandleCommand(int32_t cmd);
106 int32_t HandleInput(AInputEvent* event);
107
109
112 vtkSetMacro(OwnWindow, bool);
113 vtkGetMacro(OwnWindow, bool);
115
116protected:
119
122
123 struct android_app* AndroidApplication = nullptr;
125
127
132 static void (*ClassExitMethod)(void*);
133 static void (*ClassExitMethodArgDelete)(void*);
134 static void* ClassExitMethodArg;
136
138
142 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
143 int InternalDestroyTimer(int platformTimerId) override;
145
151 void StartEventLoop() override;
152
153 vtkTypeBool OwnWindow = true;
154
155private:
157 void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
158};
159
160VTK_ABI_NAMESPACE_END
161#endif
implements Win32 specific functions required by vtkRenderWindowInteractor.
static void * ClassExitMethodArg
Class variables so an exit method can be defined for this class (used to set different exit methods f...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ExitCallback() override
These methods correspond to the Exit, User and Pick callbacks.
void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt)
Handle key up/down events.
int InternalDestroyTimer(int platformTimerId) override
Win32-specific internal timer methods.
void HandleMotionEvent(int actionType, int actionId, int numPtrs, int *xPtr, int *yPtr, int *idPtr, int metaState)
Handle motion events.
const char * GetKeySym(int keyCode)
used for converting keyCodes on Android
void Enable() override
Enable/Disable interactions.
void TerminateApp() override
Android specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to termin...
static vtkAndroidRenderWindowInteractor * New()
Construct object so that light follows camera motion.
void Initialize() override
Initialize the event handler.
void StartEventLoop() override
This will start up the event loop and never return.
virtual void SetAndroidApplication(struct android_app *app)
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
static void SetClassExitMethodArgDelete(void(*f)(void *))
Methods to set the default exit method for the class.
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
Win32-specific internal timer methods.
int32_t HandleInput(AInputEvent *event)
void Disable() override
Enable/Disable interactions.
a simple class to control print indentation
Definition vtkIndent.h:108
platform-independent render window interaction including picking and frame rate control.
int vtkTypeBool
Definition vtkABI.h:64