Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QGLRenderOrder Class

The QGLRenderOrder class represents an order of a scene node during rendering. More...

 #include <QGLRenderOrder>

This class was introduced in Qt 4.8.

Public Functions

QGLRenderOrder(const QGLSceneNode * node = 0, const QGLRenderState & state = QGLRenderState())
~QGLRenderOrder()
uint effectHash() const
QGLMaterial * effectiveBackMaterial() const
bool effectiveHasEffect() const
QGLMaterial * effectiveMaterial() const
QGL::StandardEffect effectiveStandardEffect() const
QGLAbstractEffect * effectiveUserEffect() const
bool isEqual(const QGLRenderOrder & rhs) const
bool isLessThan(const QGLRenderOrder & rhs) const
bool isValid() const
const QGLSceneNode * node() const
void setState(const QGLRenderState & state)
QGLRenderState state() const
bool operator!=(const QGLRenderOrder & rhs) const
bool operator<(const QGLRenderOrder & rhs) const
bool operator==(const QGLRenderOrder & rhs) const

Related Non-Members

uint qHash(const QGLRenderOrder & order)

Detailed Description

The QGLRenderOrder class represents an order of a scene node during rendering.

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

The class encapsulates the ordering with which QGLSceneNodes appear in the rendering of a scene. Every scene node that has the same rendering properties maps to the same QGLRenderOrder.

QGLRenderOrder instances are based on a scene node, and the path through the scene graph by which the node was reached. This is necessary since the same node may appear with different rendering properties in multiple different places in the rendering graph.

For example a node holding a model of a pawn chess piece may appear in several different places on a board, some with a white material and some with a black material.

To capture this concept QGLRenderOrder instances are constructed from a pointer to a QGLSceneNode, and a QGLRenderState instance.

A render order then calculates the effective values of its various attributes based on both the node, and the state.

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

By default all nodes which have the same effect type are rendered together, and then within that, those nodes which have the same material are rendered together.

See also QGLRenderOrderComparator.

Member Function Documentation

QGLRenderOrder::QGLRenderOrder(const QGLSceneNode * node = 0, const QGLRenderState & state = QGLRenderState())

Creates a new QGLRenderOrder instance that encapsulates the order in this render pass represented by the given node and state. The node defaults to NULL, and the state defaults to a default constructed invalid QGLRenderState.

QGLRenderOrder::~QGLRenderOrder()

Destroys this QGLRenderOrder and recovers any resources.

uint QGLRenderOrder::effectHash() const

Returns a hash value representing the effect set onto the node for this render order.

QGLMaterial * QGLRenderOrder::effectiveBackMaterial() const

Returns the effective back material of the node set for this render order, taking into account any effect inherited from parent nodes as specified by the render state().

See also state() and effectiveMaterial().

bool QGLRenderOrder::effectiveHasEffect() const

Returns the effective value of whether an effect is set on the node set for this render order, taking into account any effect inherited from parent nodes as specified by the render state().

See also state().

QGLMaterial * QGLRenderOrder::effectiveMaterial() const

Returns the effective material of the node set for this render order, taking into account any effect inherited from parent nodes as specified by the render state().

See also state() and effectiveBackMaterial().

QGL::StandardEffect QGLRenderOrder::effectiveStandardEffect() const

Returns the effective standard effect of the node set for this render order, taking into account any effect inherited from parent nodes as specified by the render state().

See also state() and effectiveHasEffect().

QGLAbstractEffect * QGLRenderOrder::effectiveUserEffect() const

Returns the effective user effect of the node set for this render order, taking into account any effect inherited from parent nodes as specified by the render state().

See also state() and effectiveHasEffect().

bool QGLRenderOrder::isEqual(const QGLRenderOrder & rhs) const

Returns true if this QGLRenderOrder is equal to the rhs, otherwise returns false. Reimplement this function when creating a sub-class of QGLRenderOrder.

See also isLessThan().

bool QGLRenderOrder::isLessThan(const QGLRenderOrder & rhs) const

Returns true if this QGLRenderOrder is less than the rhs, otherwise returns false. Reimplement this function when creating a sub-class of QGLRenderOrder.

The default implementation sorts first by effect, second by material (front then back).

Sorting by material is ordered by pointer comparison.

Sorting by effect is based on the following order, from lowest to highest:

  • No effect - hasEffect() == true
  • Standard effect - ordered by numerical value, eg QGL::FlatColor < QGL::LitMaterial
  • User effect - ordered by pointer comparison

So a node with hasEffect() == false node is less than a node with a custom user effect, for example.

See also isEqual().

bool QGLRenderOrder::isValid() const

Returns true if this is a valid QGLRenderOrder, that is it was initialized with a non-null QGLSceneNode.

const QGLSceneNode * QGLRenderOrder::node() const

Returns a pointer to the scene node for which the render order is held by this QGLRenderOrder instance. This is simply the value passed to the constructor.

void QGLRenderOrder::setState(const QGLRenderState & state)

Sets the state for this order.

See also state().

QGLRenderState QGLRenderOrder::state() const

Returns a pointer to the render state for this order. This is simply the value passed to the constructor.

See also setState().

bool QGLRenderOrder::operator!=(const QGLRenderOrder & rhs) const

Returns true if this QGLRenderOrder is not equal to the rhs, otherwise returns false. This function simply returns !isEqual(rhs).

bool QGLRenderOrder::operator<(const QGLRenderOrder & rhs) const

Returns true if this QGLRenderOrder is less than to the rhs, otherwise returns false. This function simply returns isLessThan(rhs).

bool QGLRenderOrder::operator==(const QGLRenderOrder & rhs) const

Returns true if this QGLRenderOrder is equal to the rhs, otherwise returns false. This function simply returns isEqual(rhs).

Related Non-Members

uint qHash(const QGLRenderOrder & order)

Returns a hash value representation of the order.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web