QtBase
v6.3.1
|
The QGenericMatrix class is a template class that represents a NxM transformation matrix with N columns and M rows. More...
#include <qgenericmatrix.h>
Public Member Functions | |
QGenericMatrix () | |
QGenericMatrix (Qt::Initialization) | |
QGenericMatrix (const T *values) | |
const T & | operator() (int row, int column) const |
T & | operator() (int row, int column) |
bool | isIdentity () const |
void | setToIdentity () |
void | fill (T value) |
QGenericMatrix< M, N, T > | transposed () const |
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 factor) |
QGenericMatrix< N, M, T > & | operator/= (T divisor) |
bool | operator== (const QGenericMatrix< N, M, T > &other) const |
bool | operator!= (const QGenericMatrix< N, M, T > &other) const |
void | copyDataTo (T *values) const |
T * | data () |
const T * | data () const |
const T * | constData () const |
Friends | |
template<int NN, int MM, typename TT > | |
class | QGenericMatrix |
template<int NN, int MM, typename TT > | |
QGenericMatrix< NN, MM, TT > | operator+ (const QGenericMatrix< NN, MM, TT > &m1, const QGenericMatrix< NN, MM, TT > &m2) |
template<int NN, int MM, typename TT > | |
QGenericMatrix< NN, MM, TT > | operator- (const QGenericMatrix< NN, MM, TT > &m1, const QGenericMatrix< NN, MM, TT > &m2) |
template<int NN, int M1, int M2, typename TT > | |
QGenericMatrix< M1, M2, TT > | operator* (const QGenericMatrix< NN, M2, TT > &m1, const QGenericMatrix< M1, NN, TT > &m2) |
template<int NN, int MM, typename TT > | |
QGenericMatrix< NN, MM, TT > | operator- (const QGenericMatrix< NN, MM, TT > &matrix) |
template<int NN, int MM, typename TT > | |
QGenericMatrix< NN, MM, TT > | operator* (TT factor, const QGenericMatrix< NN, MM, TT > &matrix) |
template<int NN, int MM, typename TT > | |
QGenericMatrix< NN, MM, TT > | operator* (const QGenericMatrix< NN, MM, TT > &matrix, TT factor) |
template<int NN, int MM, typename TT > | |
QGenericMatrix< NN, MM, TT > | operator/ (const QGenericMatrix< NN, MM, TT > &matrix, TT divisor) |
The QGenericMatrix class is a template class that represents a NxM transformation matrix with N columns and M rows.
\inmodule QtGui
The QGenericMatrix template has three parameters:
\table \row
Definition at line 52 of file qgenericmatrix.h.
Q_INLINE_TEMPLATE QGenericMatrix< N, M, T >::QGenericMatrix |
Definition at line 110 of file qgenericmatrix.h.
|
inlineexplicit |
Definition at line 56 of file qgenericmatrix.h.
|
explicit |
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.
Definition at line 116 of file qgenericmatrix.h.
|
inline |
Returns a constant pointer to the raw data of this matrix.
Definition at line 80 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE void QGenericMatrix< N, M, T >::copyDataTo | ( | T * | values | ) | const |
Retrieves the N * M items in this matrix and copies them to values in row-major order.
Definition at line 319 of file qgenericmatrix.h.
|
inline |
Returns a pointer to the raw data of this matrix.
Definition at line 78 of file qgenericmatrix.h.
|
inline |
Returns a constant pointer to the raw data of this matrix.
Definition at line 79 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE void QGenericMatrix< N, M, T >::fill | ( | T | value | ) |
Fills all elements of this matrix with value.
Definition at line 168 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE bool QGenericMatrix< N, M, T >::isIdentity |
Returns true
if this matrix is the identity; false otherwise.
Definition at line 138 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE bool QGenericMatrix< N, M, T >::operator!= | ( | const QGenericMatrix< N, M, T > & | other | ) | const |
Returns true
if this matrix is not identical to other; false otherwise.
Definition at line 227 of file qgenericmatrix.h.
Q_INLINE_TEMPLATE T & QGenericMatrix< N, M, T >::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.
Definition at line 131 of file qgenericmatrix.h.
Q_INLINE_TEMPLATE const T & QGenericMatrix< N, M, T >::operator() | ( | int | row, |
int | column | ||
) | const |
Returns a constant reference to the element at position (row, column) in this matrix.
Definition at line 124 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE QGenericMatrix< N, M, T > & QGenericMatrix< N, M, T >::operator*= | ( | T | factor | ) |
Multiplies all elements of this matrix by factor.
Definition at line 204 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE QGenericMatrix< N, M, T > & QGenericMatrix< N, M, T >::operator+= | ( | const QGenericMatrix< N, M, T > & | other | ) |
Adds the contents of other to this matrix.
Definition at line 186 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE QGenericMatrix< N, M, T > & QGenericMatrix< N, M, T >::operator-= | ( | const QGenericMatrix< N, M, T > & | other | ) |
Subtracts the contents of other from this matrix.
Definition at line 195 of file qgenericmatrix.h.
QT_WARNING_POP Q_OUTOFLINE_TEMPLATE QGenericMatrix< N, M, T > & QGenericMatrix< N, M, T >::operator/= | ( | T | divisor | ) |
Divides all elements of this matrix by divisor.
Definition at line 235 of file qgenericmatrix.h.
QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE Q_OUTOFLINE_TEMPLATE bool QGenericMatrix< N, M, T >::operator== | ( | const QGenericMatrix< N, M, T > & | other | ) | const |
Returns true
if this matrix is identical to other; false otherwise.
Definition at line 216 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE void QGenericMatrix< N, M, T >::setToIdentity |
Sets this matrix to the identity.
Definition at line 155 of file qgenericmatrix.h.
Q_OUTOFLINE_TEMPLATE QGenericMatrix< M, N, T > QGenericMatrix< N, M, T >::transposed |
Returns this matrix, transposed about its diagonal.
Definition at line 176 of file qgenericmatrix.h.
|
related |
Returns the result of multiplying all elements of matrix by factor.
Definition at line 299 of file qgenericmatrix.h.
|
friend |
Returns the product of the NNxM2 matrix m1 and the M1xNN matrix m2 to produce a M1xM2 matrix result.
|
friend |
|
related |
Returns the result of multiplying all elements of matrix by factor.
Definition at line 289 of file qgenericmatrix.h.
|
friend |
|
related |
Returns the sum of m1 and m2.
Definition at line 244 of file qgenericmatrix.h.
|
friend |
|
related |
Returns the difference of m1 and m2.
Definition at line 254 of file qgenericmatrix.h.
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the negation of matrix.
Definition at line 279 of file qgenericmatrix.h.
|
friend |
|
friend |
|
related |
Returns the result of dividing all elements of matrix by divisor.
Definition at line 309 of file qgenericmatrix.h.
|
friend |
|
related |
Writes the given matrix to the given stream and returns a reference to the stream.
Definition at line 359 of file qgenericmatrix.h.
|
related |
Reads a NxM matrix from the given stream into the given matrix and returns a reference to the stream.
Definition at line 368 of file qgenericmatrix.h.
|
friend |
Constructs a NxM identity matrix.
Definition at line 101 of file qgenericmatrix.h.
|
related |
The QMatrix2x2 type defines a convenient instantiation of the QGenericMatrix template for 2 columns, 2 rows, and float as the element type.
Definition at line 327 of file qgenericmatrix.h.
|
related |
The QMatrix2x3 type defines a convenient instantiation of the QGenericMatrix template for 2 columns, 3 rows, and float as the element type.
Definition at line 328 of file qgenericmatrix.h.
|
related |
The QMatrix2x4 type defines a convenient instantiation of the QGenericMatrix template for 2 columns, 4 rows, and float as the element type.
Definition at line 329 of file qgenericmatrix.h.
|
related |
The QMatrix3x2 type defines a convenient instantiation of the QGenericMatrix template for 3 columns, 2 rows, and float as the element type.
Definition at line 330 of file qgenericmatrix.h.
|
related |
The QMatrix3x3 type defines a convenient instantiation of the QGenericMatrix template for 3 columns, 3 rows, and float as the element type.
Definition at line 331 of file qgenericmatrix.h.
|
related |
The QMatrix3x4 type defines a convenient instantiation of the QGenericMatrix template for 3 columns, 4 rows, and float as the element type.
Definition at line 332 of file qgenericmatrix.h.
|
related |
The QMatrix4x2 type defines a convenient instantiation of the QGenericMatrix template for 4 columns, 2 rows, and float as the element type.
Definition at line 333 of file qgenericmatrix.h.
|
related |
The QMatrix4x3 type defines a convenient instantiation of the QGenericMatrix template for 4 columns, 3 rows, and float as the element type.
Definition at line 334 of file qgenericmatrix.h.