24 " - h/H: Toggle help message\n" 25 " - Alt+Enter: Toggle fullscreen\n" 26 " - Mouse click: Set camera manually\n" 27 " - Ctrl+c: Halt program execution";
37 std::map<std::string, bool>* codes_to_pressed,
38 bool reset_keypresses )
47 map_it.second =
false;
68 std::cout <<
"Event received: mrptEventOnDestroy" << std::endl;
74 std::cout <<
"Resize event received from: " << ev.
source_object 75 <<
", new size: " << ev.new_width <<
" x " << ev.new_height
82 <<
". Char code: " << ev.char_code
83 <<
" modif: " << ev.key_modifiers << std::endl;
93 std::cout <<
"h/H was pressed!" << std::endl;
105 if (ev.key_modifiers == 8192)
107 std::cout <<
"Pressed C-c inside CDisplayWindow3D" 130 std::cout <<
"Window closed event received from: " << ev.
source_object 138 std::cout <<
"Mouse down event received from: " << ev.source_object
139 <<
"pt: " << ev.coords.x <<
"," << ev.coords.y <<
"\n";
155 "Press 'h' for help",
163 static const double TRANSP_ANIMATION_TIME_SEC = 0.5;
168 const double tranparency =
170 ? 1.0 -
std::min(1.0, hide_tim / TRANSP_ANIMATION_TIME_SEC)
171 :
std::min(1.0, show_tim / TRANSP_ANIMATION_TIME_SEC);
179 190, 190, 190, 200 * tranparency),
An event sent by a window upon resize.
double Tac() noexcept
Stops the stopwatch.
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates. ...
void OnEvent(const mrpt::system::mrptEvent &e) override
This virtual function will be called upon receive of any event after starting listening at any CObser...
mrpt::system::CTicTac m_tim_show_end
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.
std::string lowerCase(const std::string &str)
Returns an lower-case version of a string.
CBaseGUIWindow * source_object
An event sent by any CObservable object (automatically) just before being destroyed and telling its o...
An event sent by a window upon a char pressed by the user.
mrpt::system::CTicTac m_tim_show_start
CBaseGUIWindow * source_object
GLsizei const GLchar ** string
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::img::TColor &back_col=mrpt::img::TColor(0, 0, 50, 150), const mrpt::img::TColor &border_col=mrpt::img::TColor(0, 0, 0, 140), const mrpt::img::TColor &text_col=mrpt::img::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 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
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.