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 */
mrpt::system::mrptEvent
The basic event type for the observer-observable pattern in MRPT.
Definition: mrptEvent.h:33
mrpt::graphslam::CWindowObserver::m_key_codes_to_pressed
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...
Definition: CWindowObserver.h:61
mrpt::graphslam::CWindowObserver::returnEventsStruct
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...
Definition: CWindowObserver.cpp:38
mrpt::system::CTicTac
A high-performance stopwatch, with typical resolution of nanoseconds.
Definition: system/CTicTac.h:19
mrpt::graphslam::CWindowObserver::m_help_msg
std::string m_help_msg
Definition: CWindowObserver.h:54
mrpt::graphslam::CWindowObserver::m_tim_show_start
mrpt::system::CTicTac m_tim_show_start
Definition: CWindowObserver.h:62
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::graphslam::CWindowObserver::OnEvent
void OnEvent(const mrpt::system::mrptEvent &e)
This virtual function will be called upon receive of any event after starting listening at any CObser...
Definition: CWindowObserver.cpp:65
mrpt::graphslam::CWindowObserver
Monitor events in the visualization window.
Definition: CWindowObserver.h:27
mrpt::graphslam::CWindowObserver::registerKeystroke
void registerKeystroke(const std::string key_str, const std::string key_desc)
Make new keystrokes available in the help message box.
Definition: CWindowObserver.cpp:56
mrpt::graphslam::CWindowObserver::CWindowObserver
CWindowObserver()
Definition: CWindowObserver.cpp:20
mrpt::graphslam::CWindowObserver::m_tim_show_end
mrpt::system::CTicTac m_tim_show_end
Definition: CWindowObserver.h:62
mrpt::graphslam::CWindowObserver::m_hiding_help
bool m_hiding_help
Definition: CWindowObserver.h:52
CObserver.h
mrpt::graphslam::CWindowObserver::m_showing_help
bool m_showing_help
Definition: CWindowObserver.h:52
mrpt::system::CObserver
Inherit from this class to get notified about events from any CObservable object after subscribing to...
Definition: CObserver.h:36
CTicTac.h
string
GLsizei const GLchar ** string
Definition: glext.h:4101



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST