#include <mrpt/opengl/CSetOfTexturedTriangles.h>
Classes | |
struct | TTriangle |
Triangle. More... | |
struct | TVertex |
Triangle vertex. More... | |
Public Member Functions | |
void | clearTriangles () |
size_t | getTrianglesCount () const |
void | getTriangle (size_t idx, TTriangle &t) const |
void | insertTriangle (const TTriangle &t) |
void | render () const |
Render. | |
virtual bool | traceRay (const mrpt::poses::CPose3D &o, float &dist) const |
Ray Trace. | |
void | assignImage (const mrpt::utils::CMRPTImage &img, const mrpt::utils::CMRPTImage &imgAlpha) |
Assigns a texture and a transparency image, and enables transparency (If the images are not 2^N x 2^M, they will be internally filled to its dimensions to be powers of two). | |
void | assignImage (const mrpt::utils::CMRPTImage &img) |
Assigns a texture image, and disable transparency. | |
void | assignImage_fast (mrpt::utils::CMRPTImage &img, mrpt::utils::CMRPTImage &imgAlpha) |
Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer. | |
void | assignImage_fast (mrpt::utils::CMRPTImage &img) |
Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer. | |
Static Public Member Functions | |
static CSetOfTexturedTrianglesPtr | Create () |
Class factory. | |
Protected Member Functions | |
void | loadTextureInOpenGL () const |
VERY IMPORTANT: If you use a multi-thread application, you MUST call this from the same thread that will later destruct the object in order to the OpenGL texture memory to be correctly deleted. | |
Protected Attributes | |
bool | m_init |
bool | m_enableTransparency |
unsigned int | m_glTextureName |
mrpt::utils::CMRPTImage | m_textureImage |
mrpt::utils::CMRPTImage | m_textureImageAlpha |
int | r_width |
int | r_height |
std::vector< TTriangle > | m_triangles |
Triangle array. | |
Private Member Functions | |
CSetOfTexturedTriangles () | |
Constructor. | |
virtual | ~CSetOfTexturedTriangles () |
Private, virtual destructor: only can be deleted from smart pointers. |
This class can be used to draw any solid, arbitrarily complex object with textures.
Definition at line 47 of file CSetOfTexturedTriangles.h.
mrpt::opengl::CSetOfTexturedTriangles::CSetOfTexturedTriangles | ( | ) | [inline, private] |
virtual mrpt::opengl::CSetOfTexturedTriangles::~CSetOfTexturedTriangles | ( | ) | [private, virtual] |
Private, virtual destructor: only can be deleted from smart pointers.
void mrpt::opengl::CSetOfTexturedTriangles::assignImage | ( | const mrpt::utils::CMRPTImage & | img | ) |
Assigns a texture image, and disable transparency.
void mrpt::opengl::CSetOfTexturedTriangles::assignImage | ( | const mrpt::utils::CMRPTImage & | img, | |
const mrpt::utils::CMRPTImage & | imgAlpha | |||
) |
Assigns a texture and a transparency image, and enables transparency (If the images are not 2^N x 2^M, they will be internally filled to its dimensions to be powers of two).
void mrpt::opengl::CSetOfTexturedTriangles::assignImage_fast | ( | mrpt::utils::CMRPTImage & | img | ) |
Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer.
void mrpt::opengl::CSetOfTexturedTriangles::assignImage_fast | ( | mrpt::utils::CMRPTImage & | img, | |
mrpt::utils::CMRPTImage & | imgAlpha | |||
) |
Similar to assignImage, but the passed images will be returned as empty: it avoids making a copy of the whole image, just copies a pointer.
void mrpt::opengl::CSetOfTexturedTriangles::clearTriangles | ( | ) | [inline] |
Definition at line 107 of file CSetOfTexturedTriangles.h.
static CSetOfTexturedTrianglesPtr mrpt::opengl::CSetOfTexturedTriangles::Create | ( | ) | [inline, static] |
Class factory.
Definition at line 114 of file CSetOfTexturedTriangles.h.
References mrpt::opengl::CSetOfTexturedTriangles.
void mrpt::opengl::CSetOfTexturedTriangles::getTriangle | ( | size_t | idx, | |
TTriangle & | t | |||
) | const [inline] |
size_t mrpt::opengl::CSetOfTexturedTriangles::getTrianglesCount | ( | ) | const [inline] |
Definition at line 108 of file CSetOfTexturedTriangles.h.
void mrpt::opengl::CSetOfTexturedTriangles::insertTriangle | ( | const TTriangle & | t | ) | [inline] |
Definition at line 110 of file CSetOfTexturedTriangles.h.
void mrpt::opengl::CSetOfTexturedTriangles::loadTextureInOpenGL | ( | ) | const [protected] |
VERY IMPORTANT: If you use a multi-thread application, you MUST call this from the same thread that will later destruct the object in order to the OpenGL texture memory to be correctly deleted.
Calling this method more than once has no effects. If you user one thread, this method will be automatically called when rendering, so there is no need to explicitly call it.
void mrpt::opengl::CSetOfTexturedTriangles::render | ( | ) | const [virtual] |
virtual bool mrpt::opengl::CSetOfTexturedTriangles::traceRay | ( | const mrpt::poses::CPose3D & | o, | |
float & | dist | |||
) | const [virtual] |
bool mrpt::opengl::CSetOfTexturedTriangles::m_enableTransparency [mutable, protected] |
Definition at line 91 of file CSetOfTexturedTriangles.h.
unsigned int mrpt::opengl::CSetOfTexturedTriangles::m_glTextureName [mutable, protected] |
Definition at line 92 of file CSetOfTexturedTriangles.h.
bool mrpt::opengl::CSetOfTexturedTriangles::m_init [mutable, protected] |
Definition at line 90 of file CSetOfTexturedTriangles.h.
mrpt::utils::CMRPTImage mrpt::opengl::CSetOfTexturedTriangles::m_textureImage [mutable, protected] |
Definition at line 93 of file CSetOfTexturedTriangles.h.
mrpt::utils::CMRPTImage mrpt::opengl::CSetOfTexturedTriangles::m_textureImageAlpha [mutable, protected] |
Definition at line 93 of file CSetOfTexturedTriangles.h.
std::vector<TTriangle> mrpt::opengl::CSetOfTexturedTriangles::m_triangles [protected] |
int mrpt::opengl::CSetOfTexturedTriangles::r_height [mutable, protected] |
Definition at line 95 of file CSetOfTexturedTriangles.h.
int mrpt::opengl::CSetOfTexturedTriangles::r_width [mutable, protected] |
Definition at line 95 of file CSetOfTexturedTriangles.h.
Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN: at Sun Aug 2 11:39:56 CDT 2009 |