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 =========================================================================*/
30 #ifndef vtkAndroidRenderWindowInteractor_h
31 #define vtkAndroidRenderWindowInteractor_h
32 
33 #include "vtkRenderingOpenGL2Module.h" // For export macro
35 
36 struct AInputEvent;
37 
38 class VTKRENDERINGOPENGL2_EXPORT vtkAndroidRenderWindowInteractor : public vtkRenderWindowInteractor
39 {
40 public:
45 
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
52  virtual void Initialize();
53 
55 
64  virtual void Enable();
65  virtual void Disable();
67 
73  void TerminateApp(void);
74 
76 
82  static void SetClassExitMethod(void (*f)(void *), void *arg);
83  static void SetClassExitMethodArgDelete(void (*f)(void *));
85 
90  virtual void ExitCallback();
91 
92  virtual void SetAndroidApplication(struct android_app *app)
93  { this->AndroidApplication = app; };
94 
98  void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
99 
103  void HandleMotionEvent(int actionType, int actionId, int numPtrs,
104  int *xPtr, int *yPtr, int *idPtr, int metaState);
105 
109  const char *GetKeySym(int keyCode);
110 
111  void HandleCommand(int32_t cmd);
112  int32_t HandleInput(AInputEvent* event);
113 
114 
115 protected:
118 
121 
122  struct android_app *AndroidApplication;
123  const char **KeyCodeToKeySymTable;
124 
125  bool Done; // is the event loop done running
126 
128 
133  static void (*ClassExitMethod)(void *);
134  static void (*ClassExitMethodArgDelete)(void *);
135  static void *ClassExitMethodArg;
137 
139 
143  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
144  virtual int InternalDestroyTimer(int platformTimerId);
146 
152  virtual void StartEventLoop();
153 
154 private:
156  void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
157 };
158 
159 #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:889
vtkAndroidRenderWindowInteractor::StartedMessageLoop
int StartedMessageLoop
Definition: vtkAndroidRenderWindowInteractor.h:120
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkAndroidRenderWindowInteractor::KeyCodeToKeySymTable
const char ** KeyCodeToKeySymTable
Definition: vtkAndroidRenderWindowInteractor.h:123
vtkAndroidRenderWindowInteractor::AndroidApplication
struct android_app * AndroidApplication
Definition: vtkAndroidRenderWindowInteractor.h:122
vtkAndroidRenderWindowInteractor::SetAndroidApplication
virtual void SetAndroidApplication(struct android_app *app)
Definition: vtkAndroidRenderWindowInteractor.h:92
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:118
vtkAndroidRenderWindowInteractor::MouseInWindow
int MouseInWindow
Definition: vtkAndroidRenderWindowInteractor.h:119
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:125
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:72
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:249
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:117
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:135
vtkAndroidRenderWindowInteractor
implements Win32 specific functions required by vtkRenderWindowInteractor.
Definition: vtkAndroidRenderWindowInteractor.h:38