Go to the documentation of this file.
10 #ifndef opengl_CMeshFast_H
11 #define opengl_CMeshFast_H
85 xMin=xmin; xMax = xmax;
86 yMin=ymin; yMax = ymax;
90 void getGridLimits(
float &xmin,
float &xmax,
float &ymin,
float &ymax)
const
100 m_colorMap = colorMap;
151 static CMeshFastPtr
Create(
bool enableTransparency,
float xMin = -1.0f,
float xMax = 1.0f,
float yMin = -1.0f,
float yMax = 1.0f );
162 void assignImage(const
mrpt::utils::CImage& img );
166 void assignImageAndZ( const
mrpt::utils::CImage& img, const
mrpt::math::CMatrixTemplateNumeric<
float> &in_Z);
170 inline
void adjustGridToImageAR() {
172 const float ycenter = 0.5*(yMin+yMax);
173 const float xwidth = xMax - xMin;
174 const float newratio = float(m_textureImage.
getWidth())/float(m_textureImage.
getHeight());
175 yMax = ycenter + 0.5*newratio*xwidth;
176 yMin = ycenter - 0.5*newratio*xwidth;
184 CMeshFast(
bool enableTransparency =
false,
float xMin = -1.0f,
float xMax = 1.0f,
float yMin = -1.0f,
float yMax = 1.0f ) :
186 m_enableTransparency(enableTransparency),
189 X(0,0), Y(0,0), Z(0,0), C(0,0), C_r(0,0), C_g(0,0), C_b(0,0),
192 m_modified_Image(false),
193 xMin(xMin), xMax(xMax), yMin(yMin), yMax(yMax),
194 pointsUpToDate(false)
virtual ~CMeshFast()
Private, virtual destructor: only can be deleted from smart pointers.
mrpt::utils::CImage m_textureImage
mrpt::utils::TColormap m_colorMap
Used when m_colorFromZ is true.
void enablePointSmooth(bool enable=true)
void setXMin(const float &nxm)
TColormap
Different colormaps.
void getZ(mrpt::math::CMatrixFloat &out) const
Returns a reference to the internal Z matrix, allowing changing it efficiently.
void setYMax(const float &nym)
bool pointsUpToDate
Whether the coordinates of the points needs to be recalculated.
void setYMin(const float &nym)
bool m_enableTransparency
math::CMatrix C_r
Red Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
A renderizable object suitable for rendering with OpenGL's display lists.
static CMeshFastPtr Create(bool enableTransparency, float xMin=-1.0f, float xMax=1.0f, float yMin=-1.0f, float yMax=1.0f)
Class factory
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
void setGridLimits(float xmin, float xmax, float ymin, float ymax)
void render_dl() const MRPT_OVERRIDE
Render.
bool m_modified_Image
Whether C is not up-to-date wrt to the texture image.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void getYBounds(float &min, float &max) const
void setYBounds(const float &min, const float &max)
math::CMatrix C_b
Blue Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
A class for storing images as grayscale or RGB bitmaps.
void setPointSize(float p)
By default is 1.0.
void enableTransparency(bool v)
A matrix of dynamic size.
void updatePoints() const
math::CMatrix Y
Y(x,y): Y-coordinate of the point (x,y)
bool m_pointSmooth
Default: false.
math::CMatrix C_g
Green Component of the Color [0,1] for each cell, updated by updateColorsMatrix.
This class is a "CSerializable" wrapper for "CMatrixFloat".
void disablePointSmooth()
size_t getWidth() const MRPT_OVERRIDE
Returns the width of the image in pixels.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
size_t getHeight() const MRPT_OVERRIDE
Returns the height of the image in pixels.
void getGridLimits(float &xmin, float &xmax, float &ymin, float &ymax) const
void enableColorFromZ(bool v, mrpt::utils::TColormap colorMap=mrpt::utils::cmJET)
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
bool m_modified_Z
Whether C is not up-to-date wrt to Z.
A planar (XY) grid where each cell has an associated height and, optionally, a texture map.
void updateColorsMatrix() const
Called internally to assure C is updated.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
math::CMatrix X
X(x,y): X-coordinate of the point (x,y)
float m_pointSize
By default is 1.0.
math::CMatrix Z
Z(x,y): Z-coordinate of the point (x,y)
void getXBounds(float &min, float &max) const
float getPointSize() const
void setXMax(const float &nxm)
void setZ(const mrpt::math::CMatrixTemplateNumeric< float > &in_Z)
This method sets the matrix of heights for each position (cell) in the mesh grid.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
math::CMatrix C
Grayscale Color [0,1] for each cell, updated by updateColorsMatrix.
void setXBounds(const float &min, const float &max)
CMeshFast(bool enableTransparency=false, float xMin=-1.0f, float xMax=1.0f, float yMin=-1.0f, float yMax=1.0f)
Constructor.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |