Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
mrpt::gui::CDisplayWindowPlots Class Reference

Detailed Description

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.

See CDisplayWindowPlots::plot

Definition at line 31 of file CDisplayWindowPlots.h.

#include <mrpt/gui/CDisplayWindowPlots.h>

Inheritance diagram for mrpt::gui::CDisplayWindowPlots:
Inheritance graph

Public Types

using Ptr = std::shared_ptr< CDisplayWindowPlots >
 
typedef void(* TCallbackMenu) (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"))
 
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"))
 
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"))
 
template<typename T >
void plot (const std::vector< T > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
 
template<typename Derived >
void plot (const Eigen::MatrixBase< Derived > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
 
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)
 
void image (const utils::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...
 
voidgetWxObject ()
 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
 
voidm_callback_param
 
std::promise< voidm_threadReady
 This semaphore will be signaled when the wx window is built and ready. More...
 
std::promise< voidm_windowDestroyed
 This semaphore will be signaled when the wx window is destroyed. More...
 
std::string m_caption
 The caption of the window. More...
 
mrpt::utils::void_ptr_noncopy m_hwnd
 The window handle. More...
 
volatile bool m_keyPushed
 
volatile int m_keyPushedCode
 
volatile mrptKeyModifier m_keyPushedModifier
 

Friends

class CWindowDialogPlots
 

Member Typedef Documentation

◆ Ptr

Definition at line 34 of file CDisplayWindowPlots.h.

◆ TCallbackMenu

typedef void(* mrpt::gui::CDisplayWindowPlots::TCallbackMenu) (int menuID, float cursor_x, float cursor_y, void *userParam)

Type for the callback function used in setMenuCallback.

Definition at line 37 of file CDisplayWindowPlots.h.

Constructor & Destructor Documentation

◆ CDisplayWindowPlots()

CDisplayWindowPlots::CDisplayWindowPlots ( const std::string windowCaption = std::string(),
unsigned int  initialWidth = 350,
unsigned int  initialHeight = 300 
)

Constructor.

Definition at line 685 of file CDisplayWindowPlots.cpp.

References mrpt::gui::CBaseGUIWindow::createWxWindow().

Here is the call graph for this function:

◆ ~CDisplayWindowPlots()

CDisplayWindowPlots::~CDisplayWindowPlots ( )
virtual

Destructor.

Definition at line 701 of file CDisplayWindowPlots.cpp.

References mrpt::gui::CBaseGUIWindow::destroyWxWindow().

Here is the call graph for this function:

Member Function Documentation

◆ addPopupMenuEntry()

void CDisplayWindowPlots::addPopupMenuEntry ( const std::string label,
int  menuID 
)

Disables keeping all the graphs (this is the default behavior).

Parameters
labelThe text that appears in the new popup menu item.
menuIDAny positive number (0,1,..). Used to tell which menu was selected in the user callback.
See also
setMenuCallback

Definition at line 1194 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.

Here is the call graph for this function:

◆ axis()

void CDisplayWindowPlots::axis ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
bool  aspectRatioFix = false 
)

◆ axis_equal()

void CDisplayWindowPlots::axis_equal ( bool  enable = true)

◆ axis_fit()

void CDisplayWindowPlots::axis_fit ( bool  aspectRatioFix = false)

◆ clear()

void CDisplayWindowPlots::clear ( )

Remove all plot objects in the display.

See also
plot

Definition at line 1156 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearKeyHitFlag()

void mrpt::gui::CBaseGUIWindow::clearKeyHitFlag ( )
inlineinherited

Assure that "keyHit" will return false until the next pushed key.

See also
keyHit, waitForKey

Definition at line 147 of file CBaseGUIWindow.h.

References mrpt::gui::CBaseGUIWindow::m_keyPushed.

◆ clf()

void mrpt::gui::CDisplayWindowPlots::clf ( )
inline

Remove all plot objects in the display (clear and clf do exactly the same).

See also
plot, hold_on, hold_off

Definition at line 281 of file CDisplayWindowPlots.h.

References clear().

Referenced by image(), internal_plot(), and plotEllipse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create()

CDisplayWindowPlots::Ptr CDisplayWindowPlots::Create ( const std::string windowCaption,
unsigned int  initialWindowWidth = 400,
unsigned int  initialWindowHeight = 300 
)
static

Class factory returning a smart pointer.

Definition at line 674 of file CDisplayWindowPlots.cpp.

◆ createWxWindow()

void CBaseGUIWindow::createWxWindow ( unsigned int  initialWidth,
unsigned int  initialHeight 
)
protectedinherited

◆ destroyWxWindow()

void CBaseGUIWindow::destroyWxWindow ( )
protectedinherited

◆ enableMousePanZoom()

void CDisplayWindowPlots::enableMousePanZoom ( bool  enabled)

◆ getLastMousePosition()

bool CDisplayWindowPlots::getLastMousePosition ( int &  x,
int &  y 
) const
overridevirtual

Gets the last x,y pixel coordinates of the mouse.

Returns
False if the window is closed.

Implements mrpt::gui::CBaseGUIWindow.

Definition at line 723 of file CDisplayWindowPlots.cpp.

References mrpt::utils::non_copiable_ptr_basic< T >::get(), mrpt::gui::CBaseGUIWindow::m_hwnd, mrpt::gui::CWindowDialogPlots::m_last_mouse_point, and MRPT_UNUSED_PARAM.

Here is the call graph for this function:

◆ getPushedKey()

int CBaseGUIWindow::getPushedKey ( mrptKeyModifier out_pushModifier = nullptr)
inherited

Returns the latest pushed key, or 0 if there is no new key stroke.

Parameters
out_pushModifierIf set to !=nullptr, the modifiers of the key stroke will be saved here.
Returns
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes).
See also
keyHit, waitForKey

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.

Here is the call graph for this function:

◆ getWxObject()

void* mrpt::gui::CBaseGUIWindow::getWxObject ( )
inlineinherited

Read-only access to the wxDialog object.

Definition at line 81 of file CBaseGUIWindow.h.

References mrpt::utils::non_copiable_ptr_basic< T >::get(), and mrpt::gui::CBaseGUIWindow::m_hwnd.

Referenced by mrpt::gui::WxSubsystem::CWXMainFrame::OnTimerProcessRequests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasSubscribers()

bool mrpt::utils::CObservable::hasSubscribers ( ) const
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 57 of file CObservable.h.

References mrpt::utils::CObservable::m_subscribers.

Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().

Here is the caller graph for this function:

◆ hold_off()

void CDisplayWindowPlots::hold_off ( )

Disables keeping all the graphs (this is the default behavior).

See also
hold_on, plot

Definition at line 1182 of file CDisplayWindowPlots.cpp.

References m_holdon, and m_holdon_just_disabled.

◆ hold_on()

void CDisplayWindowPlots::hold_on ( )

Enables keeping all the graphs, instead of overwritting them.

See also
hold_off, plot

Definition at line 1178 of file CDisplayWindowPlots.cpp.

References m_holdon.

◆ image()

void CDisplayWindowPlots::image ( const utils::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).

See also
axis, axis_equal, axis_fit, hold_on, hold_off

Definition at line 1058 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.

Referenced by mrpt::vision::CFeature::internal_distanceBetweenPolarImages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_plot()

void CDisplayWindowPlots::internal_plot ( mrpt::math::CVectorFloat x,
mrpt::math::CVectorFloat y,
const std::string lineFormat,
const std::string plotName 
)
protected

◆ internal_plot_interface() [1/2]

template<typename VECTOR1 , typename VECTOR2 >
void mrpt::gui::CDisplayWindowPlots::internal_plot_interface ( const VECTOR1 &  x,
const VECTOR2 &  y,
const std::string lineFormat,
const std::string plotName 
)
inlineprotected

Definition at line 55 of file CDisplayWindowPlots.h.

References internal_plot().

Referenced by plot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_plot_interface() [2/2]

template<typename VECTOR1 >
void mrpt::gui::CDisplayWindowPlots::internal_plot_interface ( const VECTOR1 &  y,
const std::string lineFormat,
const std::string plotName 
)
inlineprotected

Definition at line 67 of file CDisplayWindowPlots.h.

References internal_plot().

Here is the call graph for this function:

◆ isOpen()

bool CBaseGUIWindow::isOpen ( )
inherited

◆ keyHit()

bool mrpt::gui::CBaseGUIWindow::keyHit ( ) const
inlineinherited

Returns true if a key has been pushed, without blocking waiting for a new key being pushed.

See also
waitForKey, clearKeyHitFlag

Definition at line 143 of file CBaseGUIWindow.h.

References mrpt::gui::CBaseGUIWindow::m_keyPushed.

◆ notifyChildWindowDestruction()

void CBaseGUIWindow::notifyChildWindowDestruction ( )
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().

Here is the caller graph for this function:

◆ notifySemThreadReady()

void CBaseGUIWindow::notifySemThreadReady ( )
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().

Here is the caller graph for this function:

◆ plot() [1/6]

template<typename T1 , typename T2 >
void mrpt::gui::CDisplayWindowPlots::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") 
)
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 styles:
    • '.': One point for each data point
    • '-': A continuous line
    • ':': A dashed line
  • Colors:
    • k: black
    • r: red
    • g: green
    • b: blue
    • m: magenta
    • c: cyan
  • Line width:

    • '1' to '9': The line width (default=1)

    Examples:

    • 'r.' -> red points.
    • 'k3' or 'k-3' -> A black line with a line width of 3 pixels.
      Note
      The vectors x & y can be of types: float or double.
      See also
      axis, axis_equal, axis_fit, clear, hold_on, hold_off
      Template Parameters
      VECTORCan 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(), and mrpt::vision::CFeature::internal_distanceBetweenPolarImages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plot() [2/6]

