Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Private Attributes

mrpt::opengl::CRenderizableDisplayList Class Reference


Detailed Description

A renderizable object suitable for rendering with OpenGL's display lists.

The idea is to use the derived classes' ::render() method to save all the primitives into one display list, then in subsequent rendering events, just execute the list. This method is normally faster since it avoids the bottleneck between CPU-GPU. On the other hand, it demands more memory on the graphic card.

Instructions for implementing derived classes:

See also:
mrpt::opengl::CRenderizable

Definition at line 54 of file CRenderizableDisplayList.h.

#include <mrpt/opengl/CRenderizableDisplayList.h>

Inheritance diagram for mrpt::opengl::CRenderizableDisplayList:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CRenderizableDisplayList ()
virtual ~CRenderizableDisplayList ()
CRenderizableDisplayListclone () const
 Interface for the stlplus smart pointer class.
virtual void render () const
 Render the object, regenerating the display list if needed, otherwise just calling it.
Changes the appearance of the object to render (methods from CRenderizable that need to be redefined)
virtual CRenderizablesetColorR (const double r)
 Color components in the range [0,1].
virtual CRenderizablesetColorG (const double g)
 Color components in the range [0,1].
virtual CRenderizablesetColorB (const double b)
 Color components in the range [0,1].
virtual CRenderizablesetColorA (const double a)
 Color components in the range [0,1].
virtual CRenderizablesetColor (const mrpt::utils::TColorf &c)
 Changes the default object color.
virtual CRenderizablesetColor (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)

Protected Member Functions

Methods accesible or implemented by derived classes
EIGEN_STRONG_INLINE void notifyChange () const
 Must be called to notify that the object has changed (so, the display list must be updated)
virtual void render_dl () const =0
 Derived classes must implement this method to the render the object.
virtual bool should_skip_display_list_cache () const
 Optional: If the object has some state in which creating a display list is NOT preferred over direct rendering, implement this method and return "true" in those cases.
void readFromStreamRender (mrpt::utils::CStream &in)

Private Attributes

