10 #ifndef opengl_CVectorField3D_H 11 #define opengl_CVectorField3D_H 17 #include <Eigen/Dense> 58 bool m_colorFromModule;
61 mrpt::utils::TColor m_point_color;
62 mrpt::utils::TColor m_field_color;
64 mrpt::utils::TColor m_still_color;
65 mrpt::utils::TColor m_maxspeed_color;
73 x_vf.resize(0,0); y_vf.resize(0,0); z_vf.resize(0,0);
74 x_p.resize(0,0); y_p.resize(0,0); z_p.resize(0,0);
82 inline void setPointColor(
const float R,
const float G,
const float B,
const float A = 1)
107 Cmin = m_still_color/255;
108 Cmax = m_maxspeed_color/255;
114 inline 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)
165 void getVectorField(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z)
const {
180 void getPointCoordinates(Eigen::MatrixXf &Coord_x, Eigen::MatrixXf &Coord_y, Eigen::MatrixXf &Coord_z)
const {
205 ASSERT_((Matrix_x.getRowCount() == Matrix_y.getRowCount())&&(Matrix_x.getRowCount() == Matrix_z.getRowCount()))
206 ASSERT_((Matrix_x.getColCount() == Matrix_y.getColCount())&&(Matrix_x.getColCount() == Matrix_z.getColCount()))
213 void setVectorField(Eigen::MatrixXf &Matrix_x,Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z) {
214 ASSERT_((Matrix_x.getRowCount() == Matrix_y.getRowCount())&&(Matrix_x.getRowCount() == Matrix_z.getRowCount()))
215 ASSERT_((Matrix_x.getColCount() == Matrix_y.getColCount())&&(Matrix_x.getColCount() == Matrix_z.getColCount()))
226 ASSERT_((Matrix_x.getRowCount() == Matrix_y.getRowCount())&&(Matrix_x.getRowCount() == Matrix_z.getRowCount()))
227 ASSERT_((Matrix_x.getColCount() == Matrix_y.getColCount())&&(Matrix_x.getColCount() == Matrix_z.getColCount()))
234 void setPointCoordinates(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z) {
235 ASSERT_((Matrix_x.getRowCount() == Matrix_y.getRowCount())&&(Matrix_x.getRowCount() == Matrix_z.getRowCount()))
236 ASSERT_((Matrix_x.getColCount() == Matrix_y.getColCount())&&(Matrix_x.getColCount() == Matrix_z.getColCount()))
248 x_vf.resize(rows,cols); y_vf.resize(rows,cols); z_vf.resize(rows,cols);
249 x_p.resize(rows,cols); y_p.resize(rows,cols); z_p.resize(rows,cols);
265 void render_dl()
const;
virtual ~CVectorField3D()
Private, virtual destructor: only can be deleted from smart pointers.
void setPointCoordinates(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z)
size_t getColCount() const
Returns the total count of rows used to represent the vector field.
const mrpt::math::CMatrixFloat & getVectorField_x() const
Get the "x" component of the vector field as a matrix.
void getPointCoordinates(Eigen::MatrixXf &Coord_x, Eigen::MatrixXf &Coord_y, Eigen::MatrixXf &Coord_z) const
void getVectorField(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y, mrpt::math::CMatrixFloat &Matrix_z) const
Get the vector field in three independent matrices: Matrix_x, Matrix_y and Matrix_z.
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].
void enableShowPoints(bool enable=true)
void getPointCoordinates(mrpt::math::CMatrixFloat &Coord_x, mrpt::math::CMatrixFloat &Coord_y, mrpt::math::CMatrixFloat &Coord_z) const
Get the coordiantes of the points at which the vector field is plotted: Coord_x, Coord_y and Coord_z...
size_t getRowCount() const
Returns the total count of columns used to represent the vector field.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
void enableColorFromModule(bool enable=true)
void setVectorFieldColor(const float R, const float G, const float B, const float A=1)
Set the arrow color in the range [0,1].
A renderizable object suitable for rendering with OpenGL's display lists.
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.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
void getVectorField(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z) const
void setPointSize(const float p)
Set the size with which points will be drawn.
float getLineWidth() const
Get the width with which lines are drawn.
mrpt::math::CMatrixFloat & getVectorField_z()
bool isColorFromModuleEnabled() const
void setVectorField(Eigen::MatrixXf &Matrix_x, Eigen::MatrixXf &Matrix_y, Eigen::MatrixXf &Matrix_z)
mrpt::utils::TColorf getVectorFieldColor() const
Get the arrow color in the range [0,1].
A 3D vector field representation, consisting of points and arrows drawn at any spatial position...
const mrpt::math::CMatrixFloat & getVectorField_y() const
Get the "y" component of the vector field as a matrix.
mrpt::utils::TColorf getPointColor() const
Get the point color in the range [0,1].
void resize(size_t rows, size_t cols)
Resizes the set.
float getMaxSpeedForColor() const
Get the max_speed with which lines are drawn.
void enableAntiAliasing(bool enable=true)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void setLineWidth(const float w)
Set the width with which lines 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].
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].
A RGB color - floats in the range [0,1].
A matrix of dynamic size.
mrpt::math::CMatrixFloat & getVectorField_x()
void setMaxSpeedForColor(const float s)
Set the max speed associated for the color map ( m_still_color, m_maxspeed_color) ...
mrpt::math::CMatrixFloat & getVectorField_y()
void setPointCoordinates(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y, mrpt::math::CMatrixFloat &Matrix_z)
Set the coordinates of the points at which the vector field is plotted with Matrix_x, Matrix_y and Matrix_z.
class OPENGL_IMPEXP CVectorField3D
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
bool isAntiAliasingEnabled() const
float getPointSize() const
Get the size with which points are drawn.
const mrpt::math::CMatrixFloat & getVectorField_z() const
Get the "z" component of the vector field as a matrix.