QGenericMatrix Class

template <int N, int M, typename T> class QGenericMatrix

Die Klasse QGenericMatrix ist eine Vorlagenklasse, die eine NxM-Transformationsmatrix mit N Spalten und M Zeilen darstellt. Mehr...

Kopfzeile: #include <QGenericMatrix>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

Öffentliche Funktionen

QGenericMatrix()
QGenericMatrix(const T *values)
const T *constData() const
void copyDataTo(T *values) 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
T &operator()(int row, int column)
const T &operator()(int row, int column) const
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
QMatrix2x2
QMatrix2x3
QMatrix2x4
QMatrix3x2
QMatrix3x3
QMatrix3x4
QMatrix4x2
QMatrix4x3
QGenericMatrix<N, M, T> operator*(T factor, const QGenericMatrix<N, M, T> &matrix)
QGenericMatrix<M1, M2, TT> operator*(const QGenericMatrix<NN, M2, TT> &m1, const QGenericMatrix<M1, NN, TT> &m2)
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)

Detaillierte Beschreibung

Die Vorlage QGenericMatrix hat drei Parameter:

NAnzahl der Spalten.
MAnzahl der Zeilen.
TElementtyp, der für die Benutzer der Klasse sichtbar ist.

Siehe auch QMatrix4x4.

Dokumentation der Mitgliedsfunktionen

QGenericMatrix::QGenericMatrix()

Konstruiert eine NxM-Identitätsmatrix.

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

Konstruiert eine Matrix aus den gegebenen N * M Fließkommazahlen values. Es wird angenommen, dass der Inhalt des Arrays values in zeilenweiser Reihenfolge angeordnet ist.

Siehe auch copyDataTo().

const T *QGenericMatrix::constData() const

Gibt einen konstanten Zeiger auf die Rohdaten dieser Matrix zurück.

Siehe auch data().

void QGenericMatrix::copyDataTo(T *values) const

Ruft die N * M Elemente in dieser Matrix ab und kopiert sie in zeilenweiser Reihenfolge nach values.

T *QGenericMatrix::data()

Gibt einen Zeiger auf die Rohdaten dieser Matrix zurück.

Siehe auch constData().

const T *QGenericMatrix::data() const

Gibt einen konstanten Zeiger auf die Rohdaten dieser Matrix zurück.

Siehe auch constData().

void QGenericMatrix::fill(T value)

Füllt alle Elemente dieser Matrix mit value.

bool QGenericMatrix::isIdentity() const

Gibt true zurück, wenn diese Matrix die Identität ist; andernfalls false.

Siehe auch setToIdentity().

void QGenericMatrix::setToIdentity()

Setzt diese Matrix auf die Identität.

Siehe auch isIdentity().

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

Gibt diese Matrix zurück, transponiert um ihre Diagonale.

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

Gibt true zurück, wenn diese Matrix nicht mit other identisch ist; andernfalls false.

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

Gibt einen Verweis auf das Element an der Position (row, column) in dieser Matrix zurück, so dass das Element zugewiesen werden kann.

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

Gibt eine konstante Referenz auf das Element an der Position (row, column) in dieser Matrix zurück.

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

Multipliziert alle Elemente dieser Matrix mit factor.

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

Fügt den Inhalt von other zu dieser Matrix hinzu.

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

Subtrahiert den Inhalt von other von dieser Matrix.

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

Teilt alle Elemente dieser Matrix durch divisor.

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

Gibt true zurück, wenn diese Matrix mit other identisch ist; andernfalls false.

Verwandte Nicht-Mitglieder

QMatrix2x2

Der Typ QMatrix2x2 definiert eine bequeme Instanziierung der Vorlage QGenericMatrix für 2 Spalten, 2 Zeilen und float als Elementtyp.

QMatrix2x3

Der Typ QMatrix2x3 definiert eine praktische Instanziierung der Vorlage QGenericMatrix für 2 Spalten, 3 Zeilen und Float als Elementtyp.

QMatrix2x4

Der Typ QMatrix2x4 definiert eine bequeme Instanziierung der Vorlage QGenericMatrix für 2 Spalten, 4 Zeilen und float als Elementtyp.

QMatrix3x2

Der Typ QMatrix3x2 definiert eine praktische Instanziierung der Vorlage QGenericMatrix für 3 Spalten, 2 Zeilen und Float als Elementtyp.

QMatrix3x3

Der Typ QMatrix3x3 definiert eine bequeme Instanziierung der Vorlage QGenericMatrix für 3 Spalten, 3 Zeilen und float als Elementtyp.

QMatrix3x4

Der Typ QMatrix3x4 definiert eine bequeme Instanziierung der Vorlage QGenericMatrix für 3 Spalten, 4 Zeilen und float als Elementtyp.

QMatrix4x2

Der Typ QMatrix4x2 definiert eine bequeme Instanziierung der Vorlage QGenericMatrix für 4 Spalten, 2 Zeilen und float als Elementtyp.

QMatrix4x3

Der Typ QMatrix4x3 definiert eine praktische Instanziierung der Vorlage QGenericMatrix für 4 Spalten, 3 Zeilen und Float als Elementtyp.

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

Gibt das Ergebnis der Multiplikation aller Elemente von matrix mit factor zurück.

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)

Gibt das Produkt aus der NNxM2-Matrix m1 und der M1xNN-Matrix m2 zurück, um eine M1xM2-Matrix zu erhalten.

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

Gibt das Ergebnis der Multiplikation aller Elemente von matrix mit factor zurück.

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

Gibt die Summe von m1 und m2 zurück.

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

Gibt die Differenz von m1 und m2 zurück.

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

Dies ist eine überladene Funktion.

Gibt die Negation von matrix zurück.

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

Gibt das Ergebnis der Division aller Elemente von matrix durch divisor zurück.

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

Schreibt den angegebenen matrix in den angegebenen stream und gibt eine Referenz auf den Stream zurück.

Siehe auch Serialisierung von Qt-Datentypen.

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

Liest eine NxM-Matrix aus der angegebenen stream in die angegebene matrix und gibt eine Referenz auf den Stream zurück.

Siehe auch Serialisierung von Qt-Datentypen.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.