A planar (XY) grid where each cell has an associated height and, optionally, a texture map.
A typical usage example would be an elevation map or a 3D model of a terrain.
Definition at line 58 of file CMesh.h.
#include <mrpt/opengl/CMesh.h>
Public Member Functions | |
void | setGridLimits (float xmin, float xmax, float ymin, float ymax) |
void | getGridLimits (float &xmin, float &xmax, float &ymin, float &ymax) const |
void | enableTransparency (bool v) |
void | enableWireFrame (bool v) |
void | enableColorFromZ (bool v, mrpt::utils::TColormap colorMap=mrpt::utils::cmJET) |
void | setZ (const mrpt::math::CMatrixTemplateNumeric< float > &in_Z) |
This method sets the matrix of heights for each position (cell) in the mesh grid. | |
void | getZ (mrpt::math::CMatrixFloat &out) const |
Returns a reference to the internal Z matrix, allowing changing it efficiently. | |
void | getMask (mrpt::math::CMatrixFloat &out) const |
Returns a reference to the internal mask matrix, allowing changing it efficiently. | |
void | setMask (const mrpt::math::CMatrixTemplateNumeric< float > &in_mask) |
This method sets the boolean mask of valid heights for each position (cell) in the mesh grid. | |
void | setUV (const mrpt::math::CMatrixTemplateNumeric< float > &in_U, const mrpt::math::CMatrixTemplateNumeric< float > &in_V) |
Sets the (u,v) texture coordinates (in range [0,1]) for each cell. | |
float | getXMin () const |
float | getXMax () const |
float | getYMin () const |
float | getYMax () const |
void | setXMin (const float &nxm) |
void | setXMax (const float &nxm) |
void | setYMin (const float &nym) |
void | setYMax (const float &nym) |
void | getXBounds (float &min, float &max) const |
void | getYBounds (float &min, float &max) const |
void | setXBounds (const float &min, const float &max) |
void | setYBounds (const float &min, const float &max) |
void | render_dl () const |
Render. | |
void | assignImage (const utils::CImage &img) |
Assigns a texture image, and disable transparency. | |
virtual bool | traceRay (const mrpt::poses::CPose3D &o, double &dist) const |
Trace ray. | |
Static Public Member Functions | |
static CMeshPtr | Create (bool enableTransparency, float xMin=0.0f, float xMax=0.0f, float yMin=0.0f, float yMax=0.0f) |
Class factory. | |
Protected Member Functions | |
void | updateColorsMatrix () const |
Called internally to assure C is updated. | |
void | updateTriangles () const |
Called internally to assure the triangle list is updated. | |
void | updatePolygons () const |
Protected Attributes | |
mrpt::utils::CImage | m_textureImage |
bool | m_enableTransparency |
bool | m_colorFromZ |
bool | m_isWireFrame |
math::CMatrix | Z |
Z(x,y): Z-coordinate of the point (x,y) | |
math::CMatrix | mask |
math::CMatrix | U |
math::CMatrix | V |
Texture coordinates. | |
math::CMatrix | C |
Color [0,1] for each cell, updated by updateColorsMatrix. | |
mrpt::utils::TColormap | m_colorMap |
Used when m_colorFromZ is true. | |
bool | m_modified_Z |
Whether C is not up-to-date wrt to Z. | |
float | xMin |
float | xMax |
float | yMin |
float | yMax |
Mesh bounds. | |
std::vector < CSetOfTriangles::TTriangle > | actualMesh |
List of triangles in the mesh. | |
bool | trianglesUpToDate |
Whether the actual mesh needs to be recalculated. | |
bool | polygonsUpToDate |
std::vector < mrpt::math::TPolygonWithPlane > | tmpPolys |
Private Member Functions | |
CMesh (bool enableTransparency=false, float xMin=0.0f, float xMax=0.0f, float yMin=0.0f, float yMax=0.0f) | |
Constructor. | |
virtual | ~CMesh () |
Private, virtual destructor: only can be deleted from smart pointers. | |
RTTI stuff | |
typedef CMeshPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CMesh |
static mrpt::utils::TRuntimeClassId | classCMesh |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CMeshPtr | Create () |
mrpt::opengl::CMesh::CMesh | ( | bool | enableTransparency = false , |
float | xMin = 0.0f , |
||
float | xMax = 0.0f , |
||
float | yMin = 0.0f , |
||
float | yMax = 0.0f |
||
) | [inline, private] |
virtual mrpt::opengl::CMesh::~CMesh | ( | ) | [inline, private, virtual] |
static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CMesh::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
void mrpt::opengl::CMesh::assignImage | ( | const utils::CImage & | img ) |
Assigns a texture image, and disable transparency.
static CMeshPtr mrpt::opengl::CMesh::Create | ( | ) | [static] |
static CMeshPtr mrpt::opengl::CMesh::Create | ( | bool | enableTransparency, |
float | xMin = 0.0f , |
||
float | xMax = 0.0f , |
||
float | yMin = 0.0f , |
||
float | yMax = 0.0f |
||
) | [inline, static] |
static mrpt::utils::CObject* mrpt::opengl::CMesh::CreateObject | ( | ) | [static] |
virtual mrpt::utils::CObject* mrpt::opengl::CMesh::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
void mrpt::opengl::CMesh::enableColorFromZ | ( | bool | v, |
mrpt::utils::TColormap | colorMap = mrpt::utils::cmJET |
||
) | [inline] |
Definition at line 103 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::enableTransparency | ( | bool | v ) | [inline] |
Definition at line 101 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::enableWireFrame | ( | bool | v ) | [inline] |
Definition at line 102 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::getGridLimits | ( | float & | xmin, |
float & | xmax, | ||
float & | ymin, | ||
float & | ymax | ||
) | const [inline] |
void mrpt::opengl::CMesh::getMask | ( | mrpt::math::CMatrixFloat & | out ) | const [inline] |
virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CMesh::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
void mrpt::opengl::CMesh::getXBounds | ( | float & | min, |
float & | max | ||
) | const [inline] |
void mrpt::opengl::CMesh::getYBounds | ( | float & | min, |
float & | max | ||
) | const [inline] |
void mrpt::opengl::CMesh::getZ | ( | mrpt::math::CMatrixFloat & | out ) | const [inline] |
void mrpt::opengl::CMesh::render_dl | ( | ) | const [virtual] |
Render.
Implements mrpt::opengl::CRenderizableDisplayList.
void mrpt::opengl::CMesh::setGridLimits | ( | float | xmin, |
float | xmax, | ||
float | ymin, | ||
float | ymax | ||
) | [inline] |
Definition at line 88 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setMask | ( | const mrpt::math::CMatrixTemplateNumeric< float > & | in_mask ) |
This method sets the boolean mask of valid heights for each position (cell) in the mesh grid.
void mrpt::opengl::CMesh::setUV | ( | const mrpt::math::CMatrixTemplateNumeric< float > & | in_U, |
const mrpt::math::CMatrixTemplateNumeric< float > & | in_V | ||
) |
Sets the (u,v) texture coordinates (in range [0,1]) for each cell.
void mrpt::opengl::CMesh::setXBounds | ( | const float & | min, |
const float & | max | ||
) | [inline] |
Definition at line 157 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setXMax | ( | const float & | nxm ) | [inline] |
Definition at line 137 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setXMin | ( | const float & | nxm ) | [inline] |
Definition at line 133 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setYBounds | ( | const float & | min, |
const float & | max | ||
) | [inline] |
Definition at line 162 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setYMax | ( | const float & | nym ) | [inline] |
Definition at line 145 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setYMin | ( | const float & | nym ) | [inline] |
Definition at line 141 of file CMesh.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CMesh::setZ | ( | const mrpt::math::CMatrixTemplateNumeric< float > & | in_Z ) |
This method sets the matrix of heights for each position (cell) in the mesh grid.
virtual bool mrpt::opengl::CMesh::traceRay | ( | const mrpt::poses::CPose3D & | o, |
double & | dist | ||
) | const [virtual] |
Trace ray.
Reimplemented from mrpt::opengl::CRenderizable.
void mrpt::opengl::CMesh::updateColorsMatrix | ( | ) | const [protected] |
Called internally to assure C is updated.
void mrpt::opengl::CMesh::updatePolygons | ( | ) | const [protected] |
void mrpt::opengl::CMesh::updateTriangles | ( | ) | const [protected] |
Called internally to assure the triangle list is updated.
mrpt::utils::CLASSINIT mrpt::opengl::CMesh::_init_CMesh [static, protected] |
std::vector<CSetOfTriangles::TTriangle> mrpt::opengl::CMesh::actualMesh [mutable, protected] |
math::CMatrix mrpt::opengl::CMesh::C [mutable, protected] |
const mrpt::utils::TRuntimeClassId* mrpt::opengl::CMesh::classinfo [static] |
bool mrpt::opengl::CMesh::m_colorFromZ [protected] |
bool mrpt::opengl::CMesh::m_enableTransparency [protected] |
bool mrpt::opengl::CMesh::m_isWireFrame [protected] |
bool mrpt::opengl::CMesh::m_modified_Z [mutable, protected] |
math::CMatrix mrpt::opengl::CMesh::mask [protected] |
bool mrpt::opengl::CMesh::polygonsUpToDate [mutable, protected] |
std::vector<mrpt::math::TPolygonWithPlane> mrpt::opengl::CMesh::tmpPolys [mutable, protected] |
bool mrpt::opengl::CMesh::trianglesUpToDate [mutable, protected] |
math::CMatrix mrpt::opengl::CMesh::U [protected] |
math::CMatrix mrpt::opengl::CMesh::V [protected] |
float mrpt::opengl::CMesh::xMax [protected] |
float mrpt::opengl::CMesh::xMin [protected] |
float mrpt::opengl::CMesh::yMax [protected] |
float mrpt::opengl::CMesh::yMin [protected] |
math::CMatrix mrpt::opengl::CMesh::Z [protected] |
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011 |