19 m_showing_help(false),
23 " - h/H: Toggle help message\n" 24 " - Alt+Enter: Toggle fullscreen\n" 25 " - Mouse click: Set camera manually\n" 26 " - Ctrl+c: Halt program execution";
34 std::cout <<
"WindowObserver initialized." << std::endl;
39 std::map<std::string, bool>* codes_to_pressed,
40 bool reset_keypresses ) {
44 if (reset_keypresses) {
49 map_it->second =
false;
69 std::cout <<
"Event received: mrptEventOnDestroy" << std::endl;
74 std::cout <<
"Resize event received from: " << ev.
source_object 89 std::cout <<
"h/H was pressed!" << std::endl;
101 std::cout <<
"Pressed C-c inside CDisplayWindow3D" << std::endl;
119 std::cout <<
"Window closed event received from: " 126 std::cout <<
"Mouse down event received from: " 140 "Press 'h' for help",
147 static const double TRANSP_ANIMATION_TIME_SEC = 0.5;
153 1.0-
std::min(1.0,hide_tim/TRANSP_ANIMATION_TIME_SEC)
155 std::min(1.0,show_tim/TRANSP_ANIMATION_TIME_SEC);
An event sent by a window upon resize.
CBaseGUIWindow * source_object
void OPENGL_IMPEXP renderMessageBox(const float msg_x, const float msg_y, const float msg_w, const float msg_h, const std::string &text, float text_scale, const mrpt::utils::TColor &back_col=mrpt::utils::TColor(0, 0, 50, 150), const mrpt::utils::TColor &border_col=mrpt::utils::TColor(0, 0, 0, 140), const mrpt::utils::TColor &text_col=mrpt::utils::TColor(255, 255, 255, 220), const float border_width=4.0f, const std::string &text_font=std::string("sans"), mrpt::opengl::TOpenGLFontStyle text_style=mrpt::opengl::FILL, const double text_spacing=1.5, const double text_kerning=0.1)
Draws a message box with a centered (possibly multi-lined) text.
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates. ...
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.
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.
An event sent by a window upon when it's about to be closed, either manually by the user or programat...
SLAM methods related to graphs of pose constraints.
mrpt::utils::TPixelCoord coords
std::string BASE_IMPEXP lowerCase(const std::string &str)
Returns an lower-case version of a string.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
CBaseGUIWindow * source_object
mrpt::utils::CTicTac m_tim_show_start
An event sent by a window upon a char pressed by the user.
CBaseGUIWindow * source_object
GLsizei const GLchar ** string
An event sent by any CObservable object (automatically) just before being destroyed and telling its o...
mrpt::utils::CTicTac m_tim_show_end
mrptKeyModifier key_modifiers
Modifiers (Shift, Control, etc...)
An event sent by an mrpt::opengl::COpenGLViewport after calling the scene OpenGL drawing primitives a...
std::string BASE_IMPEXP upperCase(const std::string &str)
Returns a upper-case version of a string.
CBaseGUIWindow * source_object
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...
renders glyphs filled with antialiased outlines
double Tac()
Stops the stopwatch.
int char_code
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes)...