MRPT logo

mrpt::opengl::CRenderizable Class Reference

The base class of 3D objects that can be directly rendered through OpenGL. More...

#include <mrpt/opengl/CRenderizable.h>

Inheritance diagram for mrpt::opengl::CRenderizable:

mrpt::utils::CSerializable 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 mrpt::opengl::CTexturedPlane

List of all members.

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 ()
CRenderizableclone () 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 setLocation (double x, double y, double z)
 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)
virtual void setColorG (const double g)
virtual void setColorB (const double b)
virtual void setColorA (const double a)
void setScale (float s)
 Scale to apply to the object, in all three axis (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, float &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


Detailed Description

The base class of 3D objects that can be directly rendered through OpenGL.

In this class there are a set of common properties to all 3D objects, mainly:

Definition at line 57 of file CRenderizable.h.


Constructor & Destructor Documentation

mrpt::opengl::CRenderizable::CRenderizable (  )  [inline]

Default constructor:.

Definition at line 82 of file CRenderizable.h.

virtual mrpt::opengl::CRenderizable::~CRenderizable (  )  [inline, virtual]

Definition at line 92 of file CRenderizable.h.


Member Function Documentation

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 95 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 76 of file CRenderizable.h.

mrpt::utils::TColorf mrpt::opengl::CRenderizable::getColor (  )  const [inline]

Returns the object color property as a TColorf.

Definition at line 132 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getColorA (  )  const [inline]

Color components in the range [0,1].

Definition at line 118 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getColorB (  )  const [inline]

Color components in the range [0,1].

Definition at line 117 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getColorG (  )  const [inline]

Color components in the range [0,1].

Definition at line 116 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getColorR (  )  const [inline]

Color components in the range [0,1].

Definition at line 115 of file CRenderizable.h.

std::string mrpt::opengl::CRenderizable::getName (  )  const [inline]

Returns the name of the object.

Definition at line 74 of file CRenderizable.h.

static unsigned int mrpt::opengl::CRenderizable::getNewTextureNumber (  )  [static, protected]

Returns the lowest, free texture name.

double mrpt::opengl::CRenderizable::getPosePitch (  )  const [inline]

Rotation relative to parent coordinate origin, in **DEGREES**.

Definition at line 112 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getPoseRoll (  )  const [inline]

Rotation relative to parent coordinate origin, in **DEGREES**.

Definition at line 113 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getPoseX (  )  const [inline]

Translation relative to parent coordinate origin.

Definition at line 108 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getPoseY (  )  const [inline]

Translation relative to parent coordinate origin.

Definition at line 109 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getPoseYaw (  )  const [inline]

Rotation relative to parent coordinate origin, in **DEGREES**.

Definition at line 111 of file CRenderizable.h.

double mrpt::opengl::CRenderizable::getPoseZ (  )  const [inline]

Translation relative to parent coordinate origin.

Definition at line 110 of file CRenderizable.h.

float mrpt::opengl::CRenderizable::getScaleX (  )  const [inline]

Get the current scaling factor in one axis.

Definition at line 127 of file CRenderizable.h.

float mrpt::opengl::CRenderizable::getScaleY (  )  const [inline]

Get the current scaling factor in one axis.

Definition at line 128 of file CRenderizable.h.

float mrpt::opengl::CRenderizable::getScaleZ (  )  const [inline]

Get the current scaling factor in one axis.

Definition at line 129 of file CRenderizable.h.

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]

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::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 133 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]

Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.

Definition at line 123 of file CRenderizable.h.

virtual void mrpt::opengl::CRenderizable::setColorB ( const double  b  )  [inline, virtual]

Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.

Definition at line 122 of file CRenderizable.h.

virtual void mrpt::opengl::CRenderizable::setColorG ( const double  g  )  [inline, virtual]

Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.

Definition at line 121 of file CRenderizable.h.

virtual void mrpt::opengl::CRenderizable::setColorR ( const double  r  )  [inline, virtual]

Reimplemented in mrpt::opengl::CSetOfObjects, and mrpt::opengl::CSetOfTriangles.

Definition at line 120 of file CRenderizable.h.

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 106 of file CRenderizable.h.

void mrpt::opengl::CRenderizable::setName ( const std::string &  n  )  [inline]

Changes the name of the object.

Definition at line 73 of file CRenderizable.h.

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 126 of file CRenderizable.h.

void mrpt::opengl::CRenderizable::setScale ( float  s  )  [inline]

Scale to apply to the object, in all three axis (default=1).

Definition at line 125 of file CRenderizable.h.

virtual bool mrpt::opengl::CRenderizable::traceRay ( const mrpt::poses::CPose3D o,
float &  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::COpenGLStandardObject, 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]


Friends And Related Function Documentation

friend class mrpt::opengl::COpenGLViewport [friend]

Definition at line 61 of file CRenderizable.h.

friend class mrpt::opengl::CSetOfObjects [friend]

Definition at line 62 of file CRenderizable.h.


Member Data Documentation

Color components in the range [0,1].

Definition at line 67 of file CRenderizable.h.

Definition at line 67 of file CRenderizable.h.

Definition at line 67 of file CRenderizable.h.

Definition at line 67 of file CRenderizable.h.

std::string mrpt::opengl::CRenderizable::m_name [protected]

Definition at line 65 of file CRenderizable.h.

Definition at line 69 of file CRenderizable.h.

Rotation relative to parent coordinate origin, in **DEGREES**.

Definition at line 69 of file CRenderizable.h.

Reimplemented in mrpt::opengl::C3DSScene.

Definition at line 70 of file CRenderizable.h.

Reimplemented in mrpt::opengl::C3DSScene.

Definition at line 70 of file CRenderizable.h.

Scale components to apply to the object (default=1).

Reimplemented in mrpt::opengl::C3DSScene.

Definition at line 70 of file CRenderizable.h.

Definition at line 66 of file CRenderizable.h.

Definition at line 68 of file CRenderizable.h.

Definition at line 68 of file CRenderizable.h.

Definition at line 69 of file CRenderizable.h.

Translation relative to parent coordinate origin.

Definition at line 68 of file CRenderizable.h.




Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:14:51 EST 2009