10 #ifndef opengl_CVectorField3D_H
11 #define opengl_CVectorField3D_H
17 #include <Eigen/Dense>
106 const float R,
const float G,
const float B,
const float A = 1)
124 const float R,
const float G,
const float B,
const float A = 1)
144 const float Rmin,
const float Gmin,
const float Bmin,
const float Rmax,
145 const float Gmax,
const float Bmax,
const float Amin = 1,
146 const float Amax = 1)
217 Eigen::MatrixXf& Matrix_x, Eigen::MatrixXf& Matrix_y,
218 Eigen::MatrixXf& Matrix_z)
const
239 Eigen::MatrixXf& Coord_x, Eigen::MatrixXf& Coord_y,
240 Eigen::MatrixXf& Coord_z)
const
276 (Matrix_x.getRowCount() == Matrix_y.getRowCount()) &&
277 (Matrix_x.getRowCount() == Matrix_z.getRowCount()))
279 (Matrix_x.getColCount() == Matrix_y.getColCount()) &&
280 (Matrix_x.getColCount() == Matrix_z.getColCount()))
288 Eigen::MatrixXf& Matrix_x, Eigen::MatrixXf& Matrix_y,
289 Eigen::MatrixXf& Matrix_z)
292 (Matrix_x.getRowCount() == Matrix_y.getRowCount()) &&
293 (Matrix_x.getRowCount() == Matrix_z.getRowCount()))
295 (Matrix_x.getColCount() == Matrix_y.getColCount()) &&
296 (Matrix_x.getColCount() == Matrix_z.getColCount()))
312 (Matrix_x.getRowCount() == Matrix_y.getRowCount()) &&
313 (Matrix_x.getRowCount() == Matrix_z.getRowCount()))
315 (Matrix_x.getColCount() == Matrix_y.getColCount()) &&
316 (Matrix_x.getColCount() == Matrix_z.getColCount()))
324 Eigen::MatrixXf& Matrix_x, Eigen::MatrixXf& Matrix_y,
325 Eigen::MatrixXf& Matrix_z)
328 (Matrix_x.getRowCount() == Matrix_y.getRowCount()) &&
329 (Matrix_x.getRowCount() == Matrix_z.getRowCount()))
331 (Matrix_x.getColCount() == Matrix_y.getColCount()) &&
332 (Matrix_x.getColCount() == Matrix_z.getColCount()))
344 x_vf.resize(rows, cols);
345 y_vf.resize(rows, cols);
346 z_vf.resize(rows, cols);
347 x_p.resize(rows, cols);
348 y_p.resize(rows, cols);
349 z_p.resize(rows, cols);
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
This class is a "CSerializable" wrapper for "CMatrixFloat".
A matrix of dynamic size.
A renderizable object suitable for rendering with OpenGL's display lists.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
A 3D vector field representation, consisting of points and arrows drawn at any spatial position.
const mrpt::math::CMatrixFloat & getVectorField_z() const
Get the "z" component of the vector field as a matrix.
size_t getRowCount() const
Returns the total count of columns used to represent the vector field.
bool isAntiAliasingEnabled() const
virtual ~CVectorField3D()
Private, virtual destructor: only can be deleted from smart pointers.
mrpt::math::CMatrix y_p
Y coordinate of the points at which the vector field is plotted.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
bool m_showPoints
By default it is true.
static CVectorField3D::Ptr Create(const mrpt::math::CMatrixFloat x_vf_ini, const mrpt::math::CMatrixFloat y_vf_ini, const mrpt::math::CMatrixFloat z_vf_ini, const mrpt::math::CMatrixFloat x_p_ini, const mrpt::math::CMatrixFloat y_p_ini, const mrpt::math::CMatrixFloat z_p_ini)
Class factory.
mrpt::utils::TColorf getPointColor() const
Get the point color in the range [0,1].
void getVectorField(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z) const
std::shared_ptr< CVectorField3D > Ptr
void getPointCoordinates(Eigen::MatrixXf &Coord_x, Eigen::MatrixXf &Coord_y, Eigen::MatrixXf &Coord_z) const
void setLineWidth(const float w)
Set the width with which lines will be drawn.
float getLineWidth() const
Get the width with which lines are drawn.
float getMaxSpeedForColor() const
Get the max_speed with which lines are drawn.
void setPointCoordinates(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z)
mrpt::math::CMatrixFloat & getVectorField_x()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setMaxSpeedForColor(const float s)
float m_LineWidth
By default it is 1.0.
mrpt::utils::TColor m_still_color
Color associated to fields with null module.
void setVectorFieldColor(const float R, const float G, const float B, const float A=1)
Set the arrow color in the range [0,1].
mrpt::utils::TColor m_field_color
void clear()
Clear the matrices.
float m_maxspeed
Value of the module of the motion field which will correspond to 'm_maxspeed_color'.
bool m_colorFromModule
By default it is false.
const mrpt::math::CMatrixFloat & getVectorField_x() const
Get the "x" component of the vector field as a matrix.
void enableColorFromModule(bool enable=true)
void enableAntiAliasing(bool enable=true)
bool m_antiAliasing
By default it is true.
float getPointSize() const
Get the size with which points are drawn.
mrpt::math::CMatrix x_vf
X component of the vector field.
void resize(size_t rows, size_t cols)
Resizes the set.
float m_pointSize
By default it is 1.0.
mrpt::math::CMatrix y_vf
Y component of the vector field.
mrpt::utils::TColorf getVectorFieldColor() const
Get the arrow color in the range [0,1].
size_t getColCount() const
Returns the total count of rows used to represent the vector field.
void setVectorField(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y, mrpt::math::CMatrixFloat &Matrix_z)
Set the vector field with Matrix_x, Matrix_y and Matrix_z.
void enableShowPoints(bool enable=true)
void getVectorField(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y, mrpt::math::CMatrixFloat &Matrix_z) const
void getPointCoordinates(mrpt::math::CMatrixFloat &Coord_x, mrpt::math::CMatrixFloat &Coord_y, mrpt::math::CMatrixFloat &Coord_z) const
mrpt::math::CMatrix z_p
Z coordinate of the points at which the vector field is plotted.
bool isColorFromModuleEnabled() const
void getVectorFieldColor(mrpt::utils::TColorf Cmin, mrpt::utils::TColorf Cmax) const
Get the motion field min and max colors (colormap) in the range [0,1].
void setVectorField(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z)
void render_dl() const override
Render.
mrpt::utils::TColor m_maxspeed_color
Color associated to fields whose module is equal or larger than 'm_maxspeed'.
void setMotionFieldColormap(const float Rmin, const float Gmin, const float Bmin, const float Rmax, const float Gmax, const float Bmax, const float Amin=1, const float Amax=1)
Set the motion field min and max colors (colormap) in the range [0,1].
mrpt::math::CMatrixFloat & getVectorField_z()
This is an overloaded member function, provided for convenience. It differs from the above function o...
mrpt::math::CMatrix z_vf
Z component of the vector field.
CVectorField3D()
Constructor.
mrpt::utils::TColor m_point_color
mrpt::math::CMatrixFloat & getVectorField_y()
This is an overloaded member function, provided for convenience. It differs from the above function o...
mrpt::math::CMatrix x_p
X coordinate of the points at which the vector field is plotted.
void setPointCoordinates(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y, mrpt::math::CMatrixFloat &Matrix_z)
void setPointSize(const float p)
Set the size with which points will be drawn.
void setPointColor(const float R, const float G, const float B, const float A=1)
Set the point color in the range [0,1].
const mrpt::math::CMatrixFloat & getVectorField_y() const
Get the "y" component of the vector field as a matrix.
GLubyte GLubyte GLubyte GLubyte w
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A RGB color - floats in the range [0,1].