template<typename T1 , typename Derived2 >
void mrpt::gui::CDisplayWindowPlots::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") 
)
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().

Here is the call graph for this function:

◆ plot() [3/6]

template<typename Derived1 , typename T2 >
void mrpt::gui::CDisplayWindowPlots::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") 
)
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().

Here is the call graph for this function:

◆ plot() [4/6]

template<typename Derived1 , typename Derived2 >
void mrpt::gui::CDisplayWindowPlots::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") 
)
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().

Here is the call graph for this function:

◆ plot() [5/6]

template<typename T >
void mrpt::gui::CDisplayWindowPlots::plot ( const std::vector< T > &  y,
const std::string lineFormat = std::string("b-"),
const std::string plotName = std::string("plotXY") 
)
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().

Here is the call graph for this function:

◆ plot() [6/6]

template<typename Derived >
void mrpt::gui::CDisplayWindowPlots::plot ( const Eigen::MatrixBase< Derived > &  y,
const std::string lineFormat = std::string("b-"),
const std::string plotName = std::string("plotXY") 
)
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().

Here is the call graph for this function:

◆ plotEllipse() [1/2]

template<typename T >
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:

  • 1 : 68.27% confidence interval
  • 2 : 95.45%
  • 3 : 99.73%
  • 4 : 99.994%
    Note
    This method can be called with 2x2 fixed-sized or dynamic-size matrices of types: float or double.
    See also
    axis, axis_equal, axis_fit, hold_on, hold_off

