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 */
Monitor events in the visualization window.
void registerKeystroke(const std::string key_str, const std::string key_desc)
Make new keystrokes available in the help message box.
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...
mrpt::utils::CTicTac m_tim_show_end
mrpt::utils::CTicTac m_tim_show_start
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...
void OnEvent(const mrpt::utils::mrptEvent &e)
This virtual function will be called upon receive of any event after starting listening at any CObser...
Inherit from this class to get notified about events from any CObservable object after subscribing to...
Definition: CObserver.h:39
This class implements a high-performance stopwatch.
Definition: CTicTac.h:24
The basic event type for the observer-observable pattern in MRPT.
Definition: mrptEvent.h:35
GLsizei const GLchar ** string
Definition: glext.h:4101
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST