#include <mrpt/gui/CDisplayWindowPlots.h>
Public Types | |
typedef void(* | TCallbackMenu )(int menuID, float cursor_x, float cursor_y, void *userParam) |
Type for the callback function used in setMenuCallback. | |
Public Member Functions | |
CDisplayWindowPlots (const std::string &windowCaption=std::string(), unsigned int initialWidth=350, unsigned int initialHeight=300) | |
Constructor. | |
virtual | ~CDisplayWindowPlots () |
Destructor. | |
void | resize (unsigned int width, unsigned int height) |
Resizes the window, stretching the image to fit into the display area. | |
void | setPos (int x, int y) |
Changes the position of the window on the screen. | |
void | setWindowTitle (const std::string &str) |
Changes the window title text. | |
void | enableMousePanZoom (bool enabled) |
Enable/disable the feature of pan/zoom with the mouse (default=enabled). | |
template<typename T > | |
void MRPTDLLIMPEXP | plot (const std::vector< T > &x, const std::vector< T > &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. | |
template<typename T > | |
void MRPTDLLIMPEXP | plot (const std::vector< T > &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 the vector Y, using a MATLAB-like syntax. | |
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. | |
void | axis_equal (bool enable=true) |
Enable/disable the fixed X/Y aspect ratio fix feature (default=disabled). | |
void | axis_fit (bool aspectRatioFix=false) |
Fix automatically the view area according to existing graphs. | |
template<typename T > | |
void MRPTDLLIMPEXP | plotEllipse (const T mean_x, const T mean_y, const 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). | |
template<typename T > | |
void MRPTDLLIMPEXP | plotEllipse (const T mean_x, const T mean_y, const 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) |
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). | |
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. | |
void | clear () |
Remove all plot objects in the display. | |
void | clf () |
Remove all plot objects in the display (clear and clf do exactly the same). | |
void | hold_on () |
Enables keeping all the graphs, instead of overwritting them. | |
void | hold_off () |
Disables keeping all the graphs (this is the default behavior). | |
void | addPopupMenuEntry (const std::string &label, int menuID) |
Disables keeping all the graphs (this is the default behavior). | |
void | setMenuCallback (TCallbackMenu userFunction, void *userParam=NULL) |
Must be called to have a callback when the user selects one of the user-defined entries in the popup menu. | |
Protected Attributes | |
bool | m_holdon |
Whether hold_on is enabled. | |
bool | m_holdon_just_disabled |
uint32_t | m_holdon_cnt |
Counter for hold_on. | |
TCallbackMenu | m_callback |
void * | m_callback_param |
Friends | |
class | CWindowDialogPlots |
Definition at line 53 of file CDisplayWindowPlots.h.
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 59 of file CDisplayWindowPlots.h.
mrpt::gui::CDisplayWindowPlots::CDisplayWindowPlots | ( | const std::string & | windowCaption = std::string() , |
|
unsigned int | initialWidth = 350 , |
|||
unsigned int | initialHeight = 300 | |||
) |
Constructor.
virtual mrpt::gui::CDisplayWindowPlots::~CDisplayWindowPlots | ( | ) | [virtual] |
Destructor.
void mrpt::gui::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. |
void mrpt::gui::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.
void mrpt::gui::CDisplayWindowPlots::axis_equal | ( | bool | enable = true |
) |
Enable/disable the fixed X/Y aspect ratio fix feature (default=disabled).
void mrpt::gui::CDisplayWindowPlots::axis_fit | ( | bool | aspectRatioFix = false |
) |
Fix automatically the view area according to existing graphs.
void mrpt::gui::CDisplayWindowPlots::clear | ( | ) |
void mrpt::gui::CDisplayWindowPlots::clf | ( | ) | [inline] |
Remove all plot objects in the display (clear and clf do exactly the same).
Definition at line 242 of file CDisplayWindowPlots.h.
void mrpt::gui::CDisplayWindowPlots::enableMousePanZoom | ( | bool | enabled | ) |
Enable/disable the feature of pan/zoom with the mouse (default=enabled).
void mrpt::gui::CDisplayWindowPlots::hold_off | ( | ) |
void mrpt::gui::CDisplayWindowPlots::hold_on | ( | ) |
void mrpt::gui::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).
void MRPTDLLIMPEXP mrpt::gui::CDisplayWindowPlots::plot | ( | const std::vector< T > & | 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 the vector Y, 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:
Examples:
void MRPTDLLIMPEXP mrpt::gui::CDisplayWindowPlots::plot | ( | const std::vector< T > & | x, | |
const std::vector< T > & | 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:
Examples:
void MRPTDLLIMPEXP mrpt::gui::CDisplayWindowPlots::plotEllipse | ( | const T | mean_x, | |
const T | mean_y, | |||
const 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 | |||
) | [inline] |
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:
void MRPTDLLIMPEXP mrpt::gui::CDisplayWindowPlots::plotEllipse | ( | const T | mean_x, | |
const T | mean_y, | |||
const CMatrixTemplateNumeric< T > & | cov22, | |||
const float | quantiles, | |||
const std::string & | lineFormat = std::string("b-") , |
|||
const std::string & | plotName = std::string("plotEllipse") , |
|||
bool | showName = false | |||
) | [inline] |
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:
void mrpt::gui::CDisplayWindowPlots::resize | ( | unsigned int | width, | |
unsigned int | height | |||
) | [virtual] |
Resizes the window, stretching the image to fit into the display area.
Implements mrpt::gui::CBaseGUIWindow.
void mrpt::gui::CDisplayWindowPlots::setMenuCallback | ( | TCallbackMenu | userFunction, | |
void * | userParam = NULL | |||
) |
Must be called to have a callback when the user selects one of the user-defined entries in the popup menu.
void mrpt::gui::CDisplayWindowPlots::setPos | ( | int | x, | |
int | y | |||
) | [virtual] |
void mrpt::gui::CDisplayWindowPlots::setWindowTitle | ( | const std::string & | str | ) | [virtual] |
friend class CWindowDialogPlots [friend] |
Definition at line 67 of file CDisplayWindowPlots.h.
void* mrpt::gui::CDisplayWindowPlots::m_callback_param [protected] |
Definition at line 68 of file CDisplayWindowPlots.h.
bool mrpt::gui::CDisplayWindowPlots::m_holdon [protected] |
uint32_t mrpt::gui::CDisplayWindowPlots::m_holdon_cnt [protected] |
bool mrpt::gui::CDisplayWindowPlots::m_holdon_just_disabled [protected] |
Definition at line 65 of file CDisplayWindowPlots.h.
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:21:34 EDT 2009 |