Definition at line 912 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.

Here is the call graph for this function:

◆ plotEllipse() [2/2]

template<typename T >
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 
)

◆ publishEvent()

void CObservable::publishEvent ( const mrptEvent e) const
protectedinherited

◆ resize()

void CDisplayWindowPlots::resize ( unsigned int  width,
unsigned int  height 
)
overridevirtual

◆ setCursorCross()

void CDisplayWindowPlots::setCursorCross ( bool  cursorIsCross)
overridevirtual

Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)

Implements mrpt::gui::CBaseGUIWindow.

Definition at line 708 of file CDisplayWindowPlots.cpp.

References mrpt::utils::non_copiable_ptr_basic< T >::get(), mrpt::gui::CBaseGUIWindow::m_hwnd, mrpt::gui::CWindowDialogPlots::m_plot, and MRPT_UNUSED_PARAM.

Here is the call graph for this function:

◆ setMenuCallback()

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.

See also
addPopupMenuEntry

Definition at line 1220 of file CDisplayWindowPlots.cpp.

References ASSERT_, m_callback, and m_callback_param.

◆ setPos()

void CDisplayWindowPlots::setPos ( int  x,
int  y 
)
overridevirtual

◆ setWindowTitle()

void CDisplayWindowPlots::setWindowTitle ( const std::string str)
overridevirtual