unsigned int m_dl
 Display list ID, for derived classes that want to use it (it's automatically deleted and freed on destruction of this base class).
bool m_dl_recreate
 If using display lists, this is true when the list must be updated (the object changes, it's the first rendering, etc...).

RTTI stuff

static const
mrpt::utils::TRuntimeClassId 
classCRenderizableDisplayList
class mrpt::utils::CStream
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime.

Constructor & Destructor Documentation

mrpt::opengl::CRenderizableDisplayList::CRenderizableDisplayList ( )
virtual mrpt::opengl::CRenderizableDisplayList::~CRenderizableDisplayList ( ) [virtual]

Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CRenderizableDisplayList::_GetBaseClass ( ) [static, protected]
CRenderizableDisplayList* mrpt::opengl::CRenderizableDisplayList::clone ( ) const [inline]

Interface for the stlplus smart pointer class.

Reimplemented from mrpt::opengl::CRenderizable.

Definition at line 89 of file CRenderizableDisplayList.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CRenderizableDisplayList::GetRuntimeClass ( ) const [virtual]
EIGEN_STRONG_INLINE void mrpt::opengl::CRenderizableDisplayList::notifyChange ( ) const [inline, protected]

Must be called to notify that the object has changed (so, the display list must be updated)

Definition at line 67 of file CRenderizableDisplayList.h.

Referenced by mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtEnd(), mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtStart(), mrpt::opengl::CSetOfLines::appendLine(), mrpt::opengl::CSetOfLines::appendLines(), mrpt::opengl::CSetOfLines::begin(), mrpt::opengl::CSetOfLines::clear(), mrpt::opengl::CSetOfTriangles::clearTriangles(), mrpt::opengl::CSetOfTexturedTriangles::clearTriangles(), mrpt::opengl::COpenGLStandardObject::disable(), mrpt::opengl::COpenGLStandardObject::enable(), mrpt::opengl::CMesh::enableColorFromZ(), mrpt::opengl::CEllipsoid::enableDrawSolid3D(), mrpt::opengl::C3DSScene::enableExtraAmbientLight(), mrpt::opengl::CSphere::enableRadiusIndependentOfEyeDistance(), mrpt::opengl::CAxis::enableTickMarks(), mrpt::opengl::CSetOfTriangles::enableTransparency(), mrpt::opengl::CMesh::enableTransparency(), mrpt::opengl::CAngularObservationMesh::enableTransparency(), mrpt::opengl::CMesh::enableWireFrame(), mrpt::opengl::CSetOfLines::end(), mrpt::opengl::CSetOfTexturedTriangles::getTriangle(), mrpt::opengl::CSetOfTriangles::insertTriangle(), mrpt::opengl::CSetOfTexturedTriangles::insertTriangle(), mrpt::opengl::CSetOfTriangles::insertTriangles(), mrpt::opengl::CSetOfTriangles::reserve(), mrpt::opengl::CSetOfLines::reserve(), mrpt::opengl::CSetOfLines::resize(), mrpt::opengl::CEllipsoid::set2DsegmentsCount(), mrpt::opengl::CEllipsoid::set3DsegmentsCount(), mrpt::opengl::CGeneralizedCylinder::setAllSectionsInvisible(), mrpt::opengl::CGeneralizedCylinder::setAllSectionsVisible(), mrpt::opengl::CArrow::setArrowEnds(), mrpt::opengl::CArrow::setArrowYawPitchRoll(), mrpt::opengl::CGeneralizedCylinder::setAxis(), mrpt::opengl::CAxis::setAxisLimits(), mrpt::opengl::CGeneralizedCylinder::setClosed(), mrpt::opengl::CDisk::setDiskRadius(), mrpt::opengl::COpenGLStandardObject::setFlags(), mrpt::opengl::CAxis::setFrequency(), mrpt::opengl::CGeneralizedCylinder::setGeneratrix(), mrpt::opengl::CGridPlaneXZ::setGridFrequency(), mrpt::opengl::CGridPlaneXY::setGridFrequency(), mrpt::opengl::CMesh::setGridLimits(), mrpt::opengl::CCylinder::setHasBases(), mrpt::opengl::CArrow::setHeadRatio(), mrpt::opengl::CCylinder::setHeight(), mrpt::opengl::CArrow::setLargeRadius(), mrpt::opengl::CSetOfLines::setLineByIndex(), mrpt::opengl::CSimpleLine::setLineCoords(), mrpt::opengl::CSimpleLine::setLineWidth(), mrpt::opengl::CSetOfLines::setLineWidth(), mrpt::opengl::CPolyhedron::setLineWidth(), mrpt::opengl::CBox::setLineWidth(), mrpt::opengl::CAxis::setLineWidth(), mrpt::opengl::CDisk::setLoopsCount(), mrpt::opengl::COpenGLStandardObject::setNormal(), mrpt::opengl::CSphere::setNumberDivsLatitude(), mrpt::opengl::CSphere::setNumberDivsLongitude(), mrpt::opengl::CTexturedPlane::setPlaneCorners(), mrpt::opengl::CGridPlaneXZ::setPlaneLimits(), mrpt::opengl::CGridPlaneXY::setPlaneLimits(), mrpt::opengl::CGridPlaneXZ::setPlaneYcoord(), mrpt::opengl::CGridPlaneXY::setPlaneZcoord(), mrpt::opengl::CEllipsoid::setQuantiles(), mrpt::opengl::CCylinder::setRadii(), mrpt::opengl::CSphere::setRadius(), mrpt::opengl::CCylinder::setRadius(), mrpt::opengl::CPlanarLaserScan::setScan(), mrpt::opengl::CDisk::setSlicesCount(), mrpt::opengl::CCylinder::setSlicesCount(), mrpt::opengl::CArrow::setSmallRadius(), mrpt::opengl::CCylinder::setStacksCount(), mrpt::opengl::CTexturedPlane::setTextureCornerCoords(), mrpt::opengl::CGeneralizedCylinder::setVisibleSections(), mrpt::opengl::CPolyhedron::setWireframe(), mrpt::opengl::CBox::setWireframe(), mrpt::opengl::CAngularObservationMesh::setWireframe(), mrpt::opengl::CMesh::setXBounds(), mrpt::opengl::CMesh::setXMax(), mrpt::opengl::CMesh::setXMin(), mrpt::opengl::CMesh::setYBounds(), mrpt::opengl::CMesh::setYMax(), and mrpt::opengl::CMesh::setYMin().

void mrpt::opengl::CRenderizableDisplayList::readFromStreamRender ( mrpt::utils::CStream in) [inline, protected]
virtual void mrpt::opengl::CRenderizableDisplayList::render ( ) const [virtual]

Render the object, regenerating the display list if needed, otherwise just calling it.

Implements mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CRenderizableDisplayList::render_dl ( ) const [protected, pure virtual]
virtual CRenderizable& mrpt::opengl::CRenderizableDisplayList::setColor ( const mrpt::utils::TColorf c) [virtual]

Changes the default object color.

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

virtual CRenderizable& mrpt::opengl::CRenderizableDisplayList::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)

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

virtual CRenderizable& mrpt::opengl::CRenderizableDisplayList::setColorA ( const double  a) [inline, virtual]

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 104 of file CRenderizableDisplayList.h.

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

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 103 of file CRenderizableDisplayList.h.

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

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 102 of file CRenderizableDisplayList.h.

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

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 101 of file CRenderizableDisplayList.h.

virtual bool mrpt::opengl::CRenderizableDisplayList::should_skip_display_list_cache ( ) const [inline, protected, virtual]

Optional: If the object has some state in which creating a display list is NOT preferred over direct rendering, implement this method and return "true" in those cases.

Reimplemented in mrpt::opengl::CSphere.

Definition at line 74 of file CRenderizableDisplayList.h.


Friends And Related Function Documentation

friend class mrpt::utils::CStream [friend]

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CTexturedObject.

Definition at line 56 of file CRenderizableDisplayList.h.


Member Data Documentation

Definition at line 56 of file CRenderizableDisplayList.h.

unsigned int mrpt::opengl::CRenderizableDisplayList::m_dl [mutable, private]

Display list ID, for derived classes that want to use it (it's automatically deleted and freed on destruction of this base class).

Definition at line 59 of file CRenderizableDisplayList.h.

If using display lists, this is true when the list must be updated (the object changes, it's the first rendering, etc...).

Definition at line 60 of file CRenderizableDisplayList.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011