89 std::pair<CSetOfTriangles::TTriangle, TTriangleVertexIndices>>
99 mutable std::vector<mrpt::math::TPolygonWithPlane>
tmpPolys;
111 void getGridLimits(
float& xmin,
float& xmax,
float& ymin,
float& ymax)
const 235 const float ycenter = 0.5 * (
yMin +
yMax);
239 yMax = ycenter + 0.5 * newratio * xwidth;
240 yMin = ycenter - 0.5 * newratio * xwidth;
251 float yMin = 0.0f,
float yMax = 0.0f);
~CMesh() override
Private, virtual destructor: only can be deleted from smart pointers.
void setXMax(const float nxm)
void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
math::CMatrixF C
Grayscale Color [0,1] for each cell, updated by updateColorsMatrix.
mrpt::img::CImage m_textureImage
TColormap
Different colormaps for use in mrpt::img::colormap()
std::vector< mrpt::math::TPolygonWithPlane > tmpPolys
void assignImageAndZ(const mrpt::img::CImage &img, const mrpt::math::CMatrixDynamic< float > &in_Z)
Assigns a texture image and Z simultaneously, and disable transparency.
void adjustGridToImageAR()
Adjust grid limits according to the image aspect ratio, maintaining the X limits and resizing in the ...
void enableTransparency(bool v)
void setXMin(const float nxm)
math::CMatrixF U
Texture coordinates.
bool m_enableTransparency
void setUV(const mrpt::math::CMatrixDynamic< float > &in_U, const mrpt::math::CMatrixDynamic< float > &in_V)
Sets the (u,v) texture coordinates (in range [0,1]) for each cell.
void enableWireFrame(bool v)
size_t getHeight() const override
Returns the height of the image in pixels.
void render_dl() const override
Render.
math::CMatrixF C_b
Blue Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
void getXBounds(float &min, float &max) const
bool m_modified_Z
Whether C is not up-to-date wrt to Z.
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...
mrpt::img::TColormap m_colorMap
Used when m_colorFromZ is true.
void getGridLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
void setYMax(const float nym)
void assignImage(const mrpt::img::CImage &img)
Assigns a texture image, and disable transparency.
A renderizable object suitable for rendering with OpenGL's display lists.
#define ASSERT_(f)
Defines an assertion mechanism.
size_t getWidth() const override
Returns the width of the image in pixels.
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Trace ray.
void setYBounds(const float min, const float max)
math::CMatrixF C_g
Green Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
void enableColorFromZ(bool v, mrpt::img::TColormap colorMap=mrpt::img::cmHOT)
void updatePolygons() const
math::CMatrixF C_r
Red Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
void setGridLimits(float xmin, float xmax, float ymin, float ymax)
void setZ(const mrpt::math::CMatrixDynamic< float > &in_Z)
This method sets the matrix of heights for each position (cell) in the mesh grid. ...
bool polygonsUpToDate
Whether the polygon mesh (auxiliary structure for ray tracing) needs to be recalculated.
This class is a "CSerializable" wrapper for "CMatrixFloat".
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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...
CMesh(bool enableTransparency=false, float xMin=0.0f, float xMax=0.0f, float yMin=0.0f, float yMax=0.0f)
Constructor.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
The namespace for 3D scene representation and rendering.
void updateColorsMatrix() const
Called internally to assure C is updated.
void getYBounds(float &min, float &max) const
void setXBounds(const float min, const float max)
A planar (XY) grid where each cell has an associated height and, optionally, a texture map...
This template class provides the basic functionality for a general 2D any-size, resizable container o...
math::CMatrixF Z
Z(x,y): Z-coordinate of the point (x,y)
void updateTriangles() const
Called internally to assure the triangle list is updated.
std::vector< std::pair< mrpt::math::TPoint3D, size_t > > vertex_normals
The accumulated normals & counts for each vertex, so normals can be averaged.
std::vector< std::pair< CSetOfTriangles::TTriangle, TTriangleVertexIndices > > actualMesh
List of triangles in the mesh.
bool m_modified_Image
Whether C is not up-to-date wrt to the texture image.
void getMask(mrpt::math::CMatrixFloat &out) const
Returns a reference to the internal mask matrix, allowing changing it efficiently.
A class for storing images as grayscale or RGB bitmaps.
void setYMin(const float nym)
bool trianglesUpToDate
Whether the actual mesh needs to be recalculated.