IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QGenericMatrix Class

The QGenericMatrix class is a template class that represents a NxM transformation matrix with N columns and M rows.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QGenericMatrix Class

  • Header: QGenericMatrix

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Group: QGenericMatrix is part of Painting Classes, Rendering in 3D

Detailed Description

The QGenericMatrix template has three parameters:

N

Number of columns.

M

Number of rows.

T

Element type that is visible to users of the class.

See Also

See also QMatrix4x4

Member Function Documentation

 

QGenericMatrix::QGenericMatrix()

Constructs a NxM identity matrix.

[explicit] QGenericMatrix::QGenericMatrix(const T *values)

Constructs a matrix from the given N * M floating-point values. The contents of the array values is assumed to be in row-major order.

See Also

See also copyDataTo()

const T *QGenericMatrix::constData() const

Returns a constant pointer to the raw data of this matrix.

See Also

See also data()

void QGenericMatrix::copyDataTo(T *values) const

Retrieves the N * M items in this matrix and copies them to values in row-major order.

T *QGenericMatrix::data()

Returns a pointer to the raw data of this matrix.

See Also

See also constData()

const T *QGenericMatrix::data() const

Returns a constant pointer to the raw data of this matrix.

See Also

See also constData()

void QGenericMatrix::fill(T value)

Fills all elements of this matrix with value.

bool QGenericMatrix::isIdentity() const

Returns true if this matrix is the identity; false otherwise.

See Also

See also setToIdentity()

void QGenericMatrix::setToIdentity()

Sets this matrix to the identity.

See Also

See also isIdentity()

QGenericMatrix<M, N, T> QGenericMatrix::transposed() const

Returns this matrix, transposed about its diagonal.

bool QGenericMatrix::operator!=(const QGenericMatrix<N, M, T> &other = N) const

Returns true if this matrix is not identical to other; false otherwise.

const T &QGenericMatrix::operator()(int row, int column) const

Returns a constant reference to the element at position (row, column) in this matrix.

T &QGenericMatrix::operator()(int row, int column)

Returns a reference to the element at position (row, column) in this matrix so that the element can be assigned to.

QGenericMatrix<N, M, T> &QGenericMatrix::operator*=(T factor)

Multiplies all elements of this matrix by factor.

QGenericMatrix<N, M, T> &QGenericMatrix::operator+=(const QGenericMatrix<N, M, T> &other = N)

Adds the contents of other to this matrix.

QGenericMatrix<N, M, T> &QGenericMatrix::operator-=(const QGenericMatrix<N, M, T> &other = N)

Subtracts the contents of other from this matrix.

QGenericMatrix<N, M, T> &QGenericMatrix::operator/=(T divisor)

Divides all elements of this matrix by divisor.

bool QGenericMatrix::operator==(const QGenericMatrix<N, M, T> &other = N) const

Returns true if this matrix is identical to other; false otherwise.

Related Non-Members

 

QMatrix2x2

The QMatrix2x2 type defines a convenient instantiation of the QGenericMatrix template for 2 columns, 2 rows, and float as the element type.

QMatrix2x3

The QMatrix2x3 type defines a convenient instantiation of the QGenericMatrix template for 2 columns, 3 rows, and float as the element type.

QMatrix2x4

The QMatrix2x4 type defines a convenient instantiation of the QGenericMatrix template for 2 columns, 4 rows, and float as the element type.

QMatrix3x2

The QMatrix3x2 type defines a convenient instantiation of the QGenericMatrix template for 3 columns, 2 rows, and float as the element type.

QMatrix3x3

The QMatrix3x3 type defines a convenient instantiation of the QGenericMatrix template for 3 columns, 3 rows, and float as the element type.

QMatrix3x4

The QMatrix3x4 type defines a convenient instantiation of the QGenericMatrix template for 3 columns, 4 rows, and float as the element type.

QMatrix4x2

The QMatrix4x2 type defines a convenient instantiation of the QGenericMatrix template for 4 columns, 2 rows, and float as the element type.

QMatrix4x3

The QMatrix4x3 type defines a convenient instantiation of the QGenericMatrix template for 4 columns, 3 rows, and float as the element type.

QGenericMatrix<M1, M2, TT> operator*(const QGenericMatrix<NN, M2, TT> &m1 = NN, const QGenericMatrix<M1, NN, TT> &m2 = M1)

Returns the product of the NNxM2 matrix m1 and the M1xNN matrix m2 to produce a M1xM2 matrix result.

QGenericMatrix<N, M, T> operator*(T factor, const QGenericMatrix<N, M, T> &matrix = N)

Returns the result of multiplying all elements of matrix by factor.

QGenericMatrix<N, M, T> operator*(const QGenericMatrix<N, M, T> &matrix = N, T factor)

Returns the result of multiplying all elements of matrix by factor.

QGenericMatrix<N, M, T> operator+(const QGenericMatrix<N, M, T> &m1 = N, const QGenericMatrix<N, M, T> &m2 = N)

Returns the sum of m1 and m2.

QGenericMatrix<N, M, T> operator-(const QGenericMatrix<N, M, T> &m1 = N, const QGenericMatrix<N, M, T> &m2 = N)

Returns the difference of m1 and m2.

QGenericMatrix<N, M, T> operator-(const QGenericMatrix<N, M, T> &matrix = N)

This is an overloaded function.

Returns the negation of matrix.

QGenericMatrix<N, M, T> operator/(const QGenericMatrix<N, M, T> &matrix = N, T divisor)

Returns the result of dividing all elements of matrix by divisor.

QDataStream &operator<<(QDataStream &stream, const QGenericMatrix<N, M, T> &matrix = N)

Writes the given matrix to the given stream and returns a reference to the stream.

See Also

QDataStream &operator>>(QDataStream &stream, QGenericMatrix<N, M, T> &matrix = N)

Reads a NxM matrix from the given stream into the given matrix and returns a reference to the stream.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+