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  · 

QGLAttributeValue Class

The QGLAttributeValue class encapsulates information about an OpenGL attribute value. More...

 #include <QGLAttributeValue>

This class was introduced in Qt 4.8.

Public Functions

QGLAttributeValue()
QGLAttributeValue(const QArray<float> & array)
QGLAttributeValue(const QArray<QVector2D> & array)
QGLAttributeValue(const QArray<QVector3D> & array)
QGLAttributeValue(const QArray<QVector4D> & array)
QGLAttributeValue(const QArray<QColor4ub> & array)
QGLAttributeValue(const QCustomDataArray & array)
QGLAttributeValue(int tupleSize, GLenum type, int stride, const void * data, int count = 0)
QGLAttributeValue(int tupleSize, GLenum type, int stride, int offset, int count = 0)
QGLAttributeValue(const QGLAttributeDescription & description, const void * data, int count = 0)
QGLAttributeValue(const QGLAttributeDescription & description, int offset, int count = 0)
int count() const
const void * data() const
QGLAttributeDescription description(QGL::VertexAttribute attribute) const
bool isNull() const
int sizeOfType() const
int stride() const
int tupleSize() const
GLenum type() const

Detailed Description

The QGLAttributeValue class encapsulates information about an OpenGL attribute value.

OpenGL has many functions that take a pointer to vertex attribute values: glVertexPointer(), glNormalPointer(), glVertexAttribPointer(), etc. These functions typically take four arguments: tuple size (1, 2, 3, or 4), component type (e.g. GL_FLOAT), stride, and data pointer (glNormalPointer() does not use tuple size, assuming that it is 3). When used with vertex buffers, the data pointer may be an offset into the vertex buffer instead.

QGLAttributeValue encapsulates these four values so that they can be easily manipulated as a set during OpenGL painting operations. Constructors are provided for converting QArray and QCustomDataArray objects into an attribute value.

Because the data() value is a raw pointer to arbitrary memory, care should be taken that the memory remains valid until the QGLAttributeValue is no longer required.

See also QGLAttributeDescription, QArray, and QCustomDataArray.

Member Function Documentation

QGLAttributeValue::QGLAttributeValue()

Constructs a null attribute value with default parameters of tupleSize(), and stride() set to zero, type() set to GL_FLOAT, and data() set to null.

See also isNull().

QGLAttributeValue::QGLAttributeValue(const QArray<float> & array)

Constructs an attribute value that refers to the contents of array, setting tupleSize() to 1, type() to GL_FLOAT, and stride() to zero.

The array must not be destroyed or modified until the attribute value is no longer required.

QGLAttributeValue::QGLAttributeValue(const QArray<QVector2D> & array)

Constructs an attribute value that refers to the contents of array, setting tupleSize() to 2, type() to GL_FLOAT, and stride() to zero.

The array must not be destroyed or modified until the attribute value is no longer required.

QGLAttributeValue::QGLAttributeValue(const QArray<QVector3D> & array)

Constructs an attribute value that refers to the contents of array, setting tupleSize() to 3, type() to GL_FLOAT, and stride() to zero.

The array must not be destroyed or modified until the attribute value is no longer required.

QGLAttributeValue::QGLAttributeValue(const QArray<QVector4D> & array)

Constructs an attribute value that refers to the contents of array, setting tupleSize() to 4, type() to GL_FLOAT, and stride() to zero.

The array must not be destroyed or modified until the attribute value is no longer required.

QGLAttributeValue::QGLAttributeValue(const QArray<QColor4ub> & array)

Constructs an attribute value that refers to the contents of array, setting tupleSize() to 4, type() to GL_UNSIGNED_BYTE, and stride() to zero.

The array must not be destroyed or modified until the attribute value is no longer required.

QGLAttributeValue::QGLAttributeValue(const QCustomDataArray & array)

Constructs an attribute value that refers to the contents of array. The tupleSize() and type() of the attribute value will be set according to the QCustomDataArray::elementType() of array.

The array must not be destroyed or modified until the attribute value is no longer required.

QGLAttributeValue::QGLAttributeValue(int tupleSize, GLenum type, int stride, const void * data, int count = 0)

Constructs an attribute value with the fields tupleSize, type, stride, data, and count.

QGLAttributeValue::QGLAttributeValue(int tupleSize, GLenum type, int stride, int offset, int count = 0)

Constructs an attribute value with the fields tupleSize, type, stride, offset, and count.

QGLAttributeValue::QGLAttributeValue(const QGLAttributeDescription & description, const void * data, int count = 0)

Constructs an attribute value with the supplied description, data, and count.

QGLAttributeValue::QGLAttributeValue(const QGLAttributeDescription & description, int offset, int count = 0)

Constructs an attribute value with the supplied description, offset, and count.

int QGLAttributeValue::count() const

Returns the count of vertex elements in this attribute value; zero if the count is unknown.

const void * QGLAttributeValue::data() const

Returns the data pointer for the elements in this attribute value.

QGLAttributeDescription QGLAttributeValue::description(QGL::VertexAttribute attribute) const

Returns the description of this value, tagged with attribute.

See also type().

bool QGLAttributeValue::isNull() const

Returns true if tupleSize() is zero, which indicates an unset attribute value; false otherwise.

Note: it is possible for data() to be null, but isNull() returns true. This can happen when data() is actually a zero offset into a vertex buffer.

int QGLAttributeValue::sizeOfType() const

Returns the size in bytes of type().

See also type() and tupleSize().

int QGLAttributeValue::stride() const

Returns the stride in bytes from one vertex element to the next for this attribute value. The default value of 0 indicates that the elements are tightly packed within the data() array.

int QGLAttributeValue::tupleSize() const

Returns the tuple size of this attribute in components. For example, a return value of 3 indicates a vector of 3-dimensional values. If tupleSize() is zero, then this attribute value is null.

See also isNull() and sizeOfType().

GLenum QGLAttributeValue::type() const

Returns the component type for this attribute value. The default value is GL_FLOAT.

See also sizeOfType() and description().

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