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-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 
20 #include <iostream>
21 #include <string>
22 #include <map>
23 
24 namespace mrpt
25 {
26 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(
51  const std::string key_str, const std::string key_desc);
52 
53  protected:
54  void OnEvent(const mrpt::utils::mrptEvent& e);
55 
56  private:
58 
60 
61  /**\brief Map from registered char_code (std::string to support <C-c>) to
62  * boolean
63  * true/false indicating whether it has been pressed since previous time
64  * checked
65  */
66  std::map<std::string, bool> m_key_codes_to_pressed;
68 };
69 }
70 } // END OF NAMESPACES
71 
72 #endif /* end of include guard: CWINDOWOBSERVER_H */
void OnEvent(const mrpt::utils::mrptEvent &e)
This virtual function will be called upon receive of any event after starting listening at any CObser...
The basic event type for the observer-observable pattern in MRPT.
Definition: mrptEvent.h:34
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.
This class implements a high-performance stopwatch.
Definition: CTicTac.h:23
mrpt::utils::CTicTac m_tim_show_start
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::utils::CTicTac m_tim_show_end
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:38



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019