Main MRPT website > C++ reference for MRPT 1.5.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-2017, 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 
14 #include <mrpt/utils/CTicTac.h>
15 #include <mrpt/utils/TParameters.h>
16 #include <mrpt/utils/CObserver.h>
17 #include <mrpt/opengl/gl_utils.h>
19 
21 
22 #include <iostream>
23 #include <string>
24 #include <map>
25 
26 namespace mrpt { namespace graphslam {
27 
28 /**\brief Monitor events in the visualization window.
29  *
30  * \ingroup mrpt_graphslam_grp
31  */
33 {
34 public:
36  /**\brief Return a map of key code to a boolean indicating whether it was
37  * pressed since the previous time the class was quarried.
38  *
39  * \note By default the codes are reset every time the method is invoked,
40  * unless <em>reset_keypresses<\em> is set to False
41  */
42  void returnEventsStruct(
43  std::map<std::string, bool>* codes_to_pressed,
44  bool reset_keypresses=true);
45  /**\brief Make new keystrokes available in the help message box.
46  *
47  * Classes with access to the CWindowObserver can use this method to add
48  * keystrokes according to their needs
49  */
50  void registerKeystroke(const std::string key_str, const std::string key_desc);
51 
52 protected:
53  void OnEvent(const mrpt::utils::mrptEvent &e);
54 
55 private:
56  bool m_showing_help, m_hiding_help;
57 
59 
60  /**\brief Map from registered char_code (std::string to support <C-c>) to boolean
61  * true/false indicating whether it has been pressed since previous time
62  * checked
63  */
64  std::map<std::string, bool> m_key_codes_to_pressed;
66 };
67 
68 } } // END OF NAMESPACES
69 
70 #endif /* end of include guard: CWINDOWOBSERVER_H */
The basic event type for the observer-observable pattern in MRPT.
Definition: mrptEvent.h:34
This class implements a high-performance stopwatch.
Definition: CTicTac.h:24
mrpt::utils::CTicTac m_tim_show_start
GLsizei const GLchar ** string
Definition: glext.h:3919
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...
Inherit from this class to get notified about events from any CObservable object after subscribing to...
Definition: CObserver.h:34



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020