MRPT logo

mrpt::opengl::CMesh Class Reference

A set of connected colored triangles. More...

#include <mrpt/opengl/CMesh.h>

Inheritance diagram for mrpt::opengl::CMesh:

mrpt::opengl::CRenderizable mrpt::utils::CSerializable

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::vision::TColormap colorMap=mrpt::vision::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 () const
 Render.
void assignImage (const utils::CMRPTImage &img)
 Assigns a texture image, and disable transparency.
virtual bool traceRay (const mrpt::poses::CPose3D &o, float &dist) const
 Trace ray.

Static Public Member Functions

static CMeshPtr Create (bool enableTransparency=false, 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.

Protected Attributes

mrpt::utils::CMRPTImage 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::vision::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.

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.


Detailed Description

A set of connected colored triangles.

This class can be used to draw any solid, arbitrarily complex object (without textures).

See also:
opengl::COpenGLScene

Definition at line 51 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 191 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 208 of file CMesh.h.


Member Function Documentation

void mrpt::opengl::CMesh::assignImage ( const utils::CMRPTImage img  ) 

Assigns a texture image, and disable transparency.

static CMeshPtr mrpt::opengl::CMesh::Create ( bool  enableTransparency = false,
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.

void mrpt::opengl::CMesh::enableColorFromZ ( bool  v,
mrpt::vision::TColormap  colorMap = mrpt::vision::cmJET 
) [inline]

Definition at line 92 of file CMesh.h.

void mrpt::opengl::CMesh::enableTransparency ( bool  v  )  [inline]

Definition at line 90 of file CMesh.h.

void mrpt::opengl::CMesh::enableWireFrame ( bool  v  )  [inline]

Definition at line 91 of file CMesh.h.

void mrpt::opengl::CMesh::getGridLimits ( float &  xmin,
float &  xmax,
float &  ymin,
float &  ymax 
) const [inline]

Definition at line 84 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 110 of file CMesh.h.

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 124 of file CMesh.h.

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

Definition at line 121 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 130 of file CMesh.h.

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

Definition at line 127 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 103 of file CMesh.h.

void mrpt::opengl::CMesh::render (  )  const [virtual]

Render.

Implements mrpt::opengl::CRenderizable.

void mrpt::opengl::CMesh::setGridLimits ( float  xmin,
float  xmax,
float  ymin,
float  ymax 
) [inline]

Definition at line 78 of file CMesh.h.

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.

void mrpt::opengl::CMesh::setXMax ( const float &  nxm  )  [inline]

Definition at line 137 of file CMesh.h.

void mrpt::opengl::CMesh::setXMin ( const float &  nxm  )  [inline]

Definition at line 133 of file CMesh.h.

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

Definition at line 162 of file CMesh.h.

void mrpt::opengl::CMesh::setYMax ( const float &  nym  )  [inline]

Definition at line 145 of file CMesh.h.

void mrpt::opengl::CMesh::setYMin ( const float &  nym  )  [inline]

Definition at line 141 of file CMesh.h.

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,
float &  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::updateTriangles (  )  const [protected]

Called internally to assure the triangle list is updated.


Member Data Documentation

List of triangles in the mesh.

Definition at line 74 of file CMesh.h.

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

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

Definition at line 64 of file CMesh.h.

Definition at line 58 of file CMesh.h.

Used when m_colorFromZ is true.

Definition at line 66 of file CMesh.h.

Definition at line 57 of file CMesh.h.

Definition at line 59 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 68 of file CMesh.h.

Definition at line 55 of file CMesh.h.

Definition at line 62 of file CMesh.h.

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

Whether the actual mesh needs to be recalculated.

Definition at line 75 of file CMesh.h.

Definition at line 63 of file CMesh.h.

Texture coordinates.

Definition at line 63 of file CMesh.h.

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

Definition at line 73 of file CMesh.h.

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

Definition at line 73 of file CMesh.h.

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

Mesh bounds.

Definition at line 73 of file CMesh.h.

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

Definition at line 73 of file CMesh.h.

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

Definition at line 61 of file CMesh.h.




Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN: at Sun Aug 2 11:39:56 CDT 2009