25 : x_vf(0, 0), y_vf(0, 0), z_vf(0, 0), x_p(0, 0), y_p(0, 0), z_p(0, 0)
27 m_point_color = m_color;
28 m_field_color = m_color;
29 m_still_color = m_color;
30 m_maxspeed_color = m_color;
38 : m_colorFromModule(false), m_showPoints(true)
81 for (
int i = 0; i <
x_vf.
cols(); i++)
82 for (
int j = 0; j <
x_vf.
rows(); j++)
84 vbd.emplace_back(
x_p(j, i),
y_p(j, i),
z_p(j, i));
97 const float module = sqrt(
113 cbd.emplace_back(col);
128 for (
int i = 0; i <
x_p.
cols(); i++)
129 for (
int j = 0; j <
x_p.
rows(); j++)
130 vbd.emplace_back(
x_p(j, i),
y_p(j, i),
z_p(j, i));
181 for (
int i = 0; i <
x_p.
cols(); i++)
182 for (
int j = 0; j <
x_p.
rows(); j++)
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.
mrpt::img::TColor m_still_color
Color associated to fields with null module.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
mrpt::opengl::shader_id_t shader_id
The base class of 3D objects that can be directly rendered through OpenGL.
mrpt::math::CMatrixF z_vf
Z component of the vector field.
float m_maxspeed
Value of the module of the motion field which will correspond to 'm_maxspeed_color'.
mrpt::poses::CPose3D m_pose
6D pose wrt the parent coordinate reference.
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 onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
bool m_showPoints
By default it is true.
std::vector< mrpt::img::TColor > m_color_buffer_data
This base provides a set of functions for maths stuff.
mrpt::img::TColor m_point_color
void writeToStreamRender(mrpt::serialization::CArchive &out) const
static constexpr shader_id_t WIREFRAME
mrpt::math::CMatrixF x_vf
X component of the vector field.
mrpt::math::CMatrixF z_p
Z coordinate of the points at which the vector field is plotted.
mrpt::math::CMatrixF y_p
Y coordinate of the points at which the vector field is plotted.
mrpt::img::TColor m_field_color
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
A 3D vector field representation, consisting of points and arrows drawn at any spatial position...
size_type rows() const
Number of rows in the matrix.
size_type cols() const
Number of columns in the matrix.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
CVectorField3D()
Constructor.
mrpt::img::TColor m_color
Color components in the range [0,255].
return_t square(const num_t x)
Inline function for the square of a number.
std::vector< mrpt::img::TColor > m_color_buffer_data
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool m_colorFromModule
By default it is false.
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::math::CMatrixF y_vf
Y component of the vector field.
mrpt::vision::TStereoCalibResults out
mrpt::math::CMatrixF x_p
X coordinate of the points at which the vector field is plotted.
matrix_size_t size() const
Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x))
An RGBA color - floats in the range [0,1].
The namespace for 3D scene representation and rendering.
void readFromStreamRender(mrpt::serialization::CArchive &in)
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::optional_ref< mrpt::math::CMatrixDouble33 > out_jacobian_df_dpoint=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dpose=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dse3=std::nullopt, bool use_small_rot_approx=false) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
TColor asTColor() const
Returns the 0-255 integer version of this color: RGBA_u8.
mrpt::img::TColor m_maxspeed_color
Color associated to fields whose module is equal or larger than 'm_maxspeed'.
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.
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...
static constexpr shader_id_t POINTS
void onUpdateBuffers_Points() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.