Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
mrpt::graphslam::CWindowObserver Class Reference

Detailed Description

Monitor events in the visualization window.

Definition at line 27 of file CWindowObserver.h.

#include <mrpt/graphslam/misc/CWindowObserver.h>

Inheritance diagram for mrpt::graphslam::CWindowObserver:
Inheritance graph

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 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
 

Constructor & Destructor Documentation

◆ CWindowObserver()

CWindowObserver::CWindowObserver ( )

Definition at line 20 of file CWindowObserver.cpp.

References m_help_msg, and m_key_codes_to_pressed.

Member Function Documentation

◆ observeBegin()

void CObserver::observeBegin ( CObservable obj)
inherited

Starts the subscription of this observer to the given object.

See also
observeEnd

Definition at line 26 of file CObserver.cpp.

Referenced by CGraphSlamHandler< GRAPH_T >::initVisualization().

◆ observeEnd()

void CObserver::observeEnd ( CObservable obj)
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.

See also
observeBegin

Definition at line 36 of file CObserver.cpp.

◆ OnEvent()

void CWindowObserver::OnEvent ( const mrpt::system::mrptEvent e)
protectedvirtual

◆ registerKeystroke()

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().

◆ returnEventsStruct()

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.

Note
By default the codes are reset every time the method is invoked, unless reset_keypresses< > is set to False

Definition at line 38 of file CWindowObserver.cpp.

References m_key_codes_to_pressed.

Referenced by CGraphSlamHandler< GRAPH_T >::queryObserverForEvents().

Member Data Documentation

◆ m_help_msg

std::string mrpt::graphslam::CWindowObserver::m_help_msg
private

Definition at line 54 of file CWindowObserver.h.

Referenced by CWindowObserver(), OnEvent(), and registerKeystroke().

◆ m_hiding_help

bool mrpt::graphslam::CWindowObserver::m_hiding_help
private

Definition at line 52 of file CWindowObserver.h.

Referenced by OnEvent().

◆ m_key_codes_to_pressed

std::map<std::string, bool> mrpt::graphslam::CWindowObserver::m_key_codes_to_pressed
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().

◆ m_showing_help

bool mrpt::graphslam::CWindowObserver::m_showing_help
private

Definition at line 52 of file CWindowObserver.h.

Referenced by OnEvent().

◆ m_tim_show_end

mrpt::system::CTicTac mrpt::graphslam::CWindowObserver::m_tim_show_end
private

Definition at line 62 of file CWindowObserver.h.

Referenced by OnEvent().

◆ m_tim_show_start

mrpt::system::CTicTac mrpt::graphslam::CWindowObserver::m_tim_show_start
private

Definition at line 62 of file CWindowObserver.h.

Referenced by OnEvent().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019