Monitor events in the visualization window.
Definition at line 27 of file CWindowObserver.h.
#include <mrpt/graphslam/misc/CWindowObserver.h>
Public Member Functions | |
CWindowObserver () | |
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 class was quarried. More... | |
void | registerKeystroke (const std::string key_str, const std::string key_desc) |
Make new keystrokes available in the help message box. More... | |
void | observeBegin (CObservable &obj) |
Starts the subscription of this observer to the given object. More... | |
void | observeEnd (CObservable &obj) |
Ends the subscription of this observer to the given object (note that there is no need to call this method, since the destruction of the first of observer/observed will put an end to the process. More... | |
Protected Member Functions | |
void | OnEvent (const mrpt::system::mrptEvent &e) |
This virtual function will be called upon receive of any event after starting listening at any CObservable object. More... | |
Private Member Functions | |
void | internal_on_event (const mrptEvent &e) |
Private Attributes | |
bool | m_showing_help |
bool | m_hiding_help |
std::string | m_help_msg |
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 it has been pressed since previous time checked. More... | |
mrpt::system::CTicTac | m_tim_show_start |
mrpt::system::CTicTac | m_tim_show_end |
std::set< CObservable * > | m_subscribed |
CWindowObserver::CWindowObserver | ( | ) |
Definition at line 20 of file CWindowObserver.cpp.
References m_help_msg, and m_key_codes_to_pressed.
Definition at line 47 of file CObserver.cpp.
|
inherited |
Starts the subscription of this observer to the given object.
Definition at line 26 of file CObserver.cpp.
Referenced by CGraphSlamHandler< GRAPH_T >::initVisualization().
|
inherited |
Ends the subscription of this observer to the given object (note that there is no need to call this method, since the destruction of the first of observer/observed will put an end to the process.
Definition at line 36 of file CObserver.cpp.
|
protectedvirtual |
This virtual function will be called upon receive of any event after starting listening at any CObservable object.
Implements mrpt::system::CObserver.
Definition at line 65 of file CWindowObserver.cpp.
References mrpt::gui::mrptEventWindowChar::char_code, mrpt::gui::mrptEventMouseDown::coords, mrpt::system::mrptEvent::isOfType(), mrpt::gui::mrptEventWindowChar::key_modifiers, mrpt::system::lowerCase(), m_help_msg, m_hiding_help, m_key_codes_to_pressed, m_showing_help, m_tim_show_end, m_tim_show_start, min, MRPT_UNUSED_PARAM, mrpt::gui::mrptEventWindowResize::new_height, mrpt::gui::mrptEventWindowResize::new_width, mrpt::opengl::NICE, mrpt::opengl::gl_utils::renderMessageBox(), mrpt::gui::mrptEventWindowChar::source_object, mrpt::gui::mrptEventWindowResize::source_object, mrpt::gui::mrptEventMouseDown::source_object, mrpt::gui::mrptEventWindowClosed::source_object, mrpt::system::CTicTac::Tac(), mrpt::img::TPixelCoord::x, and mrpt::img::TPixelCoord::y.
void CWindowObserver::registerKeystroke | ( | const std::string | key_str, |
const std::string | key_desc | ||
) |
Make new keystrokes available in the help message box.
Classes with access to the CWindowObserver can use this method to add keystrokes according to their needs
Definition at line 56 of file CWindowObserver.cpp.
References m_help_msg, m_key_codes_to_pressed, and mrpt::system::upperCase().
void CWindowObserver::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 class was quarried.
Definition at line 38 of file CWindowObserver.cpp.
References m_key_codes_to_pressed.
Referenced by CGraphSlamHandler< GRAPH_T >::queryObserverForEvents().
|
private |
Definition at line 54 of file CWindowObserver.h.
Referenced by CWindowObserver(), OnEvent(), and registerKeystroke().
|
private |
Definition at line 52 of file CWindowObserver.h.
Referenced by OnEvent().
|
private |
Map from registered char_code (std::string to support <C-c>) to boolean true/false indicating whether it has been pressed since previous time checked.
Definition at line 61 of file CWindowObserver.h.
Referenced by CWindowObserver(), OnEvent(), registerKeystroke(), and returnEventsStruct().
|
private |
Definition at line 52 of file CWindowObserver.h.
Referenced by OnEvent().
|
privateinherited |
Definition at line 55 of file CObserver.h.
|
private |
Definition at line 62 of file CWindowObserver.h.
Referenced by OnEvent().
|
private |
Definition at line 62 of file CWindowObserver.h.
Referenced by OnEvent().
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 |