MRPT logo

mrpt::opengl::CTexturedPlane Class Reference

A 2D plane in the XY plane with a texture image. More...

#include <mrpt/opengl/CTexturedPlane.h>

Inheritance diagram for mrpt::opengl::CTexturedPlane:

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

List of all members.

Public Member Functions

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

Static Public Member Functions

static CTexturedPlanePtr Create (float x_min=-1, float x_max=1, float y_min=-1, float y_max=1)
 Class factory.

Public Attributes

float m_tex_x_min
float m_tex_x_max
float m_tex_y_min
float m_tex_y_max
float m_xMin
float m_xMax
float m_yMin
float m_yMax

Protected Attributes

unsigned int m_glTextureName
bool m_init
mrpt::utils::CMRPTImage m_textureImage
mrpt::utils::CMRPTImage m_textureImageAlpha
bool m_enableTransparency
int r_width
int r_height

Private Member Functions

 CTexturedPlane (float x_min=-1, float x_max=1, float y_min=-1, float y_max=1)
 Constructor.
virtual ~CTexturedPlane ()
 Private, virtual destructor: only can be deleted from smart pointers.


Detailed Description

A 2D plane in the XY plane with a texture image.

See also:
opengl::COpenGLScene

Definition at line 46 of file CTexturedPlane.h.


Constructor & Destructor Documentation

mrpt::opengl::CTexturedPlane::CTexturedPlane ( float  x_min = -1,
float  x_max = 1,
float  y_min = -1,
float  y_max = 1 
) [private]

Constructor.

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

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


Member Function Documentation

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

Assigns a texture image, and disable transparency.

void mrpt::opengl::CTexturedPlane::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::CTexturedPlane::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::CTexturedPlane::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 CTexturedPlanePtr mrpt::opengl::CTexturedPlane::Create ( float  x_min = -1,
float  x_max = 1,
float  y_min = -1,
float  y_max = 1 
) [inline, static]

Class factory.

Definition at line 98 of file CTexturedPlane.h.

References mrpt::opengl::CTexturedPlane.

void mrpt::opengl::CTexturedPlane::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.

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::CTexturedPlane::render (  )  [virtual]

Render.

Implements mrpt::opengl::CRenderizable.


Member Data Documentation

Definition at line 54 of file CTexturedPlane.h.

Definition at line 50 of file CTexturedPlane.h.

Definition at line 51 of file CTexturedPlane.h.

Definition at line 59 of file CTexturedPlane.h.

Definition at line 59 of file CTexturedPlane.h.

Definition at line 60 of file CTexturedPlane.h.

Definition at line 60 of file CTexturedPlane.h.

Definition at line 52 of file CTexturedPlane.h.

Definition at line 53 of file CTexturedPlane.h.

Definition at line 62 of file CTexturedPlane.h.

Definition at line 62 of file CTexturedPlane.h.

Definition at line 63 of file CTexturedPlane.h.

Definition at line 63 of file CTexturedPlane.h.

Definition at line 56 of file CTexturedPlane.h.

Definition at line 56 of file CTexturedPlane.h.




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