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 =========================================================================*/
30 #ifndef vtkAndroidRenderWindowInteractor_h
31 #define vtkAndroidRenderWindowInteractor_h
32 
34 #include "vtkRenderingUIModule.h" // For export macro
35 
36 struct AInputEvent;
37 
38 class VTKRENDERINGUI_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) { this->AndroidApplication = app; }
93 
97  void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt);
98 
103  int actionType, int actionId, int numPtrs, int* xPtr, int* yPtr, int* idPtr, int metaState);
104 
108  const char* GetKeySym(int keyCode);
109 
110  void HandleCommand(int32_t cmd);
111  int32_t HandleInput(AInputEvent* event);
112 
113 protected:
116 
119 
120  struct android_app* AndroidApplication;
121  const char** KeyCodeToKeySymTable;
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  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
142  virtual int InternalDestroyTimer(int platformTimerId);
144 
150  virtual void StartEventLoop();
151 
152 private:
154  void operator=(const vtkAndroidRenderWindowInteractor&) = delete;
155 };
156 
157 #endif
vtkAndroidRenderWindowInteractor::StartedMessageLoop
int StartedMessageLoop
Definition: vtkAndroidRenderWindowInteractor.h:118
vtkAndroidRenderWindowInteractor::~vtkAndroidRenderWindowInteractor
~vtkAndroidRenderWindowInteractor() override
vtkAndroidRenderWindowInteractor::KeyCodeToKeySymTable
const char ** KeyCodeToKeySymTable
Definition: vtkAndroidRenderWindowInteractor.h:121
vtkAndroidRenderWindowInteractor::ExitCallback
virtual void ExitCallback()
These methods correspond to the Exit, User and Pick callbacks.
vtkAndroidRenderWindowInteractor::vtkAndroidRenderWindowInteractor
vtkAndroidRenderWindowInteractor()
vtkAndroidRenderWindowInteractor::AndroidApplication
struct android_app * AndroidApplication
Definition: vtkAndroidRenderWindowInteractor.h:120
vtkAndroidRenderWindowInteractor::HandleMotionEvent
void HandleMotionEvent(int actionType, int actionId, int numPtrs, int *xPtr, int *yPtr, int *idPtr, int metaState)
Handle motion events.
vtkAndroidRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Win32-specific internal timer methods.
vtkAndroidRenderWindowInteractor::SetAndroidApplication
virtual void SetAndroidApplication(struct android_app *app)
Definition: vtkAndroidRenderWindowInteractor.h:92
vtkAndroidRenderWindowInteractor::MouseInWindow
int MouseInWindow
Definition: vtkAndroidRenderWindowInteractor.h:117
vtkAndroidRenderWindowInteractor::SetClassExitMethod
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
vtkAndroidRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
This will start up the event loop and never return.
vtkAndroidRenderWindowInteractor::SetClassExitMethodArgDelete
static void SetClassExitMethodArgDelete(void(*f)(void *))
vtkAndroidRenderWindowInteractor::Done
bool Done
Definition: vtkAndroidRenderWindowInteractor.h:123
vtkAndroidRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkAndroidRenderWindowInteractor::Disable
virtual void Disable()
vtkAndroidRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkAndroidRenderWindowInteractor::HandleCommand
void HandleCommand(int32_t cmd)
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:74
vtkAndroidRenderWindowInteractor::GetKeySym
const char * GetKeySym(int keyCode)
used for converting keyCodes on Android
vtkAndroidRenderWindowInteractor::HandleInput
int32_t HandleInput(AInputEvent *event)
vtkAndroidRenderWindowInteractor::HandleKeyEvent
void HandleKeyEvent(bool down, int nChar, int metaState, int nRepCnt)
Handle key up/down events.
vtkRenderWindowInteractor.h
vtkAndroidRenderWindowInteractor::New
static vtkAndroidRenderWindowInteractor * New()
Construct object so that light follows camera motion.
vtkAndroidRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
vtkAndroidRenderWindowInteractor::TerminateApp
void TerminateApp(void)
Android specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to termin...
vtkAndroidRenderWindowInteractor::ClassExitMethodArg
static void * ClassExitMethodArg
Definition: vtkAndroidRenderWindowInteractor.h:133
vtkAndroidRenderWindowInteractor::Initialize
virtual void Initialize()
Initialize the event handler.
vtkAndroidRenderWindowInteractor
implements Win32 specific functions required by vtkRenderWindowInteractor.
Definition: vtkAndroidRenderWindowInteractor.h:39