Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

mrpt::opengl::CMesh Class Reference


Detailed Description

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.

See also:
opengl::COpenGLScene
mrpt::opengl::CMesh
preview_CMesh.png

Definition at line 58 of file CMesh.h.

#include <mrpt/opengl/CMesh.h>

Inheritance diagram for mrpt::opengl::CMesh:
Inheritance graph
[legend]

List of all members.

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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CMeshPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 60 of file CMesh.h.


Constructor & Destructor Documentation

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]

Constructor.

Definition at line 190 of file CMesh.h.

virtual mrpt::opengl::CMesh::~CMesh (  ) [inline, private, virtual]

Private, virtual destructor: only can be deleted from smart pointers.

Definition at line 207 of file CMesh.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CMesh::_GetBaseClass (  ) [static, protected]
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]

Class factory.

Definition at line 170 of file CMesh.h.

References mrpt::opengl::CMesh.

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]

Definition at line 95 of file CMesh.h.

void mrpt::opengl::CMesh::getMask ( mrpt::math::CMatrixFloat out ) const [inline]

Returns a reference to the internal mask matrix, allowing changing it efficiently.

Definition at line 119 of file CMesh.h.

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]

Definition at line 149 of file CMesh.h.

float mrpt::opengl::CMesh::getXMax (  ) const [inline]

Definition at line 130 of file CMesh.h.

float mrpt::opengl::CMesh::getXMin (  ) const [inline]

Definition at line 129 of file CMesh.h.

void mrpt::opengl::CMesh::getYBounds ( float &  min,
float &  max 
) const [inline]

Definition at line 153 of file CMesh.h.

float mrpt::opengl::CMesh::getYMax (  ) const [inline]

Definition at line 132 of file CMesh.h.

float mrpt::opengl::CMesh::getYMin (  ) const [inline]

Definition at line 131 of file CMesh.h.

void mrpt::opengl::CMesh::getZ ( mrpt::math::CMatrixFloat out ) const [inline]

Returns a reference to the internal Z matrix, allowing changing it efficiently.

Definition at line 114 of file CMesh.h.

void mrpt::opengl::CMesh::render_dl (  ) const [virtual]
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.


Member Data Documentation

Definition at line 60 of file CMesh.h.

List of triangles in the mesh.

Definition at line 82 of file CMesh.h.

math::CMatrix mrpt::opengl::CMesh::C [mutable, protected]

Color [0,1] for each cell, updated by updateColorsMatrix.

Definition at line 71 of file CMesh.h.

Definition at line 60 of file CMesh.h.

Definition at line 60 of file CMesh.h.

Definition at line 65 of file CMesh.h.

Used when m_colorFromZ is true.

Definition at line 73 of file CMesh.h.

Definition at line 64 of file CMesh.h.

Definition at line 66 of file CMesh.h.

bool mrpt::opengl::CMesh::m_modified_Z [mutable, protected]

Whether C is not up-to-date wrt to Z.

Definition at line 75 of file CMesh.h.

Definition at line 62 of file CMesh.h.

Definition at line 69 of file CMesh.h.

bool mrpt::opengl::CMesh::polygonsUpToDate [mutable, protected]

Definition at line 84 of file CMesh.h.

Definition at line 85 of file CMesh.h.

bool mrpt::opengl::CMesh::trianglesUpToDate [mutable, protected]

Whether the actual mesh needs to be recalculated.

Definition at line 83 of file CMesh.h.

Definition at line 70 of file CMesh.h.

Texture coordinates.

Definition at line 70 of file CMesh.h.

float mrpt::opengl::CMesh::xMax [protected]

Definition at line 81 of file CMesh.h.

float mrpt::opengl::CMesh::xMin [protected]

Definition at line 81 of file CMesh.h.

float mrpt::opengl::CMesh::yMax [protected]

Mesh bounds.

Definition at line 81 of file CMesh.h.

float mrpt::opengl::CMesh::yMin [protected]

Definition at line 81 of file CMesh.h.

Z(x,y): Z-coordinate of the point (x,y)

Definition at line 68 of file CMesh.h.




Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011