VTK  9.3.0
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
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;
122
123 bool Done; // is the event loop done running
124
126
131 static void (*ClassExitMethod)(void*);
132 static void (*ClassExitMethodArgDelete)(void*);
133 static void* ClassExitMethodArg;
135
137
141 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
142 int InternalDestroyTimer(int platformTimerId) override;
144
150 void StartEventLoop() override;
151
153
154private:
156 void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
157};
158
159VTK_ABI_NAMESPACE_END
160#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:29
platform-independent render window interaction including picking and frame rate control.
int vtkTypeBool
Definition vtkABI.h:64