Go to the documentation of this file.
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";
35 std::cout <<
"WindowObserver initialized." << std::endl;
39 std::map<std::string, bool>* codes_to_pressed,
40 bool reset_keypresses )
51 map_it->second =
false;
72 std::cout <<
"Event received: mrptEventOnDestroy" << std::endl;
78 std::cout <<
"Resize event received from: " << ev.
source_object
98 std::cout <<
"h/H was pressed!" << std::endl;
112 std::cout <<
"Pressed C-c inside CDisplayWindow3D"
135 std::cout <<
"Window closed event received from: " << ev.
source_object
144 std::cout <<
"Mouse down event received from: " << ev.
source_object
161 "Press 'h' for help",
169 static const double TRANSP_ANIMATION_TIME_SEC = 0.5;
174 const double tranparency =
176 ? 1.0 -
std::min(1.0, hide_tim / TRANSP_ANIMATION_TIME_SEC)
177 :
std::min(1.0, show_tim / TRANSP_ANIMATION_TIME_SEC);
185 190, 190, 190, 200 * tranparency),
The basic event type for the observer-observable pattern in MRPT.
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...
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...
@ NICE
renders glyphs filled with antialiased outlines
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...
mrpt::system::CTicTac m_tim_show_start
CBaseGUIWindow * source_object
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
An event sent by a window upon a char pressed by the user.
void OnEvent(const mrpt::system::mrptEvent &e)
This virtual function will be called upon receive of any event after starting listening at any CObser...
An event sent by a window upon resize.
std::string lowerCase(const std::string &str)
Returns an lower-case version of a string.
void registerKeystroke(const std::string key_str, const std::string key_desc)
Make new keystrokes available in the help message box.
double Tac() noexcept
Stops the stopwatch.
SLAM methods related to graphs of pose constraints.
mrpt::system::CTicTac m_tim_show_end
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.
CBaseGUIWindow * source_object
CBaseGUIWindow * source_object
mrptKeyModifier key_modifiers
Modifiers (Shift, Control, etc...)
An event sent by any CObservable object (automatically) just before being destroyed and telling its o...
int char_code
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes).
std::string upperCase(const std::string &str)
Returns a upper-case version of a string.
mrpt::img::TPixelCoord coords
GLsizei const GLchar ** string
An event sent by a window upon when it's about to be closed, either manually by the user or programma...
CBaseGUIWindow * source_object
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 | |