VTK  9.5.2
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
20
21#ifndef vtkAndroidRenderWindowInteractor_h
22#define vtkAndroidRenderWindowInteractor_h
23
25#include "vtkRenderingUIModule.h" // For export macro
26
27VTK_ABI_NAMESPACE_BEGIN
28struct AInputEvent;
29
31{
32public:
37
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 void Initialize() override;
45
47
56 void Enable() override;
57 void Disable() override;
59
65 void TerminateApp() override;
66
68
74 static void SetClassExitMethod(void (*f)(void*), void* arg);
75 static void SetClassExitMethodArgDelete(void (*f)(void*));
77
82 void ExitCallback() override;
83
84 virtual void SetAndroidApplication(struct android_app* app) { this->AndroidApplication = app; }
85
89 void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
90
95 int actionType, int actionId, int numPtrs, int* xPtr, int* yPtr, int* idPtr, int metaState);
96
100 const char* GetKeySym(int keyCode);
101
102 void HandleCommand(int32_t cmd);
103 int32_t HandleInput(AInputEvent* event);
104
106
109 vtkSetMacro(OwnWindow, bool);
110 vtkGetMacro(OwnWindow, bool);
112
113protected:
116
119
120 struct android_app* AndroidApplication = nullptr;
122
124
129 static void (*ClassExitMethod)(void*);
130 static void (*ClassExitMethodArgDelete)(void*);
131 static void* ClassExitMethodArg;
133
135
139 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
140 int InternalDestroyTimer(int platformTimerId) override;
142
148 void StartEventLoop() override;
149
151
152private:
154 void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
155};
156
157VTK_ABI_NAMESPACE_END
158#endif
static void * ClassExitMethodArg
Class variables so an exit method can be defined for this class (used to set different exit methods f...
static void(* ClassExitMethod)(void *)
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.
static void(* ClassExitMethodArgDelete)(void *)
Class variables so an exit method can be defined for this class (used to set different exit methods f...
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:29
int vtkTypeBool
Definition vtkABI.h:64