A 2D plane in the XY plane with a texture image. More...
#include <mrpt/opengl/CTexturedPlane.h>
Public Member Functions | |
void | setTextureCornerCoords (float tex_x_min, float tex_x_max, float tex_y_min, float tex_y_max) |
Set the texture coordinates of the four corners (in the range 0-1). | |
void | setPlaneCorners (float xMin, float xMax, float yMin, float yMax) |
Set the coordinates of the four corners that define the plane on the XY plane. | |
void | assignImage (const mrpt::utils::CImage &img, const mrpt::utils::CImage &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::CImage &img) |
Assigns a texture image, and disable transparency. | |
void | assignImage_fast (mrpt::utils::CImage &img, mrpt::utils::CImage &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::CImage &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 () const |
Render. | |
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. | |
virtual bool | traceRay (const mrpt::poses::CPose3D &o, double &dist) const |
Ray trace. | |
Static Public Member Functions | |
static CTexturedPlanePtr | Create (float x_min, float x_max, float y_min, float y_max) |
Class factory. | |
Protected Member Functions | |
void | updatePoly () const |
Protected Attributes | |
unsigned int | m_glTextureName |
bool | m_init |
mrpt::utils::CImage | m_textureImage |
mrpt::utils::CImage | m_textureImageAlpha |
bool | m_enableTransparency |
int | r_width |
int | r_height |
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 |
bool | polygonUpToDate |
std::vector < mrpt::math::TPolygonWithPlane > | tmpPoly |
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. |
A 2D plane in the XY plane with a texture image.
Definition at line 47 of file CTexturedPlane.h.
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.
void mrpt::opengl::CTexturedPlane::assignImage | ( | const mrpt::utils::CImage & | img | ) |
Assigns a texture image, and disable transparency.
void mrpt::opengl::CTexturedPlane::assignImage | ( | const mrpt::utils::CImage & | img, | |
const mrpt::utils::CImage & | 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::CImage & | 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::CImage & | img, | |
mrpt::utils::CImage & | 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, | |
float | x_max, | |||
float | y_min, | |||
float | y_max | |||
) | [inline, static] |
Class factory.
Definition at line 118 of file CTexturedPlane.h.
References mrpt::opengl::CTexturedPlane.
void mrpt::opengl::CTexturedPlane::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.
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 | ( | ) | const [virtual] |
Render.
Implements mrpt::opengl::CRenderizable.
void mrpt::opengl::CTexturedPlane::setPlaneCorners | ( | float | xMin, | |
float | xMax, | |||
float | yMin, | |||
float | yMax | |||
) | [inline] |
Set the coordinates of the four corners that define the plane on the XY plane.
Definition at line 78 of file CTexturedPlane.h.
void mrpt::opengl::CTexturedPlane::setTextureCornerCoords | ( | float | tex_x_min, | |
float | tex_x_max, | |||
float | tex_y_min, | |||
float | tex_y_max | |||
) | [inline] |
Set the texture coordinates of the four corners (in the range 0-1).
Definition at line 69 of file CTexturedPlane.h.
virtual bool mrpt::opengl::CTexturedPlane::traceRay | ( | const mrpt::poses::CPose3D & | o, | |
double & | dist | |||
) | const [virtual] |
Ray trace.
Reimplemented from mrpt::opengl::CRenderizable.
void mrpt::opengl::CTexturedPlane::updatePoly | ( | ) | const [protected] |
bool mrpt::opengl::CTexturedPlane::m_enableTransparency [mutable, protected] |
Definition at line 55 of file CTexturedPlane.h.
unsigned int mrpt::opengl::CTexturedPlane::m_glTextureName [mutable, protected] |
Definition at line 51 of file CTexturedPlane.h.
bool mrpt::opengl::CTexturedPlane::m_init [mutable, protected] |
Definition at line 52 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_tex_x_max [mutable, protected] |
Definition at line 58 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_tex_x_min [mutable, protected] |
Definition at line 58 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_tex_y_max [mutable, protected] |
Definition at line 59 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_tex_y_min [mutable, protected] |
Definition at line 59 of file CTexturedPlane.h.
mrpt::utils::CImage mrpt::opengl::CTexturedPlane::m_textureImage [mutable, protected] |
Definition at line 53 of file CTexturedPlane.h.
mrpt::utils::CImage mrpt::opengl::CTexturedPlane::m_textureImageAlpha [mutable, protected] |
Definition at line 54 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_xMax [protected] |
Definition at line 61 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_xMin [protected] |
Definition at line 61 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_yMax [protected] |
Definition at line 62 of file CTexturedPlane.h.
float mrpt::opengl::CTexturedPlane::m_yMin [protected] |
Definition at line 62 of file CTexturedPlane.h.
bool mrpt::opengl::CTexturedPlane::polygonUpToDate [mutable, protected] |
Definition at line 63 of file CTexturedPlane.h.
int mrpt::opengl::CTexturedPlane::r_height [mutable, protected] |
Definition at line 56 of file CTexturedPlane.h.
int mrpt::opengl::CTexturedPlane::r_width [mutable, protected] |
Definition at line 56 of file CTexturedPlane.h.
std::vector<mrpt::math::TPolygonWithPlane> mrpt::opengl::CTexturedPlane::tmpPoly [mutable, protected] |
Definition at line 64 of file CTexturedPlane.h.
Page generated by Doxygen 1.6.1 for MRPT 0.7.1 SVN: at Tue Dec 22 08:29:35 CET 2009 |