#include <QtGui/qvector3d.h>
#include <QtGui/qvector4d.h>
#include <QtGui/qquaternion.h>
#include <QtGui/qgenericmatrix.h>
#include <QtCore/qrect.h>
Go to the source code of this file.
|
QMatrix4x4 | operator* (const QMatrix4x4 &m1, const QMatrix4x4 &m2) |
|
QVector3D | operator* (const QVector3D &vector, const QMatrix4x4 &matrix) |
|
QVector3D | operator* (const QMatrix4x4 &matrix, const QVector3D &vector) |
|
QVector4D | operator* (const QVector4D &vector, const QMatrix4x4 &matrix) |
|
QVector4D | operator* (const QMatrix4x4 &matrix, const QVector4D &vector) |
|
QPoint | operator* (const QPoint &point, const QMatrix4x4 &matrix) |
|
QPointF | operator* (const QPointF &point, const QMatrix4x4 &matrix) |
|
QPoint | operator* (const QMatrix4x4 &matrix, const QPoint &point) |
|
QPointF | operator* (const QMatrix4x4 &matrix, const QPointF &point) |
|
QMatrix4x4 | operator* (qreal factor, const QMatrix4x4 &matrix) |
|
QMatrix4x4 | operator* (const QMatrix4x4 &matrix, qreal factor) |
|
QMatrix4x4 | operator+ (const QMatrix4x4 &m1, const QMatrix4x4 &m2) |
|
QMatrix4x4 | operator- (const QMatrix4x4 &m1, const QMatrix4x4 &m2) |
|
QMatrix4x4 | operator- (const QMatrix4x4 &matrix) |
|
Q_GUI_EXPORT QMatrix4x4 | operator/ (const QMatrix4x4 &matrix, qreal divisor) |
|
Q_GUI_EXPORT QDebug | operator<< (QDebug dbg, const QMatrix4x4 &m) |
|
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QMatrix4x4 &) |
|
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QMatrix4x4 &) |
|
| Q_DECLARE_TYPEINFO (QMatrix4x4, Q_MOVABLE_TYPE) |
|
bool | qFuzzyCompare (const QMatrix4x4 &m1, const QMatrix4x4 &m2) |
|
template<int N, int M> |
QT_DEPRECATED QGenericMatrix< N, M, qreal > | qGenericMatrixFromMatrix4x4 (const QMatrix4x4 &matrix) |
|
template<int N, int M> |
QT_DEPRECATED QMatrix4x4 | qGenericMatrixToMatrix4x4 (const QGenericMatrix< N, M, qreal > &matrix) |
|
◆ operator*() [1/11]
Definition at line 529 of file qmatrix4x4.h.
Referenced by QMatrix4x4::QMatrix4x4().
537 m.m[0][0] = m1.
m[0][0] * m2.
m[0][0] +
538 m1.
m[1][0] * m2.
m[0][1] +
539 m1.
m[2][0] * m2.
m[0][2] +
540 m1.
m[3][0] * m2.
m[0][3];
541 m.m[0][1] = m1.
m[0][1] * m2.
m[0][0] +
542 m1.
m[1][1] * m2.
m[0][1] +
543 m1.
m[2][1] * m2.
m[0][2] +
544 m1.
m[3][1] * m2.
m[0][3];
545 m.m[0][2] = m1.
m[0][2] * m2.
m[0][0] +
546 m1.
m[1][2] * m2.
m[0][1] +
547 m1.
m[2][2] * m2.
m[0][2] +
548 m1.
m[3][2] * m2.
m[0][3];
549 m.m[0][3] = m1.
m[0][3] * m2.
m[0][0] +
550 m1.
m[1][3] * m2.
m[0][1] +
551 m1.
m[2][3] * m2.
m[0][2] +
552 m1.
m[3][3] * m2.
m[0][3];
553 m.m[1][0] = m1.
m[0][0] * m2.
m[1][0] +
554 m1.
m[1][0] * m2.
m[1][1] +
555 m1.
m[2][0] * m2.
m[1][2] +
556 m1.
m[3][0] * m2.
m[1][3];
557 m.m[1][1] = m1.
m[0][1] * m2.
m[1][0] +
558 m1.
m[1][1] * m2.
m[1][1] +
559 m1.
m[2][1] * m2.
m[1][2] +
560 m1.
m[3][1] * m2.
m[1][3];
561 m.m[1][2] = m1.
m[0][2] * m2.
m[1][0] +
562 m1.
m[1][2] * m2.
m[1][1] +
563 m1.
m[2][2] * m2.
m[1][2] +
564 m1.
m[3][2] * m2.
m[1][3];
565 m.m[1][3] = m1.
m[0][3] * m2.
m[1][0] +
566 m1.
m[1][3] * m2.
m[1][1] +
567 m1.
m[2][3] * m2.
m[1][2] +
568 m1.
m[3][3] * m2.
m[1][3];
569 m.m[2][0] = m1.
m[0][0] * m2.
m[2][0] +
570 m1.
m[1][0] * m2.
m[2][1] +
571 m1.
m[2][0] * m2.
m[2][2] +
572 m1.
m[3][0] * m2.
m[2][3];
573 m.m[2][1] = m1.
m[0][1] * m2.
m[2][0] +
574 m1.
m[1][1] * m2.
m[2][1] +
575 m1.
m[2][1] * m2.
m[2][2] +
576 m1.
m[3][1] * m2.
m[2][3];
577 m.m[2][2] = m1.
m[0][2] * m2.
m[2][0] +
578 m1.
m[1][2] * m2.
m[2][1] +
579 m1.
m[2][2] * m2.
m[2][2] +
580 m1.
m[3][2] * m2.
m[2][3];
581 m.m[2][3] = m1.
m[0][3] * m2.
m[2][0] +
582 m1.
m[1][3] * m2.
m[2][1] +
583 m1.
m[2][3] * m2.
m[2][2] +
584 m1.
m[3][3] * m2.
m[2][3];
585 m.m[3][0] = m1.
m[0][0] * m2.
m[3][0] +
586 m1.
m[1][0] * m2.
m[3][1] +
587 m1.
m[2][0] * m2.
m[3][2] +
588 m1.
m[3][0] * m2.
m[3][3];
589 m.m[3][1] = m1.
m[0][1] * m2.
m[3][0] +
590 m1.
m[1][1] * m2.
m[3][1] +
591 m1.
m[2][1] * m2.
m[3][2] +
592 m1.
m[3][1] * m2.
m[3][3];
593 m.m[3][2] = m1.
m[0][2] * m2.
m[3][0] +
594 m1.
m[1][2] * m2.
m[3][1] +
595 m1.
m[2][2] * m2.
m[3][2] +
596 m1.
m[3][2] * m2.
m[3][3];
597 m.m[3][3] = m1.
m[0][3] * m2.
m[3][0] +
598 m1.
m[1][3] * m2.
m[3][1] +
599 m1.
m[2][3] * m2.
m[3][2] +
600 m1.
m[3][3] * m2.
m[3][3];
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
◆ operator*() [2/11]
Definition at line 606 of file qmatrix4x4.h.
609 x = vector.
x() * matrix.
m[0][0] +
610 vector.
y() * matrix.
m[0][1] +
611 vector.
z() * matrix.
m[0][2] +
613 y = vector.
x() * matrix.
m[1][0] +
614 vector.
y() * matrix.
m[1][1] +
615 vector.
z() * matrix.
m[1][2] +
617 z = vector.
x() * matrix.
m[2][0] +
618 vector.
y() * matrix.
m[2][1] +
619 vector.
z() * matrix.
m[2][2] +
621 w = vector.
x() * matrix.
m[3][0] +
622 vector.
y() * matrix.
m[3][1] +
623 vector.
z() * matrix.
m[3][2] +
The QVector3D class represents a vector or vertex in 3D space.
qreal x() const
Returns the x coordinate of this point.
qreal z() const
Returns the z coordinate of this point.
qreal y() const
Returns the y coordinate of this point.
◆ operator*() [3/11]
Definition at line 631 of file qmatrix4x4.h.
638 vector.
y() + matrix.
m[3][1],
639 vector.
z() + matrix.
m[3][2]);
642 return QVector3D(vector.
x() * matrix.
m[0][0] + matrix.
m[3][0],
643 vector.
y() * matrix.
m[1][1] + matrix.
m[3][1],
644 vector.
z() * matrix.
m[2][2] + matrix.
m[3][2]);
647 vector.
y() * matrix.
m[1][1],
648 vector.
z() * matrix.
m[2][2]);
650 x = vector.
x() * matrix.
m[0][0] +
651 vector.
y() * matrix.
m[1][0] +
652 vector.
z() * matrix.
m[2][0] +
654 y = vector.
x() * matrix.
m[0][1] +
655 vector.
y() * matrix.
m[1][1] +
656 vector.
z() * matrix.
m[2][1] +
658 z = vector.
x() * matrix.
m[0][2] +
659 vector.
y() * matrix.
m[1][2] +
660 vector.
z() * matrix.
m[2][2] +
662 w = vector.
x() * matrix.
m[0][3] +
663 vector.
y() * matrix.
m[1][3] +
664 vector.
z() * matrix.
m[2][3] +
The QVector3D class represents a vector or vertex in 3D space.
qreal x() const
Returns the x coordinate of this point.
qreal z() const
Returns the z coordinate of this point.
qreal y() const
Returns the y coordinate of this point.
◆ operator*() [4/11]
Definition at line 677 of file qmatrix4x4.h.
680 x = vector.
x() * matrix.
m[0][0] +
681 vector.
y() * matrix.
m[0][1] +
682 vector.
z() * matrix.
m[0][2] +
683 vector.
w() * matrix.
m[0][3];
684 y = vector.
x() * matrix.
m[1][0] +
685 vector.
y() * matrix.
m[1][1] +
686 vector.
z() * matrix.
m[1][2] +
687 vector.
w() * matrix.
m[1][3];
688 z = vector.
x() * matrix.
m[2][0] +
689 vector.
y() * matrix.
m[2][1] +
690 vector.
z() * matrix.
m[2][2] +
691 vector.
w() * matrix.
m[2][3];
692 w = vector.
x() * matrix.
m[3][0] +
693 vector.
y() * matrix.
m[3][1] +
694 vector.
z() * matrix.
m[3][2] +
695 vector.
w() * matrix.
m[3][3];
qreal w() const
Returns the w coordinate of this point.
The QVector4D class represents a vector or vertex in 4D space.
qreal x() const
Returns the x coordinate of this point.
qreal z() const
Returns the z coordinate of this point.
qreal y() const
Returns the y coordinate of this point.
◆ operator*() [5/11]
Definition at line 699 of file qmatrix4x4.h.
702 x = vector.
x() * matrix.
m[0][0] +
703 vector.
y() * matrix.
m[1][0] +
704 vector.
z() * matrix.
m[2][0] +
705 vector.
w() * matrix.
m[3][0];
706 y = vector.
x() * matrix.
m[0][1] +
707 vector.
y() * matrix.
m[1][1] +
708 vector.
z() * matrix.
m[2][1] +
709 vector.
w() * matrix.
m[3][1];
710 z = vector.
x() * matrix.
m[0][2] +
711 vector.
y() * matrix.
m[1][2] +
712 vector.
z() * matrix.
m[2][2] +
713 vector.
w() * matrix.
m[3][2];
714 w = vector.
x() * matrix.
m[0][3] +
715 vector.
y() * matrix.
m[1][3] +
716 vector.
z() * matrix.
m[2][3] +
717 vector.
w() * matrix.
m[3][3];
qreal w() const
Returns the w coordinate of this point.
The QVector4D class represents a vector or vertex in 4D space.
qreal x() const
Returns the x coordinate of this point.
qreal z() const
Returns the z coordinate of this point.
qreal y() const
Returns the y coordinate of this point.
◆ operator*() [6/11]
Definition at line 723 of file qmatrix4x4.h.
729 x = xin * matrix.
m[0][0] +
730 yin * matrix.
m[0][1] +
732 y = xin * matrix.
m[1][0] +
733 yin * matrix.
m[1][1] +
735 w = xin * matrix.
m[3][0] +
736 yin * matrix.
m[3][1] +
The QPoint class defines a point in the plane using integer precision.
int y() const
Returns the y coordinate of this point.
int x() const
Returns the x coordinate of this point.
Q_DECL_CONSTEXPR int qRound(qreal d)
◆ operator*() [7/11]
Definition at line 744 of file qmatrix4x4.h.
750 x = xin * matrix.
m[0][0] +
751 yin * matrix.
m[0][1] +
753 y = xin * matrix.
m[1][0] +
754 yin * matrix.
m[1][1] +
756 w = xin * matrix.
m[3][0] +
757 yin * matrix.
m[3][1] +
The QPointF class defines a point in the plane using floating point precision.
qreal x() const
Returns the x-coordinate of this point.
qreal y() const
Returns the y-coordinate of this point.
◆ operator*() [8/11]
Definition at line 766 of file qmatrix4x4.h.
780 qRound(yin * matrix.
m[1][1] + matrix.
m[3][1]));
785 x = xin * matrix.
m[0][0] +
786 yin * matrix.
m[1][0] +
788 y = xin * matrix.
m[0][1] +
789 yin * matrix.
m[1][1] +
791 w = xin * matrix.
m[0][3] +
792 yin * matrix.
m[1][3] +
The QPoint class defines a point in the plane using integer precision.
int y() const
Returns the y coordinate of this point.
int x() const
Returns the x coordinate of this point.
Q_DECL_CONSTEXPR int qRound(qreal d)
◆ operator*() [9/11]
Definition at line 801 of file qmatrix4x4.h.
810 return QPointF(xin + matrix.
m[3][0],
811 yin + matrix.
m[3][1]);
814 return QPointF(xin * matrix.
m[0][0] + matrix.
m[3][0],
815 yin * matrix.
m[1][1] + matrix.
m[3][1]);
817 return QPointF(xin * matrix.
m[0][0],
818 yin * matrix.
m[1][1]);
820 x = xin * matrix.
m[0][0] +
821 yin * matrix.
m[1][0] +
823 y = xin * matrix.
m[0][1] +
824 yin * matrix.
m[1][1] +
826 w = xin * matrix.
m[0][3] +
827 yin * matrix.
m[1][3] +
The QPointF class defines a point in the plane using floating point precision.
qreal x() const
Returns the x-coordinate of this point.
qreal y() const
Returns the y-coordinate of this point.
◆ operator*() [10/11]
Definition at line 859 of file qmatrix4x4.h.
862 m.m[0][0] = matrix.
m[0][0] * factor;
863 m.m[0][1] = matrix.
m[0][1] * factor;
864 m.m[0][2] = matrix.
m[0][2] * factor;
865 m.m[0][3] = matrix.
m[0][3] * factor;
866 m.m[1][0] = matrix.
m[1][0] * factor;
867 m.m[1][1] = matrix.
m[1][1] * factor;
868 m.m[1][2] = matrix.
m[1][2] * factor;
869 m.m[1][3] = matrix.
m[1][3] * factor;
870 m.m[2][0] = matrix.
m[2][0] * factor;
871 m.m[2][1] = matrix.
m[2][1] * factor;
872 m.m[2][2] = matrix.
m[2][2] * factor;
873 m.m[2][3] = matrix.
m[2][3] * factor;
874 m.m[3][0] = matrix.
m[3][0] * factor;
875 m.m[3][1] = matrix.
m[3][1] * factor;
876 m.m[3][2] = matrix.
m[3][2] * factor;
877 m.m[3][3] = matrix.
m[3][3] * factor;
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
◆ operator*() [11/11]
Definition at line 881 of file qmatrix4x4.h.
884 m.m[0][0] = matrix.
m[0][0] * factor;
885 m.m[0][1] = matrix.
m[0][1] * factor;
886 m.m[0][2] = matrix.
m[0][2] * factor;
887 m.m[0][3] = matrix.
m[0][3] * factor;
888 m.m[1][0] = matrix.
m[1][0] * factor;
889 m.m[1][1] = matrix.
m[1][1] * factor;
890 m.m[1][2] = matrix.
m[1][2] * factor;
891 m.m[1][3] = matrix.
m[1][3] * factor;
892 m.m[2][0] = matrix.
m[2][0] * factor;
893 m.m[2][1] = matrix.
m[2][1] * factor;
894 m.m[2][2] = matrix.
m[2][2] * factor;
895 m.m[2][3] = matrix.
m[2][3] * factor;
896 m.m[3][0] = matrix.
m[3][0] * factor;
897 m.m[3][1] = matrix.
m[3][1] * factor;
898 m.m[3][2] = matrix.
m[3][2] * factor;
899 m.m[3][3] = matrix.
m[3][3] * factor;
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
◆ operator+()
Definition at line 485 of file qmatrix4x4.h.
Referenced by QMatrix4x4::QMatrix4x4().
488 m.m[0][0] = m1.
m[0][0] + m2.
m[0][0];
489 m.m[0][1] = m1.
m[0][1] + m2.
m[0][1];
490 m.m[0][2] = m1.
m[0][2] + m2.
m[0][2];
491 m.m[0][3] = m1.
m[0][3] + m2.
m[0][3];
492 m.m[1][0] = m1.
m[1][0] + m2.
m[1][0];
493 m.m[1][1] = m1.
m[1][1] + m2.
m[1][1];
494 m.m[1][2] = m1.
m[1][2] + m2.
m[1][2];
495 m.m[1][3] = m1.
m[1][3] + m2.
m[1][3];
496 m.m[2][0] = m1.
m[2][0] + m2.
m[2][0];
497 m.m[2][1] = m1.
m[2][1] + m2.
m[2][1];
498 m.m[2][2] = m1.
m[2][2] + m2.
m[2][2];
499 m.m[2][3] = m1.
m[2][3] + m2.
m[2][3];
500 m.m[3][0] = m1.
m[3][0] + m2.
m[3][0];
501 m.m[3][1] = m1.
m[3][1] + m2.
m[3][1];
502 m.m[3][2] = m1.
m[3][2] + m2.
m[3][2];
503 m.m[3][3] = m1.
m[3][3] + m2.
m[3][3];
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
◆ operator-() [1/2]
Definition at line 507 of file qmatrix4x4.h.
Referenced by QMatrix4x4::QMatrix4x4().
510 m.m[0][0] = m1.
m[0][0] - m2.
m[0][0];
511 m.m[0][1] = m1.
m[0][1] - m2.
m[0][1];
512 m.m[0][2] = m1.
m[0][2] - m2.
m[0][2];
513 m.m[0][3] = m1.
m[0][3] - m2.
m[0][3];
514 m.m[1][0] = m1.
m[1][0] - m2.
m[1][0];
515 m.m[1][1] = m1.
m[1][1] - m2.
m[1][1];
516 m.m[1][2] = m1.
m[1][2] - m2.
m[1][2];
517 m.m[1][3] = m1.
m[1][3] - m2.
m[1][3];
518 m.m[2][0] = m1.
m[2][0] - m2.
m[2][0];
519 m.m[2][1] = m1.
m[2][1] - m2.
m[2][1];
520 m.m[2][2] = m1.
m[2][2] - m2.
m[2][2];
521 m.m[2][3] = m1.
m[2][3] - m2.
m[2][3];
522 m.m[3][0] = m1.
m[3][0] - m2.
m[3][0];
523 m.m[3][1] = m1.
m[3][1] - m2.
m[3][1];
524 m.m[3][2] = m1.
m[3][2] - m2.
m[3][2];
525 m.m[3][3] = m1.
m[3][3] - m2.
m[3][3];
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
◆ operator-() [2/2]
Definition at line 837 of file qmatrix4x4.h.
840 m.m[0][0] = -matrix.
m[0][0];
841 m.m[0][1] = -matrix.
m[0][1];
842 m.m[0][2] = -matrix.
m[0][2];
843 m.m[0][3] = -matrix.
m[0][3];
844 m.m[1][0] = -matrix.
m[1][0];
845 m.m[1][1] = -matrix.
m[1][1];
846 m.m[1][2] = -matrix.
m[1][2];
847 m.m[1][3] = -matrix.
m[1][3];
848 m.m[2][0] = -matrix.
m[2][0];
849 m.m[2][1] = -matrix.
m[2][1];
850 m.m[2][2] = -matrix.
m[2][2];
851 m.m[2][3] = -matrix.
m[2][3];
852 m.m[3][0] = -matrix.
m[3][0];
853 m.m[3][1] = -matrix.
m[3][1];
854 m.m[3][2] = -matrix.
m[3][2];
855 m.m[3][3] = -matrix.
m[3][3];
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
◆ operator/()
◆ operator<<() [1/2]
Definition at line 1955 of file qmatrix4x4.cpp.
Referenced by QMatrix4x4::constData(), and QMatrix4x4::data().
1960 bits +=
"Identity,";
1964 bits +=
"Translation,";
1968 bits +=
"Rotation,";
1969 if (bits.
size() > 0)
1975 << m(0, 0) << m(0, 1) << m(0, 2) << m(0, 3) <<
endl 1976 << m(1, 0) << m(1, 1) << m(1, 2) << m(1, 3) <<
endl 1977 << m(2, 0) << m(2, 1) << m(2, 2) << m(2, 3) <<
endl 1978 << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) <<
endl
QTextStream & endl(QTextStream &stream)
Writes ' ' to the stream and flushes the stream.
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
The QByteArray class provides an array of bytes.
QTextStreamManipulator qSetFieldWidth(int width)
Equivalent to QTextStream::setFieldWidth(width).
QByteArray left(int len) const
Returns a byte array that contains the leftmost len bytes of this byte array.
const char * constData() const
Returns a pointer to the data stored in the byte array.
int size() const
Returns the number of bytes in this byte array.
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
◆ operator<<() [2/2]
Definition at line 2000 of file qmatrix4x4.cpp.
2002 for (
int row = 0; row < 4; ++row)
2003 for (
int col = 0; col < 4; ++col)
2004 stream <<
double(matrix(row, col));
◆ operator>>()
◆ Q_DECLARE_TYPEINFO()
◆ qFuzzyCompare()
Definition at line 903 of file qmatrix4x4.h.
Referenced by QMatrix4x4::QMatrix4x4().
bool qFuzzyCompare(const QMatrix &m1, const QMatrix &m2)
The qFuzzyCompare function is for comparing two matrices using a fuzziness factor.
◆ qGenericMatrixFromMatrix4x4()
Definition at line 997 of file qmatrix4x4.h.
1002 for (
int col = 0; col < N; ++col) {
1003 for (
int row = 0; row <
M; ++row) {
1004 if (col < 4 && row < 4)
1005 values[col * M + row] = m[col * 4 + row];
1006 else if (col == row)
1007 values[col * M + row] = 1.0f;
1009 values[col * M + row] = 0.0f;
T * data()
Returns a pointer to the raw data of this matrix.
The QGenericMatrix class is a template class that represents a NxM transformation matrix with N colum...
const qreal * constData() const
Returns a constant pointer to the raw data of this matrix.
◆ qGenericMatrixToMatrix4x4()
Definition at line 991 of file qmatrix4x4.h.
const T * constData() const
Returns a constant pointer to the raw data of this matrix.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.