Go to the documentation of this file.
112 const float R,
const float G,
const float B,
const float A = 1)
130 const float R,
const float G,
const float B,
const float A = 1)
150 const float Rmin,
const float Gmin,
const float Bmin,
const float Rmax,
151 const float Gmax,
const float Bmax,
const float Amin = 1,
152 const float Amax = 1)
196 template <
class MATRIX>
198 MATRIX& Matrix_x, MATRIX& Matrix_y, MATRIX& Matrix_z)
const
218 template <
class MATRIX>
220 MATRIX& Coord_x, MATRIX& Coord_y, MATRIX& Coord_z)
const
256 (Matrix_x.
rows() == Matrix_y.
rows()) &&
257 (Matrix_x.
rows() == Matrix_z.
rows()));
259 (Matrix_x.
cols() == Matrix_y.
cols()) &&
260 (Matrix_x.
cols() == Matrix_z.
cols()));
267 template <
class MATRIX>
271 (Matrix_x.rows() == Matrix_y.rows()) &&
272 (Matrix_x.rows() == Matrix_z.rows()));
274 (Matrix_x.cols() == Matrix_y.cols()) &&
275 (Matrix_x.cols() == Matrix_z.cols()));
291 (Matrix_x.
rows() == Matrix_y.
rows()) &&
292 (Matrix_x.
rows() == Matrix_z.
rows()));
294 (Matrix_x.
cols() == Matrix_y.
cols()) &&
295 (Matrix_x.
cols() == Matrix_z.
cols()));
302 template <
class MATRIX>
304 MATRIX& Matrix_x, MATRIX& Matrix_y, MATRIX& Matrix_z)
307 (Matrix_x.rows() == Matrix_y.rows()) &&
308 (Matrix_x.rows() == Matrix_z.rows()));
310 (Matrix_x.cols() == Matrix_y.cols()) &&
311 (Matrix_x.cols() == Matrix_z.cols()));
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,...
const mrpt::math::CMatrixFloat & getVectorField_z() const
Get the "z" component of the vector field as a matrix.
size_t rows() const
Returns the total count of columns used to represent the vector field.
mrpt::math::CMatrixFloat & getVectorField_z()
This is an overloaded member function, provided for convenience. It differs from the above function o...
mrpt::img::TColorf getPointColor() const
Get the point color in the range [0,1].
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
float getMaxSpeedForColor() const
Get the max_speed with which lines are drawn.
mrpt::math::CMatrixF x_p
X coordinate of the points at which the vector field is plotted.
bool isColorFromModuleEnabled() const
mrpt::math::CMatrixFloat & getVectorField_y()
This is an overloaded member function, provided for convenience. It differs from the above function o...
mrpt::img::TColor m_field_color
void getVectorFieldColor(mrpt::img::TColorf Cmin, mrpt::img::TColorf Cmax) const
Get the motion field min and max colors (colormap) in the range [0,1].
A 3D vector field representation, consisting of points and arrows drawn at any spatial position.
Renderizable generic renderer for objects using the wireframe shader.
uint8_t f2u8(const float f)
converts a float [0,1] into an uint8_t [0,255] (without checking for out of bounds)
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
bool isAntiAliasingEnabled() const
#define ASSERT_(f)
Defines an assertion mechanism.
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
void getPointCoordinates(MATRIX &Coord_x, MATRIX &Coord_y, MATRIX &Coord_z) const
bool m_colorFromModule
By default it is false.
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 freeOpenGLResources() override
Free opengl buffers.
size_t cols() const
Returns the total count of rows used to represent the vector field.
This class is a "CSerializable" wrapper for "CMatrixFloat".
CVectorField3D()
Constructor.
void clear()
Clear the matrices.
static constexpr shader_id_t WIREFRAME
void getVectorField(MATRIX &Matrix_x, MATRIX &Matrix_y, MATRIX &Matrix_z) const
void enableColorFromModule(bool enable=true)
mrpt::math::CMatrixFloat & getVectorField_x()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void resize(size_t rows, size_t cols)
Resizes the set.
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
mrpt::math::CMatrixF x_vf
X component of the vector field.
An RGBA color - floats in the range [0,1].
bool m_showPoints
By default it is true.
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 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::CMatrixF y_p
Y coordinate of the points at which the vector field is plotted.
float m_maxspeed
Value of the module of the motion field which will correspond to 'm_maxspeed_color'.
mrpt::img::TColor m_maxspeed_color
Color associated to fields whose module is equal or larger than 'm_maxspeed'.
Context for calls to render()
mrpt::img::TColorf getVectorFieldColor() const
Get the arrow color in the range [0,1].
void freeOpenGLResources() override
Free opengl buffers.
~CVectorField3D() override=default
Private, virtual destructor: only can be deleted from smart pointers.
mrpt::math::CMatrixF z_p
Z coordinate of the points at which the vector field is plotted.
void resize(size_t row, size_t col)
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers,...
void freeOpenGLResources() override
Free opengl buffers.
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...
const mrpt::math::CMatrixFloat & getVectorField_x() const
Get the "x" component of the vector field as a matrix.
void setPointCoordinates(MATRIX &Matrix_x, MATRIX &Matrix_y, MATRIX &Matrix_z)
mrpt::math::CMatrixF y_vf
Y component of 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.
Renderizable generic renderer for objects using the points shader.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
mrpt::img::TColor m_still_color
Color associated to fields with null module.
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_type cols() const
Number of columns in the matrix.
void setVectorField(MATRIX &Matrix_x, MATRIX &Matrix_y, MATRIX &Matrix_z)
void setMaxSpeedForColor(const float s)
Set the max speed associated for the color map ( m_still_color, m_maxspeed_color)
const mrpt::math::CMatrixFloat & getVectorField_y() const
Get the "y" component of the vector field as a matrix.
The namespace for 3D scene representation and rendering.
void setVectorFieldColor(const float R, const float G, const float B, const float A=1)
Set the arrow color in the range [0,1].
static constexpr shader_id_t POINTS
This template class provides the basic functionality for a general 2D any-size, resizable container o...
size_type rows() const
Number of rows in the matrix.
mrpt::math::CMatrixF z_vf
Z component of the vector field.
void onUpdateBuffers_Points() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
mrpt::img::TColor m_point_color
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020 | |