VTK
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 =========================================================================*/
35 #ifndef vtkAndroidRenderWindowInteractor_h
36 #define vtkAndroidRenderWindowInteractor_h
37 
38 #include "vtkRenderingOpenGL2Module.h" // For export macro
40 
41 struct AInputEvent;
42 
43 class VTKRENDERINGOPENGL2_EXPORT vtkAndroidRenderWindowInteractor : public vtkRenderWindowInteractor
44 {
45 public:
48 
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53  virtual void Initialize();
54 
56 
63  virtual void Enable();
64  virtual void Disable();
66 
71  void TerminateApp(void);
72 
74 
78  static void SetClassExitMethod(void (*f)(void *), void *arg);
79  static void SetClassExitMethodArgDelete(void (*f)(void *));
81 
84  virtual void ExitCallback();
85 
86  virtual void SetAndroidApplication(struct android_app *app)
87  { this->AndroidApplication = app; };
88 
90  void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
91 
93 
94  void HandleMotionEvent(int action, int eventPointer, int numPtrs,
95  int *xPtr, int *yPtr, int *idPtr, int metaState);
97 
99  const char *GetKeySym(int keyCode);
100 
101  void HandleCommand(int32_t cmd);
102  int32_t HandleInput(AInputEvent* event);
103 
104 
105 protected:
108 
111 
112  struct android_app *AndroidApplication;
113  const char **KeyCodeToKeySymTable;
114 
115  bool Done; // is the event loop done running
116 
118 
121  static void (*ClassExitMethod)(void *);
122  static void (*ClassExitMethodArgDelete)(void *);
123  static void *ClassExitMethodArg;
125 
127 
129  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
130  virtual int InternalDestroyTimer(int platformTimerId);
132 
136  virtual void StartEventLoop();
137 
138 private:
140  void operator=(const vtkAndroidRenderWindowInteractor&); // Not implemented.
141 };
142 
143 #endif
virtual char * GetKeySym()
virtual int InternalDestroyTimer(int platformTimerId)
implements Win32 specific functions required by vtkRenderWindowInteractor.
void PrintSelf(ostream &os, vtkIndent indent)
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
virtual void SetAndroidApplication(struct android_app *app)
virtual void Initialize()
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExitCallback()