QGenericMatrix 类

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

头: #include <QGenericMatrix>
qmake: QT += gui
Since: Qt 4.6

公共函数

QGenericMatrix ()
QGenericMatrix (const T * )
const T * constData () const
void copyDataTo (T * ) const
T * data ()
const T * data () const
void fill (T value )
bool isIdentity () const
void setToIdentity ()
QGenericMatrix<M, N, T> transposed () const
bool operator!= (const QGenericMatrix<N, M, T> & other ) const
const T & operator() (int row , int column ) const
T & operator() (int row , int column )
QGenericMatrix<N, M, T> & operator*= (T factor )
QGenericMatrix<N, M, T> & operator+= (const QGenericMatrix<N, M, T> & other )
QGenericMatrix<N, M, T> & operator-= (const QGenericMatrix<N, M, T> & other )
QGenericMatrix<N, M, T> & operator/= (T divisor )
bool operator== (const QGenericMatrix<N, M, T> & other ) const
typedef QMatrix2x2
typedef QMatrix2x3
typedef QMatrix2x4
typedef QMatrix3x2
typedef QMatrix3x3
typedef QMatrix3x4
typedef QMatrix4x2
typedef QMatrix4x3
QGenericMatrix<M1, M2, T> operator* (const QGenericMatrix<N, M2, T> & m1 , const QGenericMatrix<M1, N, T> & m2 )
QGenericMatrix<N, M, T> operator* (T factor , const QGenericMatrix<N, M, T> & matrix )
QGenericMatrix<N, M, T> operator* (const QGenericMatrix<N, M, T> & matrix , T factor )
QGenericMatrix<N, M, T> operator+ (const QGenericMatrix<N, M, T> & m1 , const QGenericMatrix<N, M, T> & m2 )
QGenericMatrix<N, M, T> operator- (const QGenericMatrix<N, M, T> & m1 , const QGenericMatrix<N, M, T> & m2 )
QGenericMatrix<N, M, T> operator- (const QGenericMatrix<N, M, T> & matrix )
QGenericMatrix<N, M, T> operator/ (const QGenericMatrix<N, M, T> & matrix , T divisor )
QDataStream & operator<< (QDataStream & stream , const QGenericMatrix<N, M, T> & matrix )
QDataStream & operator>> (QDataStream & stream , QGenericMatrix<N, M, T> & matrix )

详细描述

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

The QGenericMatrix template has three parameters:

N 列数。
M 行数。
T 类用户可见的元素类型。

另请参阅 QMatrix4x4 .

成员函数文档编制

QGenericMatrix:: QGenericMatrix ()

构造 NxM 恒等矩阵。

QGenericMatrix:: QGenericMatrix (const T * )

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

另请参阅 copyDataTo ().

const T *QGenericMatrix:: constData () const

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

另请参阅 data ().

void QGenericMatrix:: copyDataTo ( T * ) const

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

T *QGenericMatrix:: data ()

Returns a pointer to the raw data of this matrix.

另请参阅 constData ().

const T *QGenericMatrix:: data () const

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

另请参阅 constData ().

void QGenericMatrix:: fill ( T value )

Fills all elements of this matrix with value .

bool QGenericMatrix:: isIdentity () const

返回 true if this matrix is the identity; false otherwise.

另请参阅 setToIdentity ().

void QGenericMatrix:: setToIdentity ()

将此矩阵设为恒等。

另请参阅 isIdentity ().

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

Returns this matrix, transposed about its diagonal.

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

返回 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 )

Adds the contents of other to this matrix.

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

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 ) const

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

相关非成员

typedef QMatrix2x2

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

typedef QMatrix2x3

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

typedef QMatrix2x4

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

typedef QMatrix3x2

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

typedef QMatrix3x3

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

typedef QMatrix3x4

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

typedef QMatrix4x2

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

typedef 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 , T > operator* (const QGenericMatrix < N , M2 , T > & m1 , const QGenericMatrix < M1 , N , T > & m2 )

Returns the product of the NxM2 matrix m1 and the M1xN matrix m2 to produce a M1xM2 matrix result.

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

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

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

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

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

Returns the sum of m1 and m2 .

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

Returns the difference of m1 and m2 .

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

这是重载函数。

Returns the negation of matrix .

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

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

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

写入给定 matrix 到给定 stream 并返回流引用。

另请参阅 序列化 Qt 数据类型 .

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

Reads a NxM matrix from the given stream 进给定 matrix 并返回流引用。

另请参阅 序列化 Qt 数据类型 .