MRPT  1.9.9
CWindowObserver.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef CWINDOWOBSERVER_H
11 #define CWINDOWOBSERVER_H
12 
13 #include <mrpt/system/CTicTac.h>
14 #include <mrpt/system/CObserver.h>
15 
16 #include <string>
17 #include <map>
18 
19 namespace mrpt::graphslam
20 {
21 /**\brief Monitor events in the visualization window.
22  *
23  * \ingroup mrpt_graphslam_grp
24  */
26 {
27  public:
29  /**\brief Return a map of key code to a boolean indicating whether it was
30  * pressed since the previous time the class was quarried.
31  *
32  * \note By default the codes are reset every time the method is invoked,
33  * unless <em>reset_keypresses<\em> is set to False
34  */
35  void returnEventsStruct(
36  std::map<std::string, bool>* codes_to_pressed,
37  bool reset_keypresses = true);
38  /**\brief Make new keystrokes available in the help message box.
39  *
40  * Classes with access to the CWindowObserver can use this method to add
41  * keystrokes according to their needs
42  */
43  void registerKeystroke(
44  const std::string key_str, const std::string key_desc);
45 
46  protected:
47  void OnEvent(const mrpt::system::mrptEvent& e);
48 
49  private:
51 
53 
54  /**\brief Map from registered char_code (std::string to support <C-c>) to
55  * boolean
56  * true/false indicating whether it has been pressed since previous time
57  * checked
58  */
59  std::map<std::string, bool> m_key_codes_to_pressed;
61 };
62 }
63 #endif /* end of include guard: CWINDOWOBSERVER_H */
64 
65 
void OnEvent(const mrpt::system::mrptEvent &e)
This virtual function will be called upon receive of any event after starting listening at any CObser...
mrpt::system::CTicTac m_tim_show_end
The basic event type for the observer-observable pattern in MRPT.
Definition: mrptEvent.h:32
A high-performance stopwatch, with typical resolution of nanoseconds.
void returnEventsStruct(std::map< std::string, bool > *codes_to_pressed, bool reset_keypresses=true)
Return a map of key code to a boolean indicating whether it was pressed since the previous time the c...
void registerKeystroke(const std::string key_str, const std::string key_desc)
Make new keystrokes available in the help message box.
SLAM methods related to graphs of pose constraints.
Inherit from this class to get notified about events from any CObservable object after subscribing to...
Definition: CObserver.h:34
mrpt::system::CTicTac m_tim_show_start
GLsizei const GLchar ** string
Definition: glext.h:4101
Monitor events in the visualization window.
std::map< std::string, bool > m_key_codes_to_pressed
Map from registered char_code (std::string to support <C-c>) to boolean true/false indicating whether...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020