◆ waitForKey()

int CBaseGUIWindow::waitForKey ( bool  ignoreControlKeys = true,
mrptKeyModifier out_pushModifier = nullptr 
)
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

Parameters
ignoreControlKeysIf set to false, any push of shift, cmd, control, etc... will make this method to return.
out_pushModifierIf set to !=nullptr, the modifiers of the key stroke will be saved here.
Returns
The virtual key code, as defined in mrptKeyCode (a replication of wxWidgets key codes).
See also
getPushedKey, Key codes in the enum mrptKeyCode

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.

Referenced by find_chessboard_corners_multiple(), and mrpt::vision::CFeature::internal_distanceBetweenPolarImages().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CWindowDialogPlots

friend class CWindowDialogPlots
friend

Definition at line 41 of file CDisplayWindowPlots.h.

Member Data Documentation

◆ m_callback

TCallbackMenu mrpt::gui::CDisplayWindowPlots::m_callback
protected

Definition at line 48 of file CDisplayWindowPlots.h.

Referenced by setMenuCallback().

◆ m_callback_param

void* mrpt::gui::CDisplayWindowPlots::m_callback_param
protected

Definition at line 49 of file CDisplayWindowPlots.h.

Referenced by setMenuCallback().

◆ m_caption

std::string mrpt::gui::CBaseGUIWindow::m_caption
protectedinherited

◆ m_holdon

bool mrpt::gui::CDisplayWindowPlots::m_holdon
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().

◆ m_holdon_cnt

uint32_t mrpt::gui::CDisplayWindowPlots::m_holdon_cnt
protected

Counter for hold_on.

Definition at line 47 of file CDisplayWindowPlots.h.

Referenced by image(), internal_plot(), and plotEllipse().

◆ m_holdon_just_disabled

bool mrpt::gui::CDisplayWindowPlots::m_holdon_just_disabled
protected

Definition at line 45 of file CDisplayWindowPlots.h.

Referenced by hold_off(), image(), internal_plot(), and plotEllipse().

◆ m_hwnd

mrpt::utils::void_ptr_noncopy mrpt::gui::CBaseGUIWindow::m_hwnd
protectedinherited

◆ m_keyPushed

volatile bool mrpt::gui::CBaseGUIWindow::m_keyPushed
protectedinherited

◆ m_keyPushedCode

volatile int mrpt::gui::CBaseGUIWindow::m_keyPushedCode
protectedinherited

◆ m_keyPushedModifier

volatile mrptKeyModifier mrpt::gui::CBaseGUIWindow::m_keyPushedModifier
protectedinherited

◆ m_threadReady

std::promise<void> mrpt::gui::CBaseGUIWindow::m_threadReady
mutableprotectedinherited

This semaphore will be signaled when the wx window is built and ready.

Definition at line 60 of file CBaseGUIWindow.h.

Referenced by mrpt::gui::CBaseGUIWindow::createWxWindow(), and mrpt::gui::CBaseGUIWindow::notifySemThreadReady().

◆ m_windowDestroyed

std::promise<void> mrpt::gui::CBaseGUIWindow::m_windowDestroyed
mutableprotectedinherited

This semaphore will be signaled when the wx window is destroyed.

Definition at line 62 of file CBaseGUIWindow.h.

Referenced by mrpt::gui::CBaseGUIWindow::destroyWxWindow(), mrpt::gui::CWindowDialog::OnClose(), and mrpt::gui::C3DWindowDialog::OnClose().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019