Go to the documentation of this file.
10 #ifndef opengl_CVectorField2D_H
11 #define opengl_CVectorField2D_H
72 const float R,
const float G,
const float B,
const float A = 1)
90 const float R,
const float G,
const float B,
const float A = 1)
137 const float center_x,
const float center_y,
const float cellsize_x,
138 const float cellsize_y)
140 xMin = center_x - 0.5 * cellsize_x * (
xcomp.cols() - 1);
141 xMax = center_x + 0.5 * cellsize_x * (
xcomp.cols() - 1);
142 yMin = center_y - 0.5 * cellsize_y * (
xcomp.rows() - 1);
143 yMax = center_y + 0.5 * cellsize_y * (
xcomp.rows() - 1);
152 const float xmin,
const float xmax,
const float ymin,
const float ymax)
165 void getGridLimits(
float& xmin,
float& xmax,
float& ymin,
float& ymax)
const
209 (Matrix_x.rows() == Matrix_y.rows()) &&
210 (Matrix_x.cols() == Matrix_y.cols()));
242 float xmax = 1,
float ymin = -1,
float ymax = 1);
264 float xmin = -1,
float xmax = 1,
float ymin = -1,
float ymax = 1);
mrpt::math::CMatrixFloat & getVectorField_y()
This is an overloaded member function, provided for convenience. It differs from the above function o...
float getLineWidth() const
Get the width with which lines are drawn.
void setGridLimits(const float xmin, const float xmax, const float ymin, const float ymax)
Set the coordinates of the grid on where the vector field will be drawn using x-y max and min values.
CVectorField2D()
Constructor.
void adjustVectorFieldToGrid()
Adjust the vector field in the scene (vectors magnitude) according to the grid size.
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...
void setPointSize(const float p)
Set the size with which points will be drawn.
const mrpt::math::CMatrixFloat & getVectorField_x() const
Get the "x" component of the vector field, as a matrix where each entry represents a point in the 2D ...
A renderizable object suitable for rendering with OpenGL's display lists.
bool isAntiAliasingEnabled() const
float m_pointSize
By default is 1.0.
mrpt::img::TColor m_field_color
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
A 2D vector field representation, consisting of points and arrows drawn on a plane (invisible grid).
void setGridCenterAndCellSize(const float center_x, const float center_y, const float cellsize_x, const float cellsize_y)
Set the coordinates of the grid on where the vector field will be drawn by setting its center and the...
void resize(size_t rows, size_t cols)
Resizes the set.
void clear()
Clear the matrices.
void getGridLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
Get the coordinates of the grid on where the vector field is drawn using the max and min values.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLubyte GLubyte GLubyte GLubyte w
static Ptr Create(Args &&... args)
#define ASSERT_(f)
Defines an assertion mechanism.
mrpt::img::TColorf getPointColor() const
Get the point color in the range [0,1].
bool m_antiAliasing
By default is true.
void setLineWidth(const float w)
Set the width with which lines will be drawn.
size_t cols() const
Returns the total count of rows used to represent the vector field.
float getPointSize() const
Get the size with which points are drawn.
A matrix of dynamic size.
std::shared_ptr< CVectorField2D > Ptr
mrpt::img::TColorf getVectorFieldColor() const
Get the arrow color in the range [0,1].
const mrpt::math::CMatrixFloat & getVectorField_y() const
Get the "y" component of the vector field, as a matrix where each entry represents a point in the 2D ...
This class is a "CSerializable" wrapper for "CMatrixFloat".
void render_dl() const override
Render.
void getVectorField(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y) const
Get the vector field.
A RGB color - floats in the range [0,1].
void setVectorFieldColor(const float R, const float G, const float B, const float A=1)
Set the arrow color in the range [0,1].
void enableAntiAliasing(bool enable=true)
void setVectorField(mrpt::math::CMatrixFloat &Matrix_x, mrpt::math::CMatrixFloat &Matrix_y)
Set the vector field.
virtual ~CVectorField2D()
Private, virtual destructor: only can be deleted from smart pointers.
size_t rows() const
Returns the total count of columns used to represent the vector field.
float m_LineWidth
By default is 1.0.
mrpt::img::TColor m_point_color
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
mrpt::math::CMatrix xcomp
X component of the vector field.
mrpt::math::CMatrixFloat & getVectorField_x()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setPointColor(const float R, const float G, const float B, const float A=1)
Set the point color in the range [0,1].
mrpt::math::CMatrix ycomp
Y component of the vector field.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |