22 " - h/H: Toggle help message\n" 23 " - Alt+Enter: Toggle fullscreen\n" 24 " - Mouse click: Set camera manually\n" 25 " - Ctrl+c: Halt program execution";
33 std::cout <<
"WindowObserver initialized." << std::endl;
37 std::map<std::string, bool>* codes_to_pressed,
38 bool reset_keypresses )
49 map_it->second =
false;
70 std::cout <<
"Event received: mrptEventOnDestroy" << std::endl;
76 std::cout <<
"Resize event received from: " << ev.
source_object 96 std::cout <<
"h/H was pressed!" << std::endl;
110 std::cout <<
"Pressed C-c inside CDisplayWindow3D" 133 std::cout <<
"Window closed event received from: " << ev.
source_object 142 std::cout <<
"Mouse down event received from: " << ev.
source_object 159 "Press 'h' for help",
167 static const double TRANSP_ANIMATION_TIME_SEC = 0.5;
172 const double tranparency =
174 ? 1.0 -
std::min(1.0, hide_tim / TRANSP_ANIMATION_TIME_SEC)
175 :
std::min(1.0, show_tim / TRANSP_ANIMATION_TIME_SEC);
183 190, 190, 190, 200 * tranparency),
An event sent by a window upon resize.
CBaseGUIWindow * source_object
void 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 programma...
SLAM methods related to graphs of pose constraints.
mrpt::utils::TPixelCoord coords
std::string 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 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)...