VTK  9.2.6
vtkSDL2RenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSDL2RenderWindowInteractor.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 =========================================================================*/
31 #ifndef vtkSDL2RenderWindowInteractor_h
32 #define vtkSDL2RenderWindowInteractor_h
33 
35 #include "vtkRenderingUIModule.h" // For export macro
36 #include <map> // for ivar
37 
38 class VTKRENDERINGUI_EXPORT vtkSDL2RenderWindowInteractor : public vtkRenderWindowInteractor
39 {
40 public:
45 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  virtual void Initialize() override;
53 
59  void ProcessEvents() override;
60 
66  void TerminateApp(void) override;
67 
72  void ExitCallback() override;
73 
74  // When using emscripten this adds the event handler
75  // and then returns without blocking or aborting.
76  // TerminateApp will remove the event hanbdler.
77  void AddEventHandler();
78 
79 protected:
82 
83  bool ProcessEvent(void* event);
84 
86 
90  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
91  int InternalDestroyTimer(int platformTimerId) override;
93 
94  std::map<int, int> VTKToPlatformTimerMap;
95 
101  void StartEventLoop() override;
102 
104 
105 private:
107  void operator=(const vtkSDL2RenderWindowInteractor&) = delete;
108 };
109 
110 #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:39
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 TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
virtual void ProcessEvents()
Run the event loop and return.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.