Detailed Description
The QVector3DArray class is a convenience for wrapping a QArray of QVector3D values.
QVector3DArray is used to build an array of 3D vector values based on floating-point x, y, and z arguments:
QVector3DArray array;
array.append(1.0f, 2.0f, 3.0f);
array.append(-1.0f, 2.0f, 3.0f);
array.append(1.0f, -2.0f, 3.0f);
This is more convenient and readable than the equivalent with QArray:
QArray<QVector3D> array;
array.append(QVector3D(1.0f, 2.0f, 3.0f));
array.append(QVector3D(-1.0f, 2.0f, 3.0f));
array.append(QVector3D(1.0f, -2.0f, 3.0f));
QVector3DArray also has convenience functions for transforming the contents of the array with translate(), translated(), transform(), and transformed().
Member Function Documentation
QVector3DArray::QVector3DArray()
Constructs an empty array of QVector3D values.
QVector3DArray::QVector3DArray(int size, const QVector3D & value = QVector3D())
Constructs an array of QVector3D values with an initial size. All elements in the array are initialized to value.
QVector3DArray::QVector3DArray(const QArray<QVector3D> & other)
Constructs a copy of other.
void QVector3DArray::append(qreal x, qreal y, qreal z)
Appends (x, y, z) to this array of QVector3D values.
void QVector3DArray::scale(qreal scale)
Multiplies the elements in this array of QVector3D values by the scale.
See also scaled().
QVector3DArray QVector3DArray::scaled(qreal scale) const
Returns a copy of this array of QVector3D values, multiplied by the scale.
See also scale().
void QVector3DArray::transform(const QMatrix4x4 & matrix)
Transforms the elements in this array of QVector3D values by matrix.
See also transformed().
QArray<QVector3D> QVector3DArray::transformed(const QMatrix4x4 & matrix) const
Returns a copy of this array of QVector3D values, transformed by matrix.
See also transform().
void QVector3DArray::translate(const QVector3D & value)
Translates the elements in this array of QVector3D values by the components of value.
See also translated().
void QVector3DArray::translate(qreal x, qreal y, qreal z)
This is an overloaded function.
Translates the elements in this array of QVector3D values by (x, y, z).
See also translated().
QArray<QVector3D> QVector3DArray::translated(const QVector3D & value) const
Returns a copy of this array of QVector3D values, translated by the components of value.
See also translate().
This is an overloaded function.
Returns a copy of this array of QVector3D values, translated by (x, y, z).
See also translate().