26     m_point_color = m_color;
    27     m_field_color = m_color;
    33     [[maybe_unused]] 
CMatrixFloat Matrix_y, [[maybe_unused]] 
float xmin,
    34     [[maybe_unused]] 
float xmax, [[maybe_unused]] 
float ymin,
    35     [[maybe_unused]] 
float ymax)
    37     m_point_color = m_color;
    38     m_field_color = m_color;
    69     vbd.reserve(xcomp.size() * 2);
    71     const float x_cell_size = (xMax - xMin) / (xcomp.cols() - 1);
    72     const float y_cell_size = (yMax - yMin) / (ycomp.rows() - 1);
    74     for (
int i = 0; i < xcomp.cols(); i++)
    75         for (
int j = 0; j < xcomp.rows(); j++)
    77             vbd.emplace_back(xMin + i * x_cell_size, yMin + j * y_cell_size, 0);
    79                 xMin + i * x_cell_size + xcomp(j, i),
    80                 yMin + j * y_cell_size + ycomp(j, i), 0);
    83     cbd.assign(vbd.size(), m_field_color);
    92     tris.reserve(xcomp.size());
    94     const float x_cell_size = (xMax - xMin) / (xcomp.cols() - 1);
    95     const float y_cell_size = (yMax - yMin) / (ycomp.rows() - 1);
    97     for (
int i = 0; i < xcomp.cols(); i++)
    98         for (
int j = 0; j < xcomp.rows(); j++)
   100             const float tri_side =
   102                 sqrt(xcomp(j, i) * xcomp(j, i) + ycomp(j, i) * ycomp(j, i));
   103             const float ang = ::atan2f(ycomp(j, i), xcomp(j, i)) - 1.5708f;
   105                 P3f(-sin(ang) * 0.866f * tri_side + xMin + i * x_cell_size +
   107                     cos(ang) * 0.866f * tri_side + yMin + j * y_cell_size +
   110                 P3f(cos(ang) * 0.5f * tri_side + xMin + i * x_cell_size +
   112                     sin(ang) * 0.5f * tri_side + yMin + j * y_cell_size +
   115                 P3f(-cos(ang) * 0.5f * tri_side + xMin + i * x_cell_size +
   117                     -sin(ang) * 0.5f * tri_side + yMin + j * y_cell_size +
   125         t.setColor(m_field_color);
   134     vbd.reserve(xcomp.size());
   136     const float x_cell_size = (xMax - xMin) / (xcomp.cols() - 1);
   137     const float y_cell_size = (yMax - yMin) / (ycomp.rows() - 1);
   139     for (
int i = 0; i < xcomp.cols(); i++)
   140         for (
int j = 0; j < xcomp.rows(); j++)
   142                 xMin + i * x_cell_size, yMin + j * y_cell_size, .0f);
   144     cbd.assign(vbd.size(), m_point_color);
   154     writeToStreamRender(
out);
   156     out << xcomp << ycomp;
   157     out << xMin << xMax << yMin << yMax;
   160     out << m_antiAliasing;
   161     out << m_point_color;
   162     out << m_field_color;
   171             readFromStreamRender(in);
   173             in >> xcomp >> ycomp;
   174             in >> xMin >> xMax >> yMin >> yMax;
   177             in >> m_antiAliasing;
   200     const float x_cell_size = (xMax - xMin) / (xcomp.cols() - 1);
   201     const float y_cell_size = (yMax - yMin) / (ycomp.rows() - 1);
   203     for (
int i = 0; i < xcomp.cols(); i++)
   204         for (
int j = 0; j < xcomp.rows(); j++)
   206             const float tri_side =
   208                 sqrt(xcomp(j, i) * xcomp(j, i) + ycomp(j, i) * ycomp(j, i));
   209             const float ang = ::atan2f(ycomp(j, i), xcomp(j, i)) - 1.5708f;
   211             if (-sin(ang) * 0.866f * tri_side + xMin + i * x_cell_size +
   214                 bb_min.x = -sin(ang) * 0.866f * tri_side + xMin +
   215                            i * x_cell_size + xcomp(j, i);
   217             if (cos(ang) * 0.866f * tri_side + yMin + j * y_cell_size +
   220                 bb_min.y = cos(ang) * 0.866f * tri_side + yMin +
   221                            j * y_cell_size + ycomp(j, i);
   223             if (-sin(ang) * 0.866f * tri_side + xMin + i * x_cell_size +
   226                 bb_max.x = -sin(ang) * 0.866f * tri_side + xMin +
   227                            i * x_cell_size + xcomp(j, i);
   229             if (cos(ang) * 0.866f * tri_side + yMin + j * y_cell_size +
   232                 bb_max.y = cos(ang) * 0.866f * tri_side + yMin +
   233                            j * y_cell_size + ycomp(j, i);
   245     const float ratio_xp =
   246         xcomp.maxCoeff() * (xcomp.cols() - 1) / (xMax - xMin);
   247     const float ratio_xn =
   248         xcomp.minCoeff() * (xcomp.cols() - 1) / (xMax - xMin);
   249     const float ratio_yp =
   250         ycomp.maxCoeff() * (ycomp.rows() - 1) / (yMax - yMin);
   251     const float ratio_yn =
   252         ycomp.minCoeff() * (ycomp.rows() - 1) / (yMax - yMin);
   253     const float norm_factor = 0.85f / max(max(ratio_xp, std::abs(ratio_xn)),
   254                                           max(ratio_yp, std::abs(ratio_yn)));
   256     xcomp *= norm_factor;
   257     ycomp *= norm_factor;
 std::vector< mrpt::math::TPoint3Df > m_vertex_buffer_data
 
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files. 
 
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration. 
 
mrpt::opengl::shader_id_t shader_id
 
The base class of 3D objects that can be directly rendered through OpenGL. 
 
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc. 
 
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc. 
 
Context for calls to render() 
 
std::vector< mrpt::math::TPoint3Df > m_vertex_buffer_data
 
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc. 
 
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations. 
 
std::vector< mrpt::img::TColor > m_color_buffer_data
 
#define ASSERT_(f)
Defines an assertion mechanism. 
 
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
 
This base provides a set of functions for maths stuff. 
 
static constexpr shader_id_t WIREFRAME
 
void onUpdateBuffers_Points() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
 
A 2D vector field representation, consisting of points and arrows drawn on a plane (invisible grid)...
 
static constexpr shader_id_t TRIANGLES
 
CVectorField2D()
Constructor. 
 
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 serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive. 
 
std::vector< mrpt::img::TColor > m_color_buffer_data
 
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. 
 
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive. 
 
Virtual base class for "archives": classes abstracting I/O streams. 
 
std::vector< mrpt::opengl::TTriangle > m_triangles
List of triangles. 
 
mrpt::vision::TStereoCalibResults out
 
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
 
The namespace for 3D scene representation and rendering. 
 
void adjustVectorFieldToGrid()
Adjust the vector field in the scene (vectors magnitude) according to the grid size. 
 
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable. 
 
TPoint3D_< float > TPoint3Df
 
This template class provides the basic functionality for a general 2D any-size, resizable container o...
 
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable. 
 
static constexpr shader_id_t POINTS
 
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object. 
 
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable. 
 
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.