Qt3D Reference Documentation

QGLRenderOrderComparator Class Reference

The QGLRenderOrderComparator class compares QGLRenderOrder instances. More...

 #include <QGLRenderOrderComparator>

This class was introduced in Qt3D 4.8.

Public Functions

QGLRenderOrderComparator ()
virtual ~QGLRenderOrderComparator ()
virtual bool isEqualTo ( const QGLRenderOrder & lhs, const QGLRenderOrder & rhs )
virtual bool isLessThan ( const QGLRenderOrder & lhs, const QGLRenderOrder & rhs )

Detailed Description

The QGLRenderOrderComparator class compares QGLRenderOrder instances.

The QGLRenderOrderComparator class works with the QGLRenderSequencer and QGLRenderOrder classes to optimize the rendering order of scene nodes.

This class is responsible for comparing QGLRenderOrder instances for the QGLRenderSequencer.

Custom render orders may be created by sub-classing QGLRenderOrderComparator and reimplementing the following method:

bool operator()(const QGLRenderOrder &lhs, const QGLRenderOrder &rhs)

Then set an instance of your class onto QGLPainter:

 void MyView::initializeGL(QGLPainter *painter)
 {
     painter->renderSequencer()->setRenderOrderComparator(new MyRenderOrderComparator);
 }

 void MyView::paintGL(QGLPainter *painter)
 {
     // draw uses QGLRenderOrder sub-class instances from m_renderOrderFactory
     complexScene->draw(painter);
 }

See the QGLRenderOrder class documentation for more details.

See also QGLRenderOrder.

Member Function Documentation

QGLRenderOrderComparator::QGLRenderOrderComparator ()

Construct a new QGLRenderOrderComparator.

QGLRenderOrderComparator::~QGLRenderOrderComparator () [virtual]

Destroys this QGLRenderOrderComparator, recovering any resources.

bool QGLRenderOrderComparator::isEqualTo ( const QGLRenderOrder & lhs, const QGLRenderOrder & rhs ) [virtual]

Returns true if the lhs render order is equal to the rhs; otherwise returns false.

Reimplement this function when creating custom render orders.

bool QGLRenderOrderComparator::isLessThan ( const QGLRenderOrder & lhs, const QGLRenderOrder & rhs ) [virtual]

Returns true if the lhs render order is less than the rhs; otherwise returns false.

Reimplement this function when creating custom render orders.