Main MRPT website > C++ reference for 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
20 {
21 namespace graphslam
22 {
23 /**\brief Monitor events in the visualization window.
24  *
25  * \ingroup mrpt_graphslam_grp
26  */
28 {
29  public:
31  /**\brief Return a map of key code to a boolean indicating whether it was
32  * pressed since the previous time the class was quarried.
33  *
34  * \note By default the codes are reset every time the method is invoked,
35  * unless <em>reset_keypresses<\em> is set to False
36  */
37  void returnEventsStruct(
38  std::map<std::string, bool>* codes_to_pressed,
39  bool reset_keypresses = true);
40  /**\brief Make new keystrokes available in the help message box.
41  *
42  * Classes with access to the CWindowObserver can use this method to add
43  * keystrokes according to their needs
44  */
45  void registerKeystroke(
46  const std::string key_str, const std::string key_desc);
47 
48  protected:
49  void OnEvent(const mrpt::system::mrptEvent& e);
50 
51  private:
53 
55 
56  /**\brief Map from registered char_code (std::string to support <C-c>) to
57  * boolean
58  * true/false indicating whether it has been pressed since previous time
59  * checked
60  */
61  std::map<std::string, bool> m_key_codes_to_pressed;
63 };
64 }
65 } // END OF NAMESPACES
66 
67 #endif /* end of include guard: CWINDOWOBSERVER_H */
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:33
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.
Inherit from this class to get notified about events from any CObservable object after subscribing to...
Definition: CObserver.h:36
mrpt::system::CTicTac m_tim_show_start
GLsizei const GLchar ** string
Definition: glext.h:4101
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019