Go to the documentation of this file.
22 #include <mrpt/examples_config.h>
24 MRPT_EXAMPLES_BASE_DIRECTORY +
string(
"img_basic_example/frame_color.jpg"));
32 cout <<
"[MyObserver] Event received: mrptEventOnDestroy\n";
37 cout <<
"[MyObserver] Resize event received from: "
45 cout <<
"[MyObserver] Char event received from: "
53 cout <<
"[MyObserver] Window closed event received from: "
60 cout <<
"[MyObserver] Mouse down event received from: "
65 cout <<
"[MyObserver] Event received: Another mrptEvent \n";
80 img.filledRectangle(0, 0, 300, 300,
TColor(0, 0, 255));
81 img.textOut(50, 50,
"Hello world!",
TColor(255, 255, 255));
89 scene->insert(mrpt::make_aligned_shared<mrpt::opengl::CGridPlaneXY>());
90 win3D.unlockAccess3DScene();
98 win3D.setPos(340, 10);
99 winPlot.setPos(10, 340);
106 cout <<
"Waiting for window events...\n";
107 cout <<
"** Close any window to end the program **\n";
109 while (win2D.isOpen() && win3D.isOpen() && winPlot.isOpen())
111 std::this_thread::sleep_for(100ms);
125 catch (std::exception& e)
127 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
132 printf(
"Untyped exception!!");
The basic event type for the observer-observable pattern in MRPT.
CBaseGUIWindow * source_object
void observeBegin(CObservable &obj)
Starts the subscription of this observer to the given object.
An event sent by a window upon a char pressed by the user.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
string myExampleImage(MRPT_EXAMPLES_BASE_DIRECTORY+string("img_basic_example/frame_color.jpg"))
An event sent by a window upon resize.
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.
void TestGuiWindowsEvents()
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...
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
int char_code
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes).
Classes for creating GUI windows for 2D and 3D visualization.
A class for storing images as grayscale or RGB bitmaps.
Create a GUI window and display plots with MATLAB-like interfaces and commands.
Inherit from this class to get notified about events from any CObservable object after subscribing to...
mrpt::img::TPixelCoord coords
This base provides a set of functions for maths stuff.
std::shared_ptr< COpenGLScene > Ptr
An event sent by a window upon when it's about to be closed, either manually by the user or programma...
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
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 | |