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  · 

QGeometryData Class

The QGeometryData class encapsulates sets of geometry data. More...

 #include <QGeometryData>

This class was introduced in Qt 4.8.

Public Types

flags BufferStrategy
enum BufferStrategyFlags { InvalidStrategy, KeepClientData, BufferIfPossible }

Public Functions

QGeometryData()
QGeometryData(const QGeometryData & other)
QGeometryData(quint32 fields)
~QGeometryData()
void appendAttribute(float a0, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttribute(float a0, float a1, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttribute(float a0, float a1, float a2, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttribute(float a0, float a1, float a2, float a3, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttribute(const QVector2D & a, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttribute(const QVector3D & v, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttribute(const QVariant & a, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendAttributeArray(const QCustomDataArray & ary, QGL::VertexAttribute field = QGL::CustomVertex0)
void appendColor(const QColor4ub & c0)
void appendColor(const QColor4ub & c0, const QColor4ub & c1)
void appendColor(const QColor4ub & c0, const QColor4ub & c1, const QColor4ub & c2)
void appendColor(const QColor4ub & c0, const QColor4ub & c1, const QColor4ub & c2, const QColor4ub & c3)
void appendColorArray(const QArray<QColor4ub> & ary)
void appendGeometry(const QGeometryData & data)
void appendIndex(int index)
void appendIndices(int index1, int index2, int index3)
void appendIndices(const QGL::IndexArray & indices)
void appendNormal(const QVector3D & n0)
void appendNormal(const QVector3D & n0, const QVector3D & n1)
void appendNormal(const QVector3D & n0, const QVector3D & n1, const QVector3D & n2)
void appendNormal(const QVector3D & n0, const QVector3D & n1, const QVector3D & n2, const QVector3D & n3)
void appendNormalArray(const QVector3DArray & ary)
void appendTexCoord(const QVector2D & t0, QGL::VertexAttribute field = QGL::TextureCoord0)
void appendTexCoord(const QVector2D & t0, const QVector2D & t1, QGL::VertexAttribute field = QGL::TextureCoord0)
void appendTexCoord(const QVector2D & t0, const QVector2D & t1, const QVector2D & t2, QGL::VertexAttribute field = QGL::TextureCoord0)
void appendTexCoord(const QVector2D & t0, const QVector2D & t1, const QVector2D & t2, const QVector2D & t3, QGL::VertexAttribute field = QGL::TextureCoord0)
void appendTexCoordArray(const QVector2DArray & ary, QGL::VertexAttribute field = QGL::TextureCoord0)
int appendVertex(const QLogicalVertex & v)
void appendVertex(const QVector3D & v0)
void appendVertex(const QVector3D & v0, const QVector3D & v1)
void appendVertex(const QVector3D & v0, const QVector3D & v1, const QVector3D & v2)
void appendVertex(const QVector3D & v0, const QVector3D & v1, const QVector3D & v2, const QVector3D & v3)
void appendVertexArray(const QVector3DArray & ary)
QGLAttributeValue attributeValue(QGL::VertexAttribute field) const
QCustomDataArray attributes(QGL::VertexAttribute field = QGL::CustomVertex0) const
QBox3D boundingBox() const
BufferStrategy bufferStrategy() const
QVector3D center() const
void clear()
void clear(QGL::VertexAttribute field)
QColor4ub & color(int i)
const QColor4ub & colorAt(int i) const
QArray<QColor4ub> colors() const
int count() const
int count(QGL::VertexAttribute field) const
void detach()
void draw(QGLPainter * painter, int start, int count, GLenum mode = QGL::Triangles, qreal drawWidth = 1.0)
void enableField(QGL::VertexAttribute field)
quint32 fields() const
float & floatAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0)
float floatAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const
void generateTextureCoordinates(Qt::Orientation orientation = Qt::Horizontal, QGL::VertexAttribute field = QGL::TextureCoord0)
bool hasField(QGL::VertexAttribute attr) const
quint64 id() const
QGLIndexBuffer indexBuffer() const
int indexCount() const
QGL::IndexArray indices() const
void interleaveWith(const QGeometryData & other)
QGeometryData interleavedWith(const QGeometryData & other) const
bool isEmpty() const
bool isNull() const
QLogicalVertex logicalVertexAt(int i) const
QVector3D & normal(int i)
const QVector3D & normalAt(int i) const
void normalizeNormals()
QVector3DArray normals() const
void reserve(int amount)
QGeometryData reversed() const
void setBufferStrategy(BufferStrategy strategy)
QVector2D & texCoord(int i, QGL::VertexAttribute field = QGL::TextureCoord0)
const QVector2D & texCoordAt(int i, QGL::VertexAttribute field = QGL::TextureCoord0) const
QVector2DArray texCoords(QGL::VertexAttribute field = QGL::TextureCoord0) const
QGeometryData translated(const QVector3D & t) const
bool upload()
QVector2D & vector2DAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0)
QVector2D vector2DAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const
QVector3D & vector3DAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0)
QVector3D vector3DAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const
QVector3D & vertex(int i)
const QVector3D & vertexAt(int i) const
QGLVertexBundle vertexBundle() const
QVector3DArray vertices() const
QGeometryData & operator=(const QGeometryData & other)
bool operator==(const QGeometryData & other) const

Related Non-Members

quint32 fieldMask(QGL::VertexAttribute attribute)

Detailed Description

The QGeometryData class encapsulates sets of geometry data.

The QGeometryData class encloses a number of data arrays that model most typical vertex data needs. The class provides a store for all of the data types in the QGL::VertexAttribute enumeration.

QGL::VertexAttributeQGeometryData functions
QGL::PositionappendVertex(), vertex(), vertices()
QGL::NormalappendNormal(), normal(), normals()
QGL::ColorappendColor(), colorRef(), colors()
QGL::TextureCoord0 - QGL::TextureCoord3appendTexCoord(), texCoordRef(), texCoords()
QGL::CustomVertex0 - QGL::CustomVertex1, QGL::UserVertexappendAttribute(), vector3DAttribute(), attributes()

Additionally the class provides the following features:

It is up to the user of a QGeometryData instance to ensure that the data has an equal number of items in each field. For example, if five vertices are added and only two normals are added, the logical vertex at position 3 will be corrupt, since it does not have a normal.

While data is being accumulated the counts of different fields will vary, since it may be convenient to add several vertices, then several normals, colors or attributes at a time. However when a logical vertex is constructed or when the data is sent to the GPU, counts of all fields must be equal.

QGeometryData uses explicit sharing with lazy creation of internal data so that code like:

 QGeometryData myData;
 if (processed)
    myData = processedData();

is very inexpensive, since the first declaration and initialization does not cause internal data to be created (only to be overwritten by the assignment operation).

Since QGeometryData is explicitly shared, variables of type QGeometryData behave like references, and the underlying data is modified by calling a non-const function on any variable which shares that data.

To force an explicit copy call the detach() function.

Member Type Documentation

enum QGeometryData::BufferStrategyFlags
flags QGeometryData::BufferStrategy

This enum serves to describe how management of the data is handled with respect to vertex buffer objects. The strategies are essentially a combination of whether the client data is kept around after it has been successfully uploaded to the GPU; and whether an upload is attempted at all.

If the data set is very small it may be pointless to use up a VBO, hence in this case KeepClientData may be used resulting in no attempt to upload the data and client side arrays used instead.

ConstantValueDescription
QGeometryData::InvalidStrategy0x00No valid strategy has been specified.
QGeometryData::KeepClientData0x01Keep the client data, even after successful upload to the GPU.
QGeometryData::BufferIfPossible0x02Try to upload the data to the GPU.

The BufferStrategy type is a typedef for QFlags<BufferStrategyFlags>. It stores an OR combination of BufferStrategyFlags values.

Member Function Documentation

QGeometryData::QGeometryData()

Construct an empty QGeometryData

QGeometryData::QGeometryData(const QGeometryData & other)

Construct QGeometryData as a copy of other

QGeometryData::QGeometryData(quint32 fields)

Construct an empty QGeometryData with the fields enabled.

QGeometryData::~QGeometryData()

Destroys this QGeometryData recovering any resources.

void QGeometryData::appendAttribute(float a0, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the float a0 to this geometry data, as an attribute field.

void QGeometryData::appendAttribute(float a0, float a1, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the float a0 and a1 to this geometry data, as an attribute field.

void QGeometryData::appendAttribute(float a0, float a1, float a2, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the floats a0, a1 and a2 to this geometry data, as attribute field.

void QGeometryData::appendAttribute(float a0, float a1, float a2, float a3, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the floats a0, a1, a2 and a3 to this geometry data, as attribute field.

void QGeometryData::appendAttribute(const QVector2D & a, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the 2D point a to this geometry data, as an attribute field.

void QGeometryData::appendAttribute(const QVector3D & v, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the 3D point v to this geometry data, as an attribute field.

void QGeometryData::appendAttribute(const QVariant & a, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the variant value a to this geometry data, as an attribute field.

void QGeometryData::appendAttributeArray(const QCustomDataArray & ary, QGL::VertexAttribute field = QGL::CustomVertex0)

Append the points in ary to this geometry data, as an attribute field entries.

void QGeometryData::appendColor(const QColor4ub & c0)

Append the color c0 to this geometry data, as an color field.

void QGeometryData::appendColor(const QColor4ub & c0, const QColor4ub & c1)

Append the color c0 and c1 to this geometry data, as color fields.

void QGeometryData::appendColor(const QColor4ub & c0, const QColor4ub & c1, const QColor4ub & c2)

Append the color c0, c1 and c2 to this geometry data, as color fields.

void QGeometryData::appendColor(const QColor4ub & c0, const QColor4ub & c1, const QColor4ub & c2, const QColor4ub & c3)

Append the color c0, c1, c2 and c3 to this geometry data, as color fields.

void QGeometryData::appendColorArray(const QArray<QColor4ub> & ary)

Append the colors in ary to this geometry data, as color fields.

void QGeometryData::appendGeometry(const QGeometryData & data)

Appends the geometry in data to this. If this is empty, then all fields of data are appended; otherwise (when this has existing fields) only those fields that exist in both are appended.

This does not change the indices - to reference the new geometry add indices via the appendIndices() functions.

void QGeometryData::appendIndex(int index)

Appends index to the vertex index array.

See also appendIndices() and indices().

void QGeometryData::appendIndices(int index1, int index2, int index3)

Appends index1, index2, and index3 to the geometry's index array.

See also appendIndex() and indices().

void QGeometryData::appendIndices(const QGL::IndexArray & indices)

Appends the indices to the geometry's index array.

void QGeometryData::appendNormal(const QVector3D & n0)

Append the vector n0 to this geometry data, as a lighting normal.

void QGeometryData::appendNormal(const QVector3D & n0, const QVector3D & n1)

Append the vectors n0 and n1 to this geometry data, as lighting normals.

void QGeometryData::appendNormal(const QVector3D & n0, const QVector3D & n1, const QVector3D & n2)

Append the vectors n0, n1 and n2 to this geometry data, as lighting normals.

void QGeometryData::appendNormal(const QVector3D & n0, const QVector3D & n1, const QVector3D & n2, const QVector3D & n3)

Append the vectors n0, n1, n2 and n3 to this geometry data, as lighting normals.

void QGeometryData::appendNormalArray(const QVector3DArray & ary)

Append the vectors in ary to this geometry data, as lighting normals.

void QGeometryData::appendTexCoord(const QVector2D & t0, QGL::VertexAttribute field = QGL::TextureCoord0)

Append the point t0 to this geometry data, as an texture field.

void QGeometryData::appendTexCoord(const QVector2D & t0, const QVector2D & t1, QGL::VertexAttribute field = QGL::TextureCoord0)

Append the points t0 and t1 to this geometry data, as texture fields.

void QGeometryData::appendTexCoord(const QVector2D & t0, const QVector2D & t1, const QVector2D & t2, QGL::VertexAttribute field = QGL::TextureCoord0)

Append the points t0, t1 and t2 to this geometry data, as texture fields.

void QGeometryData::appendTexCoord(const QVector2D & t0, const QVector2D & t1, const QVector2D & t2, const QVector2D & t3, QGL::VertexAttribute field = QGL::TextureCoord0)

Append the points t0, t1, t2 and t3 to this geometry data, as texture fields.

void QGeometryData::appendTexCoordArray(const QVector2DArray & ary, QGL::VertexAttribute field = QGL::TextureCoord0)

Append the 2D points in ary to this geometry data, as texture field entries.

int QGeometryData::appendVertex(const QLogicalVertex & v)

Appends all the data fields in QLogicalVertex v to this QGeometryData object.

void QGeometryData::appendVertex(const QVector3D & v0)

Append the point v0 to this geometry data as a position field.

void QGeometryData::appendVertex(const QVector3D & v0, const QVector3D & v1)

Append the points v0 and v1 to this geometry data as position fields.

void QGeometryData::appendVertex(const QVector3D & v0, const QVector3D & v1, const QVector3D & v2)

Append the points v0, v1 and v2 to this geometry data as position fields.

void QGeometryData::appendVertex(const QVector3D & v0, const QVector3D & v1, const QVector3D & v2, const QVector3D & v3)

Append the points v0, v1, v2 and v3 to this geometry data as position fields.

void QGeometryData::appendVertexArray(const QVector3DArray & ary)

Append the points in ary to this geometry data as position fields.

QGLAttributeValue QGeometryData::attributeValue(QGL::VertexAttribute field) const

Returns the attribute value for the field, suitable for passing to QGLPainter.

See also QGLPainter::setVertexAttribute().

QCustomDataArray QGeometryData::attributes(QGL::VertexAttribute field = QGL::CustomVertex0) const

Returns a copy of the field attribute data.

QBox3D QGeometryData::boundingBox() const

Calculate and return a bounding box for the vertex data in this geometry.

BufferStrategy QGeometryData::bufferStrategy() const

Returns the buffer strategy for this geometry. The default is QGL::BufferIfPossible | QGL::KeepClientData.

See also setBufferStrategy().

QVector3D QGeometryData::center() const

Returns the coordinates of the center of the geometry.

The center is calculated as the centroid or geometric barycenter of the vertices (the average of the vertices). For a convex hull this is guaranteed to be inside the figure.

void QGeometryData::clear()

Clear all data structures. The actual fields are retained, but they have no contents.

 QGeometryData data;
 data.appendVertex(a);
 data.appendTexCoord(t);

 // prints "1"
 qDebug() << data.count();

 // x == a
 QVector3D x = data.vertexAt(0);

 quint32 flds = QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::TextureCoord0);
 qDebug() << (flds == data.fields());  // prints "true"

 data.clear();
 qDebug() << data.count();             // prints "0"
 QVector3D x = data.vertexAt(0);       // asserts - no data in vertices
 qDebug() << (flds == data.fields());  // still prints "true"

To clear a specific field and its data use data.clear(field) below.

To clear all fields and data, simply set this to an empty geometry:

 data = QGeometryData();

void QGeometryData::clear(QGL::VertexAttribute field)

Clears the data from field, and removes the field. After this call hasField() will return false for this field.

QColor4ub & QGeometryData::color(int i)

Returns a modifiable reference to the color data at index i.

const QColor4ub & QGeometryData::colorAt(int i) const

Returns a non-modifiable reference to the color data at index i.

QArray<QColor4ub> QGeometryData::colors() const

Returns a copy of the color data.

int QGeometryData::count() const

Returns the count of logical vertices stored. This is effectively the max() of QArray::count() over all of the enabled data types.

int QGeometryData::count(QGL::VertexAttribute field) const

Returns the count of data stored in field. This will always be at most count(), but could be less.

void QGeometryData::detach()

Force this geometry to ensure it has its own unshared internal data block, making a copy in the case that it is currently shared.

void QGeometryData::draw(QGLPainter * painter, int start, int count, GLenum mode = QGL::Triangles, qreal drawWidth = 1.0)

Draws this geometry on the painter, from start for count elements in mode. The drawing mode is by default QGL::Triangles. This function Also calls the upload() method to ensure that the geometry is resident on the graphics hardware if appropriate.

If the geometry is a point or line, then the drawWidth value specified the width/size of the line/point.

void QGeometryData::enableField(QGL::VertexAttribute field)

Enables this geometry to contain data of type field. Generally it is not necessary to call this function since it is called by all the append functions.

quint32 QGeometryData::fields() const

Return a bit-mask of the supported fields in this geometry. The QGL::VertexAttribute enum can be recovered from this bit-mask by

 quint32 fields = fields();
 QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(fields);

float & QGeometryData::floatAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0)

Returns a modifiable reference to the float field attribute data at index i.

float QGeometryData::floatAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const

Returns a copy of the float field attribute data at index i.

void QGeometryData::generateTextureCoordinates(Qt::Orientation orientation = Qt::Horizontal, QGL::VertexAttribute field = QGL::TextureCoord0)

Modifies this geometry data by generating texture data based on QGL::Position values. If orientation is Qt::Horizontal (the default) then x-coordinate values are generated, and y-coordinate values are set to 0.0; otherwise y-coordinate values are generated and x-coordinate values are set to 0.0. The values are appended to the texture coordinate field.

The method of calculation is based on the assumption that the vertex data is a list of extents which span across the texture space horizontally, from x = 0.0 to x = 1.0, in the case of Qt::Horizontal; or vertically in the case of Qt::Vertical. The texture space of 1.0 is divided up proportionately by the length of each extent.

In this diagram the large blue numbers are the lengths of each extent, and the texture coordinates generated are shown as t(7/16, 1) and so on.

Thus the texture coordinate t0 for vertex v0, is 0.0; t1 for vertex v1 is (v1 - v0).length() / totalLength and so on.

The code to produce the texture coordinates for the quads in the image is:

 QGeometryData top;

 // add data to the primitive
 top.appendVertex(QVector3D(0.0, 0.0, 0.0));
 top.appendVertex(QVector3D(6.0, 3.6, 0.0));    // (v1 - v0).length() = 7.0
 top.appendVertex(QVector3D(10.0, 0.6, 0.0));   // (v2 - v1).length() = 5.0
 top.appendVertex(QVector3D(13.0, 3.24, 0.0));  // (v3 - v2).length() = 4.0

 // generate x (Qt::Horizontal) texture coordinates over the primitive
 top.generateTextureCoordinates();              // spread over 7 + 5 + 4 = 16

 // make a copy translated down, the copy has y texture coordinates all 0
 QGeometryData bottom = top.translated(QVector3D(0, 0, -1));

 // now modify the top so its y texture coordinates are all 1
 for (int i = 0; i < top.count(); ++i)
     top.texCoordRef(QGL::TextureCoord0).setY(1.0);

 displayList->addQuadsZipped(top, bottom);

bool QGeometryData::hasField(QGL::VertexAttribute attr) const

Returns true if this geometry has the field corresponding to attr. Note that it is still possible for no data to have been added for that field.

quint64 QGeometryData::id() const

Return an opaque value that can be used to identify which data block is being used by this QGeometryData instance. See the class documentation relating to explicit sharing.

QGLIndexBuffer QGeometryData::indexBuffer() const

Returns a reference to the index buffer for this geometry.

See also vertexBundle().

int QGeometryData::indexCount() const

Returns the number of index values stored in this geometry data.

This value is exactly the same as indices().size() (but does not incur the copy).

QGL::IndexArray QGeometryData::indices() const

Returns the index array that was created by appendIndex().

See also appendIndex() and appendIndices().

void QGeometryData::interleaveWith(const QGeometryData & other)

Sets this QGeometryData to contain alternating vertices from this geometry and other. The resulting geometry contains N * 2 vertices where N == qMin(count(), other.count()), and has only the fields that are in both geometries.

QGeometryData QGeometryData::interleavedWith(const QGeometryData & other) const

Returns a QGeometryData instance containing alternating vertices from this geometry and other. The resulting geometry contains N vertices where N == qMin(count(), other.count()), and has only the fields that are in both geometries.

bool QGeometryData::isEmpty() const

Returns true if this geometry is empty - that is it contains no vertices or other data - and returns false otherwise. If an existing geometry has been made empty by a call to clear() then this will be true (but isNull() will be false).

See also isNull().

bool QGeometryData::isNull() const

Returns true if this geometry is uninitialized - that is it contains no internal data structures. A newly constructed QGeometryData object is null until some data is added or changed.

See also isEmpty().

QLogicalVertex QGeometryData::logicalVertexAt(int i) const

Returns a QLogicalVertex that references the i'th logical vertex of this geometry.

QVector3D & QGeometryData::normal(int i)

Returns a modifiable reference to the normal data at index i.

const QVector3D & QGeometryData::normalAt(int i) const

Returns a non-modifiable reference to the normal data at index i.

void QGeometryData::normalizeNormals()

Normalize all the normal vectors in this geometry to unit length.

QVector3DArray QGeometryData::normals() const

Returns a copy of the lighting normal data.

void QGeometryData::reserve(int amount)

Sets the geometry data to handle an amount of data. This is generally not required unless its anticipated that a large amount of data will be appended and realloc overhead is desired to be avoided. If amount is less than the amount already reserved, or if this object has more than the amount of data items, then this function exits without doing anything. This function will never delete data.

QGeometryData QGeometryData::reversed() const

Returns a copy of this geometry data with elements in reverse order.

void QGeometryData::setBufferStrategy(BufferStrategy strategy)

Sets the buffer strategy for this geometry.

See also bufferStrategy().

QVector2D & QGeometryData::texCoord(int i, QGL::VertexAttribute field = QGL::TextureCoord0)

Returns a modifiable reference to the field texture coordinate data at index i.

const QVector2D & QGeometryData::texCoordAt(int i, QGL::VertexAttribute field = QGL::TextureCoord0) const

Returns a non-modifiable reference to the texture coordinate data at index i for field.

QVector2DArray QGeometryData::texCoords(QGL::VertexAttribute field = QGL::TextureCoord0) const

Returns a copy of the field texture coordinate data.

QGeometryData QGeometryData::translated(const QVector3D & t) const

Returns a copy of this geometry data with QGL::Position data translated by the vector t. The other fields are unchanged.

bool QGeometryData::upload()

Uploads this geometry data to the graphics hardware if appropriate. If the data is already uploaded and has not been modified since it was last uploaded, then this function does nothing.

If the bufferStrategy() does not specify QGL::BufferIfPossible then this function does nothing.

If the data was successfully uploaded, and the bufferStrategy() does not specify QGL::KeepClientData then the data will be removed with a call to the clear() function.

If the data was successfully uploaded, on this call or previously, then this function will return true. Otherwise it returns false.

QVector2D & QGeometryData::vector2DAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0)

Returns a modifiable reference to the 2D vector field attribute data at index i.

QVector2D QGeometryData::vector2DAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const

Returns a copy of the 2D vector field attribute data at index i.

QVector3D & QGeometryData::vector3DAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0)

Returns a modifiable reference to the 3D vector field attribute data at index i.

QVector3D QGeometryData::vector3DAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const

Returns a copy of the 3D vector field attribute data at index i.

QVector3D & QGeometryData::vertex(int i)

Returns a modifiable reference to the vertex data at index i.

const QVector3D & QGeometryData::vertexAt(int i) const

Returns a non-modifiable reference to the vertex position data at index i.

QGLVertexBundle QGeometryData::vertexBundle() const

Returns a reference to the vertex buffer for this geometry.

See also indexBuffer().

QVector3DArray QGeometryData::vertices() const

Returns a copy of the vertex position data.

QGeometryData & QGeometryData::operator=(const QGeometryData & other)

Assigns this QGeometryData to be a copy of other.

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

Returns true if this geometry is identical to the other; and false otherwise.

Related Non-Members

quint32 QGL::fieldMask(QGL::VertexAttribute attribute)

Returns an unsigned integer mask from the attribute.

See also QGeometryData::fields().

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