VTK  9.3.1
vtkSDL2RenderWindowInteractor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkSDL2RenderWindowInteractor_h
20 #define vtkSDL2RenderWindowInteractor_h
21 
23 #include "vtkRenderingUIModule.h" // For export macro
24 #include <map> // for ivar
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class VTKRENDERINGUI_EXPORT vtkSDL2RenderWindowInteractor : public vtkRenderWindowInteractor
28 {
29 public:
34 
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
41  void Initialize() override;
42 
47  void ProcessEvents() override;
48 
54  void TerminateApp() override;
55 
60  void ExitCallback() override;
61 
62  // When using emscripten this adds the event handler
63  // and then returns without blocking or aborting.
64  // TerminateApp will remove the event hanbdler.
65  void AddEventHandler();
66 
67 protected:
70 
71  bool ProcessEvent(void* event);
72 
74 
78  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
79  int InternalDestroyTimer(int platformTimerId) override;
81 
82  std::map<int, int> VTKToPlatformTimerMap;
83 
89  void StartEventLoop() override;
90 
92 
93 private:
95  void operator=(const vtkSDL2RenderWindowInteractor&) = delete;
96 };
97 
98 VTK_ABI_NAMESPACE_END
99 #endif
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
implements SDL2 specific functions required by vtkRenderWindowInteractor.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ExitCallback()
These methods correspond to the Exit, User and Pick callbacks.
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
virtual void ProcessEvents()
Process all user-interaction, timer events and return.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void TerminateApp()
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...