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  · 

QGLAttributeSet Class

The QGLAttributeSet class provides a set of QGL::VertexAttribute indexes. More...

 #include <QGLAttributeSet>

This class was introduced in Qt 4.8.

Public Functions

QGLAttributeSet()
void clear()
bool contains(QGL::VertexAttribute attr) const
void insert(QGL::VertexAttribute attr)
void intersect(const QGLAttributeSet & other)
bool isEmpty() const
void remove(QGL::VertexAttribute attr)
void subtract(const QGLAttributeSet & other)
QList<QGL::VertexAttribute> toList() const
void unite(const QGLAttributeSet & other)
bool operator!=(const QGLAttributeSet & other) const
bool operator==(const QGLAttributeSet & other) const

Static Public Members

QGLAttributeSet fromList(const QList<QGL::VertexAttribute> & list)

Detailed Description

The QGLAttributeSet class provides a set of QGL::VertexAttribute indexes.

QGLAttributeSet is intended for checking if a specific vertex attribute is present in a piece of geometry, or has been set on a QGLPainter during rendering operations. The members of the set are instances of QGL::VertexAttribute, with the restriction that the index must be between 0 and 31.

The most common use for this class is to determine if specific attributes have been supplied on a QGLPainter so as to adjust the current drawing effect accordingly. The following example will use a lit texture effect if texture co-ordinates were provided in the vertex bundle, or a simple lit material effect if texture co-ordinates were not provided:

 painter.clearAttributes();
 painter.setVertexBundle(bundle);
 if (painter.attributes().contains(QGL::TextureCoord0))
     painter.setStandardEffect(QGL::LitModulateTexture2D);
 else
     painter.setStandardEffect(QGL::LitMaterial);

It is important to clear the attributes before setting the vertex bundle, so that attributes from a previous bundle will not leak through. Multiple vertex bundles may be supplied if they contain different parts of the same logical piece of geometry.

See also QGLVertexBundle::attributes() and QGLPainter::attributes().

Member Function Documentation

QGLAttributeSet::QGLAttributeSet()

Constructs an empty attribute set.

See also isEmpty().

void QGLAttributeSet::clear()

Clears this attribute set to empty.

bool QGLAttributeSet::contains(QGL::VertexAttribute attr) const

Returns true if this attribute set contains attr; false otherwise.

See also insert() and remove().

QGLAttributeSet QGLAttributeSet::fromList(const QList<QGL::VertexAttribute> & list) [static]

Returns a new attribute set that is initialized with the members of list.

See also toList() and insert().

void QGLAttributeSet::insert(QGL::VertexAttribute attr)

Inserts attr into this attribute set. Note: attr must be within the range 0 to 31. Attribute indexes outside this range are ignored and not added to the set.

See also remove() and contains().

void QGLAttributeSet::intersect(const QGLAttributeSet & other)

Intersects the contents of other with this attribute set and modifies this set accordingly.

See also unite() and subtract().

bool QGLAttributeSet::isEmpty() const

Returns true if this attribute set is empty; false otherwise.

void QGLAttributeSet::remove(QGL::VertexAttribute attr)

Removes attr from this attribute set.

See also insert() and contains().

void QGLAttributeSet::subtract(const QGLAttributeSet & other)

Subtracts the contents of other from this attribute set and modifies this set accordingly.

See also unite(), intersect(), and remove().

QList<QGL::VertexAttribute> QGLAttributeSet::toList() const

Returns the members of this attribute set as a list.

See also fromList().

void QGLAttributeSet::unite(const QGLAttributeSet & other)

Unites the contents of other with this attribute set and modifies this set accordingly.

See also intersect(), subtract(), and insert().

bool QGLAttributeSet::operator!=(const QGLAttributeSet & other) const

Returns true if this attribute set does not have the same elements as other; false otherwise.

See also operator==().

bool QGLAttributeSet::operator==(const QGLAttributeSet & other) const

Returns true if this attribute set has the same elements as other; false otherwise.

See also operator!=().

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