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

#include <mrpt/opengl/CRenderizableDisplayList.h>

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

List of all members.

Public Member Functions

 CRenderizableDisplayList ()
virtual ~CRenderizableDisplayList ()
CRenderizableDisplayList * clone () 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 CRenderizable & setColorR_u8 (const uint8_t r)
 Color components in the range [0,255].
virtual CRenderizable & setColorG_u8 (const uint8_t g)
 Color components in the range [0,255].
virtual CRenderizable & setColorB_u8 (const uint8_t b)
 Color components in the range [0,255].
virtual CRenderizable & setColorA_u8 (const uint8_t a)
 Color components in the range [0,255].
virtual CRenderizable & setColor_u8 (const mrpt::utils::TColor &c)
 Changes the default object color.

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 90 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 68 of file CRenderizableDisplayList.h.

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

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_u8 ( const mrpt::utils::TColor &  c) [inline, virtual]

Changes the default object color.

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 106 of file CRenderizableDisplayList.h.

References mrpt::opengl::CRenderizable::setColor_u8().

virtual CRenderizable& mrpt::opengl::CRenderizableDisplayList::setColorA_u8 ( const uint8_t  a) [inline, virtual]

Color components in the range [0,255].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 105 of file CRenderizableDisplayList.h.

virtual CRenderizable& mrpt::opengl::CRenderizableDisplayList::setColorB_u8 ( const uint8_t  b) [inline, virtual]

Color components in the range [0,255].

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::setColorG_u8 ( const uint8_t  g) [inline, virtual]

Color components in the range [0,255].

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::setColorR_u8 ( const uint8_t  r) [inline, virtual]

Color components in the range [0,255].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizable.

Reimplemented in mrpt::opengl::CSetOfTriangles.

Definition at line 102 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 75 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 57 of file CRenderizableDisplayList.h.


Member Data Documentation

Definition at line 57 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 60 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 61 of file CRenderizableDisplayList.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011