Create a GUI window and display plots with MATLAB-like interfaces and commands.
For a list of supported events with the observer/observable pattern, see the discussion in mrpt::gui::CBaseGUIWindow.
Definition at line 31 of file CDisplayWindowPlots.h.
#include <mrpt/gui/CDisplayWindowPlots.h>
Public Types | |
using | Ptr = std::shared_ptr< CDisplayWindowPlots > |
using | TCallbackMenu = void(*)(int menuID, float cursor_x, float cursor_y, void *userParam) |
Type for the callback function used in setMenuCallback. More... | |
Public Member Functions | |
CDisplayWindowPlots (const std::string &windowCaption=std::string(), unsigned int initialWidth=350, unsigned int initialHeight=300) | |
Constructor. More... | |
virtual | ~CDisplayWindowPlots () |
Destructor. More... | |
virtual bool | getLastMousePosition (int &x, int &y) const override |
Gets the last x,y pixel coordinates of the mouse. More... | |
virtual void | setCursorCross (bool cursorIsCross) override |
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true) More... | |
void | resize (unsigned int width, unsigned int height) override |
Resizes the window, stretching the image to fit into the display area. More... | |
void | setPos (int x, int y) override |
Changes the position of the window on the screen. More... | |
void | setWindowTitle (const std::string &str) override |
Changes the window title text. More... | |
void | enableMousePanZoom (bool enabled) |
Enable/disable the feature of pan/zoom with the mouse (default=enabled) More... | |
template<typename T1 , typename T2 > | |
void | plot (const std::vector< T1 > &x, const std::vector< T2 > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY")) |
Adds a new layer with a 2D plot based on two vectors of X and Y points, using a MATLAB-like syntax. More... | |
template<typename T1 , typename Derived2 > | |
void | plot (const std::vector< T1 > &x, const Eigen::MatrixBase< Derived2 > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY")) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<typename Derived1 , typename T2 > | |
void | plot (const Eigen::MatrixBase< Derived1 > &x, const std::vector< T2 > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY")) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<typename Derived1 , typename Derived2 > | |
void | plot (const Eigen::MatrixBase< Derived1 > &x, const Eigen::MatrixBase< Derived2 > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY")) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<typename T > | |
void | plot (const std::vector< T > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY")) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
template<typename Derived > | |
void | plot (const Eigen::MatrixBase< Derived > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY")) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | axis (float x_min, float x_max, float y_min, float y_max, bool aspectRatioFix=false) |
Set the view area according to the passed coordinated. More... | |
void | axis_equal (bool enable=true) |
Enable/disable the fixed X/Y aspect ratio fix feature (default=disabled). More... | |
void | axis_fit (bool aspectRatioFix=false) |
Fix automatically the view area according to existing graphs. More... | |
template<typename T > | |
void | plotEllipse (const T mean_x, const T mean_y, const mrpt::math::CMatrixTemplateNumeric< T > &cov22, const float quantiles, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotEllipse"), bool showName=false) |
Plots a 2D ellipse given its mean, covariance matrix, and Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the new values are used to update this existing layer (this also applies to using the default plot name). More... | |
template<typename T > | |
void | plotEllipse (const T mean_x, const T mean_y, const mrpt::math::CMatrixFixedNumeric< T, 2, 2 > &cov22, const float quantiles, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotEllipse"), bool showName=false) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | image (const mrpt::img::CImage &img, const float &x_left, const float &y_bottom, const float &x_width, const float &y_height, const std::string &plotName=std::string("image")) |
Adds a bitmap image layer. More... | |
void | clear () |
Remove all plot objects in the display. More... | |
void | clf () |
Remove all plot objects in the display (clear and clf do exactly the same). More... | |
void | hold_on () |
Enables keeping all the graphs, instead of overwritting them. More... | |
void | hold_off () |
Disables keeping all the graphs (this is the default behavior). More... | |
void | addPopupMenuEntry (const std::string &label, int menuID) |
Disables keeping all the graphs (this is the default behavior). More... | |
void | setMenuCallback (TCallbackMenu userFunction, void *userParam=nullptr) |
Must be called to have a callback when the user selects one of the user-defined entries in the popup menu. More... | |
void * | getWxObject () |
Read-only access to the wxDialog object. More... | |
void | notifyChildWindowDestruction () |
Called by wx main thread to set m_hwnd to NULL. More... | |
void | notifySemThreadReady () |
Called by wx main thread to signal the semaphore that the wx window is built and ready. More... | |
bool | isOpen () |
Returns false if the user has already closed the window. More... | |
int | waitForKey (bool ignoreControlKeys=true, mrptKeyModifier *out_pushModifier=nullptr) |
Waits for any key to be pushed on the image or the console, and returns the key code. More... | |
bool | keyHit () const |
Returns true if a key has been pushed, without blocking waiting for a new key being pushed. More... | |
void | clearKeyHitFlag () |
Assure that "keyHit" will return false until the next pushed key. More... | |
int | getPushedKey (mrptKeyModifier *out_pushModifier=nullptr) |
Returns the latest pushed key, or 0 if there is no new key stroke. More... | |
Static Public Member Functions | |
static CDisplayWindowPlots::Ptr | Create (const std::string &windowCaption, unsigned int initialWindowWidth=400, unsigned int initialWindowHeight=300) |
Class factory returning a smart pointer. More... | |
Protected Member Functions | |
void | internal_plot (mrpt::math::CVectorFloat &x, mrpt::math::CVectorFloat &y, const std::string &lineFormat, const std::string &plotName) |
template<typename VECTOR1 , typename VECTOR2 > | |
void | internal_plot_interface (const VECTOR1 &x, const VECTOR2 &y, const std::string &lineFormat, const std::string &plotName) |
template<typename VECTOR1 > | |
void | internal_plot_interface (const VECTOR1 &y, const std::string &lineFormat, const std::string &plotName) |
void | createWxWindow (unsigned int initialWidth, unsigned int initialHeight) |
Must be called by child classes just within the constructor. More... | |
void | destroyWxWindow () |
Must be called by child classes in their destructors. More... | |
void | publishEvent (const mrptEvent &e) const |
Called when you want this object to emit an event to all the observers currently subscribed to this object. More... | |
bool | hasSubscribers () const |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. More... | |
Protected Attributes | |
bool | m_holdon |
Whether hold_on is enabled. More... | |
bool | m_holdon_just_disabled |
uint32_t | m_holdon_cnt |
Counter for hold_on. More... | |
TCallbackMenu | m_callback |
void * | m_callback_param |
std::promise< void > | m_threadReady |
This semaphore will be signaled when the wx window is built and ready. More... | |
std::promise< void > | m_windowDestroyed |
This semaphore will be signaled when the wx window is destroyed. More... | |
std::string | m_caption |
The caption of the window. More... | |
mrpt::void_ptr_noncopy | m_hwnd |
The window handle. More... | |
volatile bool | m_keyPushed |
volatile int | m_keyPushedCode |
volatile mrptKeyModifier | m_keyPushedModifier |
Private Member Functions | |
void | internal_observer_begin (CObserver *) |
void | internal_observer_end (CObserver *) |
Private Attributes | |
const int | m_CMD_CREATE_WIN |
can be 200,300,400... More... | |
const int | m_CMD_DESTROY_WIN |
can be 299,399,499... More... | |
void * | m_winobj_voidptr |
std::set< CObserver * > | m_subscribers |
Friends | |
class | CWindowDialogPlots |
using mrpt::gui::CDisplayWindowPlots::Ptr = std::shared_ptr<CDisplayWindowPlots> |
Definition at line 34 of file CDisplayWindowPlots.h.
using mrpt::gui::CDisplayWindowPlots::TCallbackMenu = void (*)(int menuID, float cursor_x, float cursor_y, void* userParam) |
Type for the callback function used in setMenuCallback.
Definition at line 38 of file CDisplayWindowPlots.h.
CDisplayWindowPlots::CDisplayWindowPlots | ( | const std::string & | windowCaption = std::string() , |
unsigned int | initialWidth = 350 , |
||
unsigned int | initialHeight = 300 |
||
) |
Constructor.
Definition at line 686 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::createWxWindow().
|
virtual |
Destructor.
Definition at line 702 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::destroyWxWindow().
void CDisplayWindowPlots::addPopupMenuEntry | ( | const std::string & | label, |
int | menuID | ||
) |
Disables keeping all the graphs (this is the default behavior).
label | The text that appears in the new popup menu item. |
menuID | Any positive number (0,1,..). Used to tell which menu was selected in the user callback. |
Definition at line 1195 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::isOpen(), MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::TRequestToWxMainThread::plotName, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::x.
void CDisplayWindowPlots::axis | ( | float | x_min, |
float | x_max, | ||
float | y_min, | ||
float | y_max, | ||
bool | aspectRatioFix = false |
||
) |
Set the view area according to the passed coordinated.
Definition at line 861 of file CDisplayWindowPlots.cpp.
References mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal, mrpt::gui::CBaseGUIWindow::isOpen(), MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_y.
void CDisplayWindowPlots::axis_equal | ( | bool | enable = true | ) |
Enable/disable the fixed X/Y aspect ratio fix feature (default=disabled).
Definition at line 841 of file CDisplayWindowPlots.cpp.
References mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal, mrpt::gui::CBaseGUIWindow::isOpen(), MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), and mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots.
void CDisplayWindowPlots::axis_fit | ( | bool | aspectRatioFix = false | ) |
Fix automatically the view area according to existing graphs.
Definition at line 892 of file CDisplayWindowPlots.cpp.
References mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal, mrpt::gui::CBaseGUIWindow::isOpen(), MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), and mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots.
void CDisplayWindowPlots::clear | ( | ) |
Remove all plot objects in the display.
Definition at line 1157 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::isOpen(), MRPT_END, MRPT_START, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), and mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots.
Referenced by clf().
|
inlineinherited |
Assure that "keyHit" will return false until the next pushed key.
Definition at line 145 of file CBaseGUIWindow.h.
References mrpt::gui::CBaseGUIWindow::m_keyPushed.
|
inline |
Remove all plot objects in the display (clear and clf do exactly the same).
Definition at line 281 of file CDisplayWindowPlots.h.
References clear().
Referenced by image(), internal_plot(), and plotEllipse().
|
static |
Class factory returning a smart pointer.
Definition at line 675 of file CDisplayWindowPlots.cpp.
|
protectedinherited |
Must be called by child classes just within the constructor.
Definition at line 42 of file CBaseGUIWindow.cpp.
References mrpt::gui::WxSubsystem::createOneInstanceMainThread(), mrpt::non_copiable_ptr_basic< T >::getPtrToPtr(), mrpt::gui::WxSubsystem::isConsoleApp(), mrpt::gui::CBaseGUIWindow::m_caption, mrpt::gui::CBaseGUIWindow::m_CMD_CREATE_WIN, mrpt::gui::CBaseGUIWindow::m_hwnd, mrpt::gui::CBaseGUIWindow::m_threadReady, mrpt::gui::CBaseGUIWindow::m_winobj_voidptr, MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::source2D, mrpt::gui::WxSubsystem::TRequestToWxMainThread::source3D, mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::str, THROW_EXCEPTION, mrpt::gui::WxSubsystem::TRequestToWxMainThread::voidPtr, mrpt::gui::WxSubsystem::TRequestToWxMainThread::x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::y.
Referenced by mrpt::gui::CDisplayWindow::CDisplayWindow(), mrpt::gui::CDisplayWindow3D::CDisplayWindow3D(), and CDisplayWindowPlots().
|
protectedinherited |
Must be called by child classes in their destructors.
The code cannot be put into this class' destructor.
Definition at line 105 of file CBaseGUIWindow.cpp.
References mrpt::non_copiable_ptr_basic< T >::get(), mrpt::gui::WxSubsystem::isConsoleApp(), mrpt::gui::CBaseGUIWindow::m_CMD_DESTROY_WIN, mrpt::gui::CBaseGUIWindow::m_hwnd, mrpt::gui::CBaseGUIWindow::m_windowDestroyed, mrpt::gui::CBaseGUIWindow::m_winobj_voidptr, MRPT_END, MRPT_START, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::source2D, mrpt::gui::WxSubsystem::TRequestToWxMainThread::source3D, mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, and mrpt::gui::WxSubsystem::waitWxShutdownsIfNoWindows().
Referenced by mrpt::gui::CDisplayWindow::~CDisplayWindow(), mrpt::gui::CDisplayWindow3D::~CDisplayWindow3D(), and ~CDisplayWindowPlots().
void CDisplayWindowPlots::enableMousePanZoom | ( | bool | enabled | ) |
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition at line 821 of file CDisplayWindowPlots.cpp.
References mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal, mrpt::gui::CBaseGUIWindow::isOpen(), MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), and mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots.
|
overridevirtual |
Gets the last x,y pixel coordinates of the mouse.
Implements mrpt::gui::CBaseGUIWindow.
Definition at line 724 of file CDisplayWindowPlots.cpp.
References mrpt::non_copiable_ptr_basic< T >::get(), mrpt::gui::CBaseGUIWindow::m_hwnd, MRPT_UNUSED_PARAM, and win.
|
inherited |
Returns the latest pushed key, or 0 if there is no new key stroke.
out_pushModifier | If set to !=nullptr, the modifiers of the key stroke will be saved here. |
Definition at line 190 of file CBaseGUIWindow.cpp.
References mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::gui::CBaseGUIWindow::m_keyPushed, mrpt::gui::CBaseGUIWindow::m_keyPushedCode, mrpt::gui::CBaseGUIWindow::m_keyPushedModifier, and mrpt::gui::MRPTKMOD_NONE.
|
inlineinherited |
Read-only access to the wxDialog object.
Definition at line 79 of file CBaseGUIWindow.h.
References mrpt::non_copiable_ptr_basic< T >::get(), and mrpt::gui::CBaseGUIWindow::m_hwnd.
Referenced by mrpt::gui::WxSubsystem::CWXMainFrame::OnTimerProcessRequests().
|
inlineprotectedinherited |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
Definition at line 55 of file CObservable.h.
References mrpt::system::CObservable::m_subscribers.
Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().
void CDisplayWindowPlots::hold_off | ( | ) |
Disables keeping all the graphs (this is the default behavior).
Definition at line 1183 of file CDisplayWindowPlots.cpp.
References m_holdon, and m_holdon_just_disabled.
void CDisplayWindowPlots::hold_on | ( | ) |
Enables keeping all the graphs, instead of overwritting them.
Definition at line 1179 of file CDisplayWindowPlots.cpp.
References m_holdon.
void CDisplayWindowPlots::image | ( | const mrpt::img::CImage & | img, |
const float & | x_left, | ||
const float & | y_bottom, | ||
const float & | x_width, | ||
const float & | y_height, | ||
const std::string & | plotName = std::string("image") |
||
) |
Adds a bitmap image layer.
Each call to this function creates a new layer, unless the plot name coincides with an already existing plot: in this case the new values are used to update this existing layer (this also applies to using the default plot name).
Definition at line 1059 of file CDisplayWindowPlots.cpp.
References clf(), mrpt::format(), mrpt::gui::CBaseGUIWindow::isOpen(), m_holdon, m_holdon_cnt, m_holdon_just_disabled, MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, mrpt::gui::MRPTImage2wxImage(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::TRequestToWxMainThread::plotName, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::voidPtr2.
Definition at line 29 of file CObservable.cpp.
Definition at line 34 of file CObservable.cpp.
References ASSERTMSG_, MRPT_END, and MRPT_START.
|
protected |
Definition at line 1111 of file CDisplayWindowPlots.cpp.
References ASSERT_EQUAL_, clf(), mrpt::format(), mrpt::gui::CBaseGUIWindow::isOpen(), m_holdon, m_holdon_cnt, m_holdon_just_disabled, MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::TRequestToWxMainThread::plotName, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::str, mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_y.
Referenced by internal_plot_interface().
|
inlineprotected |
Definition at line 55 of file CDisplayWindowPlots.h.
References internal_plot().
Referenced by plot().
|
inlineprotected |
Definition at line 67 of file CDisplayWindowPlots.h.
References internal_plot().
|
inherited |
Returns false if the user has already closed the window.
Definition at line 213 of file CBaseGUIWindow.cpp.
References mrpt::gui::CBaseGUIWindow::m_hwnd.
Referenced by addPopupMenuEntry(), axis(), axis_equal(), axis_fit(), clear(), mrpt::math::CMonteCarlo< T, NUM, OTHER >::doExperiment(), enableMousePanZoom(), mrpt::gui::CBaseGUIWindow::getPushedKey(), image(), internal_plot(), mrpt::graphslam::CWindowManager::isOpen(), plotEllipse(), resize(), mrpt::gui::CDisplayWindow3D::resize(), mrpt::gui::CDisplayWindow::resize(), setPos(), mrpt::gui::CDisplayWindow3D::setPos(), mrpt::gui::CDisplayWindow::setPos(), setWindowTitle(), mrpt::gui::CDisplayWindow3D::setWindowTitle(), mrpt::gui::CDisplayWindow::setWindowTitle(), mrpt::gui::CBaseGUIWindow::waitForKey(), and CGraphSlamHandler< GRAPH_T >::~CGraphSlamHandler().
|
inlineinherited |
Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
Definition at line 141 of file CBaseGUIWindow.h.
References mrpt::gui::CBaseGUIWindow::m_keyPushed.
|
inherited |
Called by wx main thread to set m_hwnd to NULL.
Definition at line 152 of file CBaseGUIWindow.cpp.
References mrpt::gui::CBaseGUIWindow::m_hwnd.
Referenced by mrpt::gui::CWindowDialog::OnClose(), and mrpt::gui::C3DWindowDialog::OnClose().
|
inherited |
Called by wx main thread to signal the semaphore that the wx window is built and ready.
Definition at line 217 of file CBaseGUIWindow.cpp.
References mrpt::gui::CBaseGUIWindow::m_threadReady.
Referenced by mrpt::gui::WxSubsystem::CWXMainFrame::OnTimerProcessRequests().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 201 of file CDisplayWindowPlots.h.
References internal_plot_interface().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 181 of file CDisplayWindowPlots.h.
References internal_plot_interface().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 172 of file CDisplayWindowPlots.h.
References internal_plot_interface().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 192 of file CDisplayWindowPlots.h.
References internal_plot_interface().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 163 of file CDisplayWindowPlots.h.
References internal_plot_interface().
|
inline |
Adds a new layer with a 2D plot based on two vectors of X and Y points, using a MATLAB-like syntax.
Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the X & Y points are used to update this existing layer (this also applies to using the default plot name). If "hold_on" is enabled, then every call will always create a new plot, even if no "plotName" is provided.
The lineFormat string is a combination of the following characters:
Line width:
Examples:
VECTOR | Can be std::vector<float/double> or mrpt::dynamicsize_vector<float/double> or a column/row Eigen::Matrix<> |
Definition at line 154 of file CDisplayWindowPlots.h.
References internal_plot_interface().
Referenced by mrpt::math::CMonteCarlo< T, NUM, OTHER >::doExperiment().
void CDisplayWindowPlots::plotEllipse | ( | const T | mean_x, |
const T | mean_y, | ||
const mrpt::math::CMatrixFixedNumeric< T, 2, 2 > & | cov22, | ||
const float | quantiles, | ||
const std::string & | lineFormat = std::string("b-") , |
||
const std::string & | plotName = std::string("plotEllipse") , |
||
bool | showName = false |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 987 of file CDisplayWindowPlots.cpp.
References ASSERT_, mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal, clf(), mrpt::format(), mrpt::gui::CBaseGUIWindow::isOpen(), m_holdon, m_holdon_cnt, m_holdon_just_disabled, MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::TRequestToWxMainThread::plotName, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::str, mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_y.
void CDisplayWindowPlots::plotEllipse | ( | const T | mean_x, |
const T | mean_y, | ||
const mrpt::math::CMatrixTemplateNumeric< T > & | cov22, | ||
const float | quantiles, | ||
const std::string & | lineFormat = std::string("b-") , |
||
const std::string & | plotName = std::string("plotEllipse") , |
||
bool | showName = false |
||
) |
Plots a 2D ellipse given its mean, covariance matrix, and Each call to this function creates a new plot, unless the plot name coincides with an already existing plot: in this case the new values are used to update this existing layer (this also applies to using the default plot name).
If "hold_on" is enabled, then every call will always create a new plot, even if no "plotName" is provided.
For a description of lineFormat see CDisplayWindowPlots::plot. The "quantiles" value determines the confidence interval for the ellipse:
Definition at line 913 of file CDisplayWindowPlots.cpp.
References ASSERT_, mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal, clf(), mrpt::format(), mrpt::gui::CBaseGUIWindow::isOpen(), m_holdon, m_holdon_cnt, m_holdon_just_disabled, MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::TRequestToWxMainThread::plotName, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::str, mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_y.
Called when you want this object to emit an event to all the observers currently subscribed to this object.
Definition at line 48 of file CObservable.cpp.
References MRPT_END, and MRPT_START.
Referenced by mrpt::gui::CDisplayWindow3D::internal_emitGrabImageEvent(), mrpt::gui::CWindowDialog::OnChar(), mrpt::gui::CWindowDialog::OnClose(), mrpt::gui::C3DWindowDialog::OnClose(), mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), mrpt::gui::C3DWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().
|
overridevirtual |
Resizes the window, stretching the image to fit into the display area.
Implements mrpt::gui::CBaseGUIWindow.
Definition at line 742 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::gui::CBaseGUIWindow::m_caption, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::y.
|
overridevirtual |
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
Implements mrpt::gui::CBaseGUIWindow.
Definition at line 709 of file CDisplayWindowPlots.cpp.
References mrpt::non_copiable_ptr_basic< T >::get(), mrpt::gui::CBaseGUIWindow::m_hwnd, MRPT_UNUSED_PARAM, and win.
void CDisplayWindowPlots::setMenuCallback | ( | TCallbackMenu | userFunction, |
void * | userParam = nullptr |
||
) |
Must be called to have a callback when the user selects one of the user-defined entries in the popup menu.
Definition at line 1221 of file CDisplayWindowPlots.cpp.
References ASSERT_, m_callback, and m_callback_param.
|
overridevirtual |
Changes the position of the window on the screen.
Implements mrpt::gui::CBaseGUIWindow.
Definition at line 769 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::gui::CBaseGUIWindow::m_caption, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, mrpt::gui::WxSubsystem::TRequestToWxMainThread::x, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::y.
|
overridevirtual |
Changes the window title text.
Implements mrpt::gui::CBaseGUIWindow.
Definition at line 796 of file CDisplayWindowPlots.cpp.
References mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::gui::CBaseGUIWindow::m_caption, MRPT_UNUSED_PARAM, mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE, mrpt::gui::WxSubsystem::pushPendingWxRequest(), mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots, and mrpt::gui::WxSubsystem::TRequestToWxMainThread::str.
|
inherited |
Waits for any key to be pushed on the image or the console, and returns the key code.
This method remove key strokes previous to its call, so it will always wait. To get the latest pushed key, see
ignoreControlKeys | If set to false, any push of shift, cmd, control, etc... will make this method to return. |
out_pushModifier | If set to !=nullptr, the modifiers of the key stroke will be saved here. |
Definition at line 156 of file CBaseGUIWindow.cpp.
References mrpt::system::os::getch(), mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::system::os::kbhit(), mrpt::gui::CBaseGUIWindow::m_keyPushed, mrpt::gui::CBaseGUIWindow::m_keyPushedCode, mrpt::gui::CBaseGUIWindow::m_keyPushedModifier, and mrpt::gui::MRPTKMOD_NONE.
|
friend |
Definition at line 41 of file CDisplayWindowPlots.h.
|
protected |
Definition at line 48 of file CDisplayWindowPlots.h.
Referenced by setMenuCallback().
|
protected |
Definition at line 49 of file CDisplayWindowPlots.h.
Referenced by setMenuCallback().
|
protectedinherited |
The caption of the window.
Definition at line 62 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::createWxWindow(), resize(), mrpt::gui::CDisplayWindow3D::resize(), mrpt::gui::CDisplayWindow::resize(), setPos(), mrpt::gui::CDisplayWindow3D::setPos(), mrpt::gui::CDisplayWindow::setPos(), setWindowTitle(), mrpt::gui::CDisplayWindow3D::setWindowTitle(), and mrpt::gui::CDisplayWindow::setWindowTitle().
|
privateinherited |
can be 200,300,400...
See WxSubsystem
Definition at line 50 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::createWxWindow().
|
privateinherited |
can be 299,399,499...
See WxSubsystem
Definition at line 52 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::destroyWxWindow().
|
protected |
Whether hold_on is enabled.
Definition at line 44 of file CDisplayWindowPlots.h.
Referenced by hold_off(), hold_on(), image(), internal_plot(), and plotEllipse().
|
protected |
Counter for hold_on.
Definition at line 47 of file CDisplayWindowPlots.h.
Referenced by image(), internal_plot(), and plotEllipse().
|
protected |
Definition at line 45 of file CDisplayWindowPlots.h.
Referenced by hold_off(), image(), internal_plot(), and plotEllipse().
|
protectedinherited |
The window handle.
Definition at line 64 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CDisplayWindow3D::addTextMessage(), mrpt::gui::CDisplayWindow3D::clearTextMessages(), mrpt::gui::CBaseGUIWindow::createWxWindow(), mrpt::gui::CBaseGUIWindow::destroyWxWindow(), mrpt::gui::CDisplayWindow3D::forceRepaint(), mrpt::gui::CDisplayWindow3D::getCameraAzimuthDeg(), mrpt::gui::CDisplayWindow3D::getCameraElevationDeg(), mrpt::gui::CDisplayWindow3D::getCameraPointingToPoint(), mrpt::gui::CDisplayWindow3D::getCameraZoom(), mrpt::gui::CDisplayWindow3D::getFOV(), mrpt::gui::CDisplayWindow::getLastMousePosition(), getLastMousePosition(), mrpt::gui::CDisplayWindow3D::getLastMousePosition(), mrpt::gui::CBaseGUIWindow::getWxObject(), mrpt::gui::CDisplayWindow3D::isCameraProjective(), mrpt::gui::CBaseGUIWindow::isOpen(), mrpt::gui::CBaseGUIWindow::notifyChildWindowDestruction(), mrpt::gui::CDisplayWindow3D::setCameraAzimuthDeg(), mrpt::gui::CDisplayWindow3D::setCameraElevationDeg(), mrpt::gui::CDisplayWindow3D::setCameraPointingToPoint(), mrpt::gui::CDisplayWindow3D::setCameraProjective(), mrpt::gui::CDisplayWindow3D::setCameraZoom(), mrpt::gui::CDisplayWindow::setCursorCross(), setCursorCross(), mrpt::gui::CDisplayWindow3D::setCursorCross(), mrpt::gui::CDisplayWindow3D::setFOV(), mrpt::gui::CDisplayWindow::showImage(), and mrpt::gui::CDisplayWindow3D::useCameraFromScene().
|
protectedinherited |
Definition at line 67 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::clearKeyHitFlag(), mrpt::gui::CBaseGUIWindow::getPushedKey(), mrpt::gui::CBaseGUIWindow::keyHit(), mrpt::gui::CWindowDialog::OnChar(), and mrpt::gui::CBaseGUIWindow::waitForKey().
|
protectedinherited |
Definition at line 68 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::getPushedKey(), mrpt::gui::CWindowDialog::OnChar(), and mrpt::gui::CBaseGUIWindow::waitForKey().
|
protectedinherited |
Definition at line 69 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::getPushedKey(), mrpt::gui::CWindowDialog::OnChar(), and mrpt::gui::CBaseGUIWindow::waitForKey().
|
privateinherited |
Definition at line 42 of file CObservable.h.
Referenced by mrpt::system::CObservable::hasSubscribers().
|
mutableprotectedinherited |
This semaphore will be signaled when the wx window is built and ready.
Definition at line 58 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::createWxWindow(), and mrpt::gui::CBaseGUIWindow::notifySemThreadReady().
|
mutableprotectedinherited |
This semaphore will be signaled when the wx window is destroyed.
Definition at line 60 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::destroyWxWindow(), mrpt::gui::CWindowDialog::OnClose(), and mrpt::gui::C3DWindowDialog::OnClose().
|
privateinherited |
Definition at line 53 of file CBaseGUIWindow.h.
Referenced by mrpt::gui::CBaseGUIWindow::createWxWindow(), and mrpt::gui::CBaseGUIWindow::destroyWxWindow().
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 |