9 #ifndef CDisplayWindowPlots_H 10 #define CDisplayWindowPlots_H 37 typedef void (* TCallbackMenu) (
int menuID,
float cursor_x,
float cursor_y,
void* userParam);
49 template <
typename VECTOR1,
typename VECTOR2>
53 const size_t N1=size_t(
x.size());
54 for (
size_t i=0;i<N1;i++) x1[i]=
x[i];
55 const size_t N2=size_t(
y.size());
56 for (
size_t i=0;i<N2;i++) y1[i]=
y[i];
57 this->internal_plot(x1,y1,lineFormat,plotName);
59 template <
typename VECTOR1>
62 const size_t N=size_t(
y.size());
64 for (
size_t i=0;i<N;i++) { x1[i]=i; y1[i]=
y[i]; }
65 this->internal_plot(x1,y1,lineFormat,plotName);
74 unsigned int initialWidth = 350,
75 unsigned int initialHeight = 300 );
78 static CDisplayWindowPlotsPtr Create(
80 unsigned int initialWindowWidth = 400,
81 unsigned int initialWindowHeight = 300 );
91 virtual void setCursorCross(
bool cursorIsCross)
MRPT_OVERRIDE;
107 void enableMousePanZoom(
bool enabled );
137 template <
typename T1,
typename Derived2>
inline 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->internal_plot_interface(
x,
y,lineFormat,plotName); }
139 template <
typename Derived1,
typename T2>
inline 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->internal_plot_interface(
x,
y,lineFormat,plotName); }
141 template <
typename Derived1,
typename Derived2>
inline 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->internal_plot_interface(
x,
y,lineFormat,plotName); }
149 void axis(
float x_min,
float x_max,
float y_min,
float y_max,
bool aspectRatioFix =
false );
152 void axis_equal(
bool enable=
true);
155 void axis_fit(
bool aspectRatioFix=
false);
170 template <
typename T>
175 const float quantiles,
178 bool showName =
false);
181 template <
typename T>
186 const float quantiles,
189 bool showName =
false);
199 const float &y_bottom,
200 const float &x_width,
201 const float &y_height,
232 void addPopupMenuEntry(
const std::string &label,
int menuID );
238 void setMenuCallback(TCallbackMenu userFunction,
void* userParam = NULL );
Create a GUI window and display plots with MATLAB-like interfaces and commands.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
A class for storing images as grayscale or RGB bitmaps.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
The wx dialog for gui::CDisplayWindowPlots.
GLenum GLsizei GLenum GLenum const GLvoid * image
bool m_holdon
Whether hold_on is enabled.
void internal_plot_interface(const VECTOR1 &y, const std::string &lineFormat, const std::string &plotName)
void clear()
Clear the contents of this container.
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"))
A numeric matrix of compile-time fixed size.
uint32_t m_holdon_cnt
Counter for hold_on.
#define DEFINE_MRPT_OBJECT(class_name)
This declaration must be inserted in all CObject classes definition, within the class declaration...
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
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"))
void plot(const std::vector< T > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
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...
GLsizei const GLchar ** string
void internal_plot_interface(const VECTOR1 &x, const VECTOR2 &y, const std::string &lineFormat, const std::string &plotName)
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void clf()
Remove all plot objects in the display (clear and clf do exactly the same).
A matrix of dynamic size.
void plot(const Eigen::MatrixBase< Derived > &y, const std::string &lineFormat=std::string("b-"), const std::string &plotName=std::string("plotXY"))
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
GLenum GLsizei GLsizei height
unsigned __int32 uint32_t
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"))
bool m_holdon_just_disabled
The base class for GUI window classes.