MRPT logo

mrpt::opengl::CSetOfTexturedTriangles Class Reference

A set of textured triangles. More...

#include <mrpt/opengl/CSetOfTexturedTriangles.h>

Inheritance diagram for mrpt::opengl::CSetOfTexturedTriangles:

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

List of all members.

Classes

struct  TTriangle
 Triangle. More...
struct  TVertex
 Triangle vertex. More...

Public Member Functions

void render ()
 Render.
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.

Public Attributes

std::vector< TTrianglem_triangles
 Triangle array.

Protected Member Functions

void loadTextureInOpenGL ()
 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

Private Member Functions

 CSetOfTexturedTriangles ()
 Constructor.
virtual ~CSetOfTexturedTriangles ()
 Private, virtual destructor: only can be deleted from smart pointers.


Detailed Description

A set of textured triangles.

This class can be used to draw any solid, arbitrarily complex object with textures.

See also:
opengl::COpenGLScene

Definition at line 47 of file CSetOfTexturedTriangles.h.


Constructor & Destructor Documentation

mrpt::opengl::CSetOfTexturedTriangles::CSetOfTexturedTriangles (  )  [inline, private]

Constructor.

Definition at line 143 of file CSetOfTexturedTriangles.h.

virtual mrpt::opengl::CSetOfTexturedTriangles::~CSetOfTexturedTriangles (  )  [private, virtual]

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


Member Function Documentation

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.

static CSetOfTexturedTrianglesPtr mrpt::opengl::CSetOfTexturedTriangles::Create (  )  [inline, static]

Class factory.

Definition at line 109 of file CSetOfTexturedTriangles.h.

References mrpt::opengl::CSetOfTexturedTriangles.

void mrpt::opengl::CSetOfTexturedTriangles::loadTextureInOpenGL (  )  [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 (  )  [virtual]

Render.

Implements mrpt::opengl::CRenderizable.


Member Data Documentation

Definition at line 52 of file CSetOfTexturedTriangles.h.

Definition at line 54 of file CSetOfTexturedTriangles.h.

Definition at line 51 of file CSetOfTexturedTriangles.h.

Definition at line 55 of file CSetOfTexturedTriangles.h.

Definition at line 55 of file CSetOfTexturedTriangles.h.

Triangle array.

Definition at line 106 of file CSetOfTexturedTriangles.h.

Definition at line 58 of file CSetOfTexturedTriangles.h.

Definition at line 58 of file CSetOfTexturedTriangles.h.




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