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 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.
mrpt::math::CMatrixFloatgetZ ()
 Returns a reference to the internal Z matrix, allowing changing it efficiently.
mrpt::math::CMatrixFloatgetMask ()
 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.
void render ()
 Render.
void assignImage (const utils::CMRPTImage &img)
 Assigns a texture image, and disable transparency.

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.

Public Attributes

float xMin
float xMax
float yMin
float yMax

Protected Member Functions

void updateColorsMatrix ()
 Called internally to assure C 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.

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 50 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 116 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 132 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 99 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 75 of file CMesh.h.

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

Definition at line 73 of file CMesh.h.

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

Definition at line 74 of file CMesh.h.

mrpt::math::CMatrixFloat& mrpt::opengl::CMesh::getMask (  ) 

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

mrpt::math::CMatrixFloat& mrpt::opengl::CMesh::getZ (  ) 

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

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

Render.

Implements mrpt::opengl::CRenderizable.

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::setZ ( const mrpt::math::CMatrixTemplateNumeric< float > &  in_Z  ) 

This method sets the matrix of heights for each position (cell) in the mesh grid.

void mrpt::opengl::CMesh::updateColorsMatrix (  )  [protected]

Called internally to assure C is updated.


Member Data Documentation

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

Definition at line 63 of file CMesh.h.

Definition at line 57 of file CMesh.h.

Used when m_colorFromZ is true.

Definition at line 65 of file CMesh.h.

Definition at line 56 of file CMesh.h.

Definition at line 58 of file CMesh.h.

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

Definition at line 67 of file CMesh.h.

Definition at line 54 of file CMesh.h.

Definition at line 61 of file CMesh.h.

Definition at line 62 of file CMesh.h.

Texture coordinates.

Definition at line 62 of file CMesh.h.

Definition at line 96 of file CMesh.h.

Definition at line 96 of file CMesh.h.

Definition at line 96 of file CMesh.h.

Definition at line 96 of file CMesh.h.

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

Definition at line 60 of file CMesh.h.




Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009