Go to the documentation of this file.
44 size_t vind[3] = {0, 0, 0};
50 void render(
const RenderContext& rc)
const override;
70 float yMin = -1.0f,
float yMax = 1.0f);
77 m_xMin =
static_cast<float>(xMin);
78 m_xMax =
static_cast<float>(xMax);
79 m_yMin =
static_cast<float>(yMin);
80 m_yMax =
static_cast<float>(yMax);
84 void getGridLimits(
float& xMin,
float& xMax,
float& yMin,
float& yMax)
const
241 std::pair<mrpt::opengl::TTriangle, TTriangleVertexIndices>>
251 mutable std::vector<mrpt::math::TPolygonWithPlane>
tmpPolys;
CMesh(bool enableTransparency=false, float xMin=-1.0f, float xMax=1.0f, float yMin=-1.0f, float yMax=1.0f)
void setGridLimits(T xMin, T xMax, T yMin, T yMax)
void setyMax(const float nym)
Renderizable generic renderer for objects using the triangles-with-a-texture shader.
math::CMatrixF C_b
Blue Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
math::CMatrixF C
Grayscale Color [0,1] for each cell, updated by updateColorsMatrix.
TColormap
Different colormaps for use in mrpt::img::colormap()
void updatePolygons() const
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
bool m_trianglesUpToDate
Whether the actual mesh needs to be recalculated.
void setMask(const mrpt::math::CMatrixDynamic< float > &in_mask)
This method sets the boolean mask of valid heights for each position (cell) in the mesh grid.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void enableWireFrame(bool v)
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Trace ray.
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
bool m_modified_Z
Whether C is not up-to-date wrt to Z.
void updateColorsMatrix() const
Called internally to assure C is updated.
math::CMatrixF Z
Z(x,y): Z-coordinate of the point (x,y)
void enableTransparency(bool v)
void freeOpenGLResources() override
Free opengl buffers.
static constexpr shader_id_t TEXTURED_TRIANGLES
@ cmHOT
[New in MRPT 1.5.0]
Renderizable generic renderer for objects using the wireframe shader.
void assignImageAndZ(const mrpt::img::CImage &img, const mrpt::math::CMatrixDynamic< float > &in_Z)
Assigns a texture image and Z simultaneously, and disable transparency.
mrpt::vision::TStereoCalibResults out
mrpt::img::TColormap m_colorMap
Used when m_colorFromZ is true.
void setxMax(const float nxm)
void setYBounds(const float min, const float max)
A planar (XY) grid where each cell has an associated height and, optionally, a texture map.
void assignImage(const mrpt::img::CImage &img)
Assigns a texture image.
bool m_modified_Image
Whether C is not up-to-date wrt to the texture image.
void freeOpenGLResources() override
Free opengl buffers.
void getZ(mrpt::math::CMatrixFloat &out) const
Returns a reference to the internal Z matrix, allowing changing it efficiently.
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...
This class is a "CSerializable" wrapper for "CMatrixFloat".
math::CMatrixF C_r
Red Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
static constexpr shader_id_t WIREFRAME
bool m_enableTransparency
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void adjustGridToImageAR()
Adjust grid limits according to the image aspect ratio, maintaining the X limits and resizing in the ...
void getGridLimits(float &xMin, float &xMax, float &yMin, float &yMax) const
void updateTriangles() const
Called internally to assure the triangle list is updated.
void onUpdateBuffers_TexturedTriangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void freeOpenGLResources() override
Free opengl buffers.
A class for storing images as grayscale or RGB bitmaps.
void setZ(const mrpt::math::CMatrixDynamic< float > &in_Z)
This method sets the matrix of heights for each position (cell) in the mesh grid.
void getYBounds(float &min, float &max) const
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
math::CMatrixF C_g
Green Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers,...
void setXBounds(const float min, const float max)
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
void getMask(mrpt::math::CMatrixFloat &out) const
Returns a reference to the internal mask matrix, allowing changing it efficiently.
void getXBounds(float &min, float &max) const
void setxMin(const float nxm)
virtual ~CMesh() override
std::vector< mrpt::math::TPolygonWithPlane > tmpPolys
void setyMin(const float nym)
std::vector< std::pair< mrpt::opengl::TTriangle, TTriangleVertexIndices > > actualMesh
List of triangles in the mesh.
The namespace for 3D scene representation and rendering.
std::vector< std::pair< mrpt::math::TPoint3D, size_t > > vertex_normals
The accumulated normals & counts for each vertex, so normals can be averaged.
This template class provides the basic functionality for a general 2D any-size, resizable container o...
void enableColorFromZ(bool v, mrpt::img::TColormap colorMap=mrpt::img::cmHOT)
bool m_polygonsUpToDate
Whether the polygon mesh (auxiliary structure for ray tracing) needs to be recalculated.
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |