QGIS API Documentation 3.41.0-Master (3291e9ff48b)
|
A simple 4x4 matrix implementation useful for transformation in 3D space. More...
#include <qgsmatrix4x4.h>
Public Member Functions | |
QgsMatrix4x4 () | |
Initializes identity matrix. | |
QgsMatrix4x4 (double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44) | |
Initializes matrix by setting all values in row-major order. | |
const double * | constData () const |
Returns pointer to the matrix data (stored in column-major order) | |
double * | data () |
Returns pointer to the matrix data (stored in column-major order) | |
QList< double > | dataList () const |
Returns matrix data (in column-major order) | |
bool | isIdentity () const |
Returns whether this matrix is an identity matrix. | |
QgsVector3D | map (const QgsVector3D &vector) const |
Matrix-vector multiplication (vector is converted to homogeneous coordinates [X,Y,Z,1] and back) | |
bool | operator!= (const QgsMatrix4x4 &other) const |
bool | operator== (const QgsMatrix4x4 &other) const |
void | setToIdentity () |
Sets matrix to be identity matrix. | |
void | translate (const QgsVector3D &vector) |
Multiplies this matrix by another that translates coordinates by the components of a vector. | |
Friends | |
CORE_EXPORT QgsMatrix4x4 | operator* (const QgsMatrix4x4 &m1, const QgsMatrix4x4 &m2) |
Matrix-vector multiplication (vector is converted to homogeneous coordinates [X,Y,Z,1] and back) | |
CORE_EXPORT QgsVector3D | operator* (const QgsMatrix4x4 &matrix, const QgsVector3D &vector) |
Matrix-matrix multiplication (useful to concatenate transforms) | |
A simple 4x4 matrix implementation useful for transformation in 3D space.
It is similar to QMatrix4x4, but working with double precision values. Most of the time, doing transform using QMatrix4x4 is fine, however QgsMatrix4x4 is useful in situations where single precision floats are not enough. For example, when using transform matrix where translation component has values in order of millions.
Definition at line 39 of file qgsmatrix4x4.h.
|
inline |
Initializes identity matrix.
Definition at line 43 of file qgsmatrix4x4.h.
QgsMatrix4x4::QgsMatrix4x4 | ( | double | m11, |
double | m12, | ||
double | m13, | ||
double | m14, | ||
double | m21, | ||
double | m22, | ||
double | m23, | ||
double | m24, | ||
double | m31, | ||
double | m32, | ||
double | m33, | ||
double | m34, | ||
double | m41, | ||
double | m42, | ||
double | m43, | ||
double | m44 | ||
) |
Initializes matrix by setting all values in row-major order.
Definition at line 21 of file qgsmatrix4x4.cpp.
|
inline |
Returns pointer to the matrix data (stored in column-major order)
Definition at line 68 of file qgsmatrix4x4.h.
|
inline |
Returns pointer to the matrix data (stored in column-major order)
Definition at line 70 of file qgsmatrix4x4.h.
QList< double > QgsMatrix4x4::dataList | ( | ) | const |
Returns matrix data (in column-major order)
Definition at line 40 of file qgsmatrix4x4.cpp.
bool QgsMatrix4x4::isIdentity | ( | ) | const |
Returns whether this matrix is an identity matrix.
Definition at line 77 of file qgsmatrix4x4.cpp.
|
inline |
Matrix-vector multiplication (vector is converted to homogeneous coordinates [X,Y,Z,1] and back)
Definition at line 80 of file qgsmatrix4x4.h.
|
inline |
Definition at line 62 of file qgsmatrix4x4.h.
|
inline |
Definition at line 50 of file qgsmatrix4x4.h.
void QgsMatrix4x4::setToIdentity | ( | ) |
Sets matrix to be identity matrix.
Definition at line 92 of file qgsmatrix4x4.cpp.
void QgsMatrix4x4::translate | ( | const QgsVector3D & | vector | ) |
Multiplies this matrix by another that translates coordinates by the components of a vector.
Definition at line 32 of file qgsmatrix4x4.cpp.
|
friend |
Matrix-vector multiplication (vector is converted to homogeneous coordinates [X,Y,Z,1] and back)
Definition at line 113 of file qgsmatrix4x4.cpp.
|
friend |
Matrix-matrix multiplication (useful to concatenate transforms)
Definition at line 51 of file qgsmatrix4x4.cpp.