VTK  9.2.6
vtkAndroidRenderWindowInteractor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAndroidRenderWindowInteractor.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
32
33#ifndef vtkAndroidRenderWindowInteractor_h
34#define vtkAndroidRenderWindowInteractor_h
35
37#include "vtkRenderingUIModule.h" // For export macro
38
39struct AInputEvent;
40
42{
43public:
48
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
55 void Initialize() override;
56
58
67 void Enable() override;
68 void Disable() override;
70
76 void TerminateApp(void) override;
77
79
85 static void SetClassExitMethod(void (*f)(void*), void* arg);
86 static void SetClassExitMethodArgDelete(void (*f)(void*));
88
93 void ExitCallback() override;
94
95 virtual void SetAndroidApplication(struct android_app* app) { this->AndroidApplication = app; }
96
100 void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
101
106 int actionType, int actionId, int numPtrs, int* xPtr, int* yPtr, int* idPtr, int metaState);
107
111 const char* GetKeySym(int keyCode);
112
113 void HandleCommand(int32_t cmd);
114 int32_t HandleInput(AInputEvent* event);
115
117
120 vtkSetMacro(OwnWindow, bool);
121 vtkGetMacro(OwnWindow, bool);
123
124protected:
127
130
131 struct android_app* AndroidApplication;
133
134 bool Done; // is the event loop done running
135
137
142 static void (*ClassExitMethod)(void*);
143 static void (*ClassExitMethodArgDelete)(void*);
144 static void* ClassExitMethodArg;
146
148
152 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
153 int InternalDestroyTimer(int platformTimerId) override;
155
161 void StartEventLoop() override;
162
164
165private:
167 void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
168};
169
170#endif
void TerminateApp(void) override
Android specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to termin...
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.
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:34
int vtkTypeBool
Definition vtkABI.h:69