VTK  9.0.1
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 =========================================================================*/
36 #ifndef vtkAndroidRenderWindowInteractor_h
37 #define vtkAndroidRenderWindowInteractor_h
38 
40 #include "vtkRenderingUIModule.h" // For export macro
41 
42 struct AInputEvent;
43 
44 class VTKRENDERINGUI_EXPORT vtkAndroidRenderWindowInteractor : public vtkRenderWindowInteractor
45 {
46 public:
51 
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
58  virtual void Initialize();
59 
61 
70  virtual void Enable();
71  virtual void Disable();
73 
79  void TerminateApp(void);
80 
82 
88  static void SetClassExitMethod(void (*f)(void*), void* arg);
89  static void SetClassExitMethodArgDelete(void (*f)(void*));
91 
96  virtual void ExitCallback();
97 
98  virtual void SetAndroidApplication(struct android_app* app) { this->AndroidApplication = app; }
99 
103  void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
104 
108  void HandleMotionEvent(
109  int actionType, int actionId, int numPtrs, int* xPtr, int* yPtr, int* idPtr, int metaState);
110 
114  const char* GetKeySym(int keyCode);
115 
116  void HandleCommand(int32_t cmd);
117  int32_t HandleInput(AInputEvent* event);
118 
119 protected:
122 
125 
126  struct android_app* AndroidApplication;
127  const char** KeyCodeToKeySymTable;
128 
129  bool Done; // is the event loop done running
130 
132 
137  static void (*ClassExitMethod)(void*);
138  static void (*ClassExitMethodArgDelete)(void*);
139  static void* ClassExitMethodArg;
141 
143 
147  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
148  virtual int InternalDestroyTimer(int platformTimerId);
150 
156  virtual void StartEventLoop();
157 
158 private:
160  void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
161 };
162 
163 #endif
vtkRenderWindowInteractor::New
static vtkRenderWindowInteractor * New()
vtkRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:919
vtkAndroidRenderWindowInteractor::StartedMessageLoop
int StartedMessageLoop
Definition: vtkAndroidRenderWindowInteractor.h:124
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkAndroidRenderWindowInteractor::KeyCodeToKeySymTable
const char ** KeyCodeToKeySymTable
Definition: vtkAndroidRenderWindowInteractor.h:127
vtkAndroidRenderWindowInteractor::AndroidApplication
struct android_app * AndroidApplication
Definition: vtkAndroidRenderWindowInteractor.h:126
vtkAndroidRenderWindowInteractor::SetAndroidApplication
virtual void SetAndroidApplication(struct android_app *app)
Definition: vtkAndroidRenderWindowInteractor.h:98
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:149
vtkAndroidRenderWindowInteractor::MouseInWindow
int MouseInWindow
Definition: vtkAndroidRenderWindowInteractor.h:123
vtkRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAndroidRenderWindowInteractor::Done
bool Done
Definition: vtkAndroidRenderWindowInteractor.h:129
vtkRenderWindowInteractor::GetKeySym
virtual char * GetKeySym()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkRenderWindowInteractor::ExitCallback
virtual void ExitCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkRenderWindowInteractor::TerminateApp
virtual void TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
Definition: vtkRenderWindowInteractor.h:301
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:144
vtkRenderWindowInteractor.h
vtkRenderWindowInteractor::Initialize
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
vtkAndroidRenderWindowInteractor::ClassExitMethodArg
static void * ClassExitMethodArg
Definition: vtkAndroidRenderWindowInteractor.h:139
vtkAndroidRenderWindowInteractor
implements Win32 specific functions required by vtkRenderWindowInteractor.
Definition: vtkAndroidRenderWindowInteractor.h:44