#include <mrpt/opengl/CRenderizable.h>
Public Member Functions | |
void | setName (const std::string &n) |
Changes the name of the object. | |
std::string | getName () const |
Returns the name of the object. | |
void | enableShowName (bool showName=true) |
Enables or disables showing the name of the object as a label when rendering. | |
CRenderizable () | |
Default constructor:. | |
virtual | ~CRenderizable () |
CRenderizable * | clone () const |
Interface for the stlplus smart pointer class. | |
virtual void | render () const =0 |
This virtual method in the base class performs common tasks like coordinates transformation,color,. | |
void | setPose (const mrpt::poses::CPose3D &o) |
Set the 3D pose from a mrpt::poses::CPose3D object. | |
void | setPose (const mrpt::math::TPose3D &o) |
Set the 3D pose from a mrpt::math::TPose3D object. | |
void | setPose (const mrpt::poses::CPoint3D &o) |
Set the 3D pose from a mrpt::poses::CPose3D object. | |
void | setPose (const mrpt::poses::CPoint2D &o) |
Set the 3D pose from a mrpt::poses::CPose3D object. | |
mrpt::math::TPose3D | getPose () const |
Returns the 3D pose of the object. | |
void | setLocation (double x, double y, double z) |
Changes the location of the object, keeping untouched the orientation. | |
void | setLocation (const mrpt::math::TPoint3D &p) |
Changes the location of the object, keeping untouched the orientation. | |
double | getPoseX () const |
Translation relative to parent coordinate origin. | |
double | getPoseY () const |
Translation relative to parent coordinate origin. | |
double | getPoseZ () const |
Translation relative to parent coordinate origin. | |
double | getPoseYaw () const |
Rotation relative to parent coordinate origin, in **DEGREES**. | |
double | getPosePitch () const |
Rotation relative to parent coordinate origin, in **DEGREES**. | |
double | getPoseRoll () const |
Rotation relative to parent coordinate origin, in **DEGREES**. | |
double | getColorR () const |
Color components in the range [0,1]. | |
double | getColorG () const |
Color components in the range [0,1]. | |
double | getColorB () const |
Color components in the range [0,1]. | |
double | getColorA () const |
Color components in the range [0,1]. | |
virtual void | setColorR (const double r) |
Color components in the range [0,1]. | |
virtual void | setColorG (const double g) |
Color components in the range [0,1]. | |
virtual void | setColorB (const double b) |
Color components in the range [0,1]. | |
virtual void | setColorA (const double a) |
Color components in the range [0,1]. | |
void | setScale (float s) |
Scale to apply to the object, in all three axes (default=1). | |
void | setScale (float sx, float sy, float sz) |
Scale to apply to the object in each axis (default=1). | |
float | getScaleX () const |
Get the current scaling factor in one axis. | |
float | getScaleY () const |
Get the current scaling factor in one axis. | |
float | getScaleZ () const |
Get the current scaling factor in one axis. | |
mrpt::utils::TColorf | getColor () const |
Returns the object color property as a TColorf. | |
virtual void | setColor (const mrpt::utils::TColorf &c) |
Changes the default object color. | |
virtual bool | traceRay (const mrpt::poses::CPose3D &o, double &dist) const |
Simulation of ray-trace, given a pose. | |
virtual void | setColor (double R, double G, double B, double A=1) |
Set the color components of this object (R,G,B,Alpha, in the range 0-1). | |
Static Public Member Functions | |
static void | renderTextBitmap (const char *str, void *fontStyle) |
Protected Member Functions | |
void | writeToStreamRender (utils::CStream &out) const |
void | readFromStreamRender (utils::CStream &in) |
Static Protected Member Functions | |
static void | checkOpenGLError () |
Checks glGetError and throws an exception if an error situation is found. | |
static unsigned int | getNewTextureNumber () |
Returns the lowest, free texture name. | |
static void | releaseTextureName (unsigned int i) |
Protected Attributes | |
std::string | m_name |
bool | m_show_name |
double | m_color_R |
double | m_color_G |
double | m_color_B |
double | m_color_A |
Color components in the range [0,1]. | |
double | m_x |
double | m_y |
double | m_z |
Translation relative to parent coordinate origin. | |
double | m_yaw |
double | m_pitch |
double | m_roll |
Rotation relative to parent coordinate origin, in **DEGREES**. | |
float | m_scale_x |
float | m_scale_y |
float | m_scale_z |
Scale components to apply to the object (default=1). | |
Friends | |
class | mrpt::opengl::COpenGLViewport |
class | mrpt::opengl::CSetOfObjects |
In this class there are a set of common properties to all 3D objects, mainly:
Definition at line 58 of file CRenderizable.h.
mrpt::opengl::CRenderizable::CRenderizable | ( | ) | [inline] |
virtual mrpt::opengl::CRenderizable::~CRenderizable | ( | ) | [inline, virtual] |
Definition at line 93 of file CRenderizable.h.
static void mrpt::opengl::CRenderizable::checkOpenGLError | ( | ) | [static, protected] |
Checks glGetError and throws an exception if an error situation is found.
CRenderizable* mrpt::opengl::CRenderizable::clone | ( | ) | const [inline] |
Interface for the stlplus smart pointer class.
Reimplemented from mrpt::utils::CSerializable.
Definition at line 96 of file CRenderizable.h.
void mrpt::opengl::CRenderizable::enableShowName | ( | bool | showName = true |
) | [inline] |
Enables or disables showing the name of the object as a label when rendering.
Definition at line 77 of file CRenderizable.h.
mrpt::utils::TColorf mrpt::opengl::CRenderizable::getColor | ( | ) | const [inline] |
double mrpt::opengl::CRenderizable::getColorA | ( | ) | const [inline] |
double mrpt::opengl::CRenderizable::getColorB | ( | ) | const [inline] |
double mrpt::opengl::CRenderizable::getColorG | ( | ) | const [inline] |
double mrpt::opengl::CRenderizable::getColorR | ( | ) | const [inline] |
std::string mrpt::opengl::CRenderizable::getName | ( | ) | const [inline] |
static unsigned int mrpt::opengl::CRenderizable::getNewTextureNumber | ( | ) | [static, protected] |
Returns the lowest, free texture name.
mrpt::math::TPose3D mrpt::opengl::CRenderizable::getPose | ( | ) | const |
Returns the 3D pose of the object.
double mrpt::opengl::CRenderizable::getPosePitch | ( | ) | const [inline] |
Rotation relative to parent coordinate origin, in **DEGREES**.
Definition at line 122 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::getPoseRoll | ( | ) | const [inline] |
Rotation relative to parent coordinate origin, in **DEGREES**.
Definition at line 123 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::getPoseX | ( | ) | const [inline] |
double mrpt::opengl::CRenderizable::getPoseY | ( | ) | const [inline] |
double mrpt::opengl::CRenderizable::getPoseYaw | ( | ) | const [inline] |
Rotation relative to parent coordinate origin, in **DEGREES**.
Definition at line 121 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::getPoseZ | ( | ) | const [inline] |
float mrpt::opengl::CRenderizable::getScaleX | ( | ) | const [inline] |
float mrpt::opengl::CRenderizable::getScaleY | ( | ) | const [inline] |
float mrpt::opengl::CRenderizable::getScaleZ | ( | ) | const [inline] |
void mrpt::opengl::CRenderizable::readFromStreamRender | ( | utils::CStream & | in | ) | [protected] |
static void mrpt::opengl::CRenderizable::releaseTextureName | ( | unsigned int | i | ) | [static, protected] |
virtual void mrpt::opengl::CRenderizable::render | ( | ) | const [pure virtual] |
This virtual method in the base class performs common tasks like coordinates transformation,color,.
..
Implemented in mrpt::opengl::C3DSScene, mrpt::opengl::CAngularObservationMesh, mrpt::opengl::CArrow, mrpt::opengl::CAxis, mrpt::opengl::CCamera, mrpt::opengl::CCylinder, mrpt::opengl::CDisk, mrpt::opengl::CEllipsoid, mrpt::opengl::CGeneralizedCylinder, mrpt::opengl::CGridPlaneXY, mrpt::opengl::CGridPlaneXZ, mrpt::opengl::CMesh, mrpt::opengl::COpenGLStandardObject, mrpt::opengl::CPlanarLaserScan, mrpt::opengl::CPointCloud, mrpt::opengl::CPointCloudColoured, mrpt::opengl::CPolyhedron, mrpt::opengl::CSetOfLines, mrpt::opengl::CSetOfObjects, mrpt::opengl::CSetOfTexturedTriangles, mrpt::opengl::CSetOfTriangles, mrpt::opengl::CSimpleLine, mrpt::opengl::CSphere, mrpt::opengl::CText, and mrpt::opengl::CTexturedPlane.
static void mrpt::opengl::CRenderizable::renderTextBitmap | ( | const char * | str, | |
void * | fontStyle | |||
) | [static] |
virtual void mrpt::opengl::CRenderizable::setColor | ( | double | R, | |
double | G, | |||
double | B, | |||
double | A = 1 | |||
) | [virtual] |
Set the color components of this object (R,G,B,Alpha, in the range 0-1).
Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.
virtual void mrpt::opengl::CRenderizable::setColor | ( | const mrpt::utils::TColorf & | c | ) | [inline, virtual] |
Changes the default object color.
Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.
Definition at line 143 of file CRenderizable.h.
References mrpt::utils::TColorf::A, mrpt::utils::TColorf::B, mrpt::utils::TColorf::G, and mrpt::utils::TColorf::R.
virtual void mrpt::opengl::CRenderizable::setColorA | ( | const double | a | ) | [inline, virtual] |
Color components in the range [0,1].
Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.
Definition at line 133 of file CRenderizable.h.
virtual void mrpt::opengl::CRenderizable::setColorB | ( | const double | b | ) | [inline, virtual] |
Color components in the range [0,1].
Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.
Definition at line 132 of file CRenderizable.h.
virtual void mrpt::opengl::CRenderizable::setColorG | ( | const double | g | ) | [inline, virtual] |
Color components in the range [0,1].
Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.
Definition at line 131 of file CRenderizable.h.
virtual void mrpt::opengl::CRenderizable::setColorR | ( | const double | r | ) | [inline, virtual] |
Color components in the range [0,1].
Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.
Definition at line 130 of file CRenderizable.h.
void mrpt::opengl::CRenderizable::setLocation | ( | const mrpt::math::TPoint3D & | p | ) | [inline] |
Changes the location of the object, keeping untouched the orientation.
Definition at line 116 of file CRenderizable.h.
References mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
void mrpt::opengl::CRenderizable::setLocation | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
Changes the location of the object, keeping untouched the orientation.
Definition at line 113 of file CRenderizable.h.
void mrpt::opengl::CRenderizable::setName | ( | const std::string & | n | ) | [inline] |
void mrpt::opengl::CRenderizable::setPose | ( | const mrpt::poses::CPoint2D & | o | ) |
Set the 3D pose from a mrpt::poses::CPose3D object.
void mrpt::opengl::CRenderizable::setPose | ( | const mrpt::poses::CPoint3D & | o | ) |
Set the 3D pose from a mrpt::poses::CPose3D object.
void mrpt::opengl::CRenderizable::setPose | ( | const mrpt::math::TPose3D & | o | ) |
Set the 3D pose from a mrpt::math::TPose3D object.
void mrpt::opengl::CRenderizable::setPose | ( | const mrpt::poses::CPose3D & | o | ) |
Set the 3D pose from a mrpt::poses::CPose3D object.
void mrpt::opengl::CRenderizable::setScale | ( | float | sx, | |
float | sy, | |||
float | sz | |||
) | [inline] |
Scale to apply to the object in each axis (default=1).
Definition at line 136 of file CRenderizable.h.
void mrpt::opengl::CRenderizable::setScale | ( | float | s | ) | [inline] |
Scale to apply to the object, in all three axes (default=1).
Definition at line 135 of file CRenderizable.h.
virtual bool mrpt::opengl::CRenderizable::traceRay | ( | const mrpt::poses::CPose3D & | o, | |
double & | dist | |||
) | const [virtual] |
Simulation of ray-trace, given a pose.
Returns true if the ray effectively collisions with the object (returning the distance to the origin of the ray in "dist"), or false in other case. "dist" variable yields undefined behaviour when false is returned
Reimplemented in mrpt::opengl::C3DSScene, mrpt::opengl::CAngularObservationMesh, mrpt::opengl::CCylinder, mrpt::opengl::CDisk, mrpt::opengl::CEllipsoid, mrpt::opengl::CGeneralizedCylinder, mrpt::opengl::CMesh, mrpt::opengl::CPolyhedron, mrpt::opengl::CSetOfObjects, mrpt::opengl::CSetOfTexturedTriangles, mrpt::opengl::CSetOfTriangles, mrpt::opengl::CSphere, and mrpt::opengl::CTexturedPlane.
void mrpt::opengl::CRenderizable::writeToStreamRender | ( | utils::CStream & | out | ) | const [protected] |
friend class mrpt::opengl::COpenGLViewport [friend] |
Definition at line 62 of file CRenderizable.h.
friend class mrpt::opengl::CSetOfObjects [friend] |
Definition at line 63 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_color_A [protected] |
double mrpt::opengl::CRenderizable::m_color_B [protected] |
Definition at line 68 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_color_G [protected] |
Definition at line 68 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_color_R [protected] |
Definition at line 68 of file CRenderizable.h.
std::string mrpt::opengl::CRenderizable::m_name [protected] |
Definition at line 66 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_pitch [protected] |
Definition at line 70 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_roll [protected] |
Rotation relative to parent coordinate origin, in **DEGREES**.
Definition at line 70 of file CRenderizable.h.
float mrpt::opengl::CRenderizable::m_scale_x [protected] |
float mrpt::opengl::CRenderizable::m_scale_y [protected] |
float mrpt::opengl::CRenderizable::m_scale_z [protected] |
Scale components to apply to the object (default=1).
Reimplemented in mrpt::opengl::C3DSScene.
Definition at line 71 of file CRenderizable.h.
bool mrpt::opengl::CRenderizable::m_show_name [protected] |
Definition at line 67 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_x [protected] |
Definition at line 69 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_y [protected] |
Definition at line 69 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_yaw [protected] |
Definition at line 70 of file CRenderizable.h.
double mrpt::opengl::CRenderizable::m_z [protected] |
Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 22:58:25 EDT 2009 |