Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QGenericMatrix Class Reference

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

 #include <QGenericMatrix>

This class was introduced in Qt 4.6.

Public Functions

QGenericMatrix ()
QGenericMatrix ( const QGenericMatrix<N, M, T> & other )
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
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

Related Non-Members

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 )

Detailed Description

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:

NNumber of columns.
MNumber of rows.
TElement type that is visible to users of the class.

See also QMatrix4x4.

Member Function Documentation

QGenericMatrix::QGenericMatrix ()

Constructs a NxM identity matrix.

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

Constructs a copy of other.

QGenericMatrix::QGenericMatrix ( const T * values )

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.

See also copyDataTo().

const T * QGenericMatrix::constData () const

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

See also data().

void QGenericMatrix::copyDataTo ( T * values ) const

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

T * QGenericMatrix::data ()

Returns a pointer to the raw data of this matrix.

See also constData().

const T * QGenericMatrix::data () const

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

See also constData().

void QGenericMatrix::fill ( T value )

Fills all elements of this matrix with value.

bool QGenericMatrix::isIdentity () const

Returns true if this matrix is the identity; false otherwise.

See also setToIdentity().

void QGenericMatrix::setToIdentity ()

Sets this matrix to the identity.

See also 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

Returns 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

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

Related Non-Members

typedef QMatrix2x2

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

typedef QMatrix2x3

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

typedef QMatrix2x4

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

typedef QMatrix3x2

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

typedef QMatrix3x3

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

typedef QMatrix3x4

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

typedef QMatrix4x2

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

typedef QMatrix4x3

The QMatrix4x3 type defines a convenient instantiation of the QGenericMatrix template for 4 columns, 3 rows, and qreal 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 )

This is an overloaded function.

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 )

Writes the given matrix to the given stream and returns a reference to the stream.

See also Serializing Qt Data Types.

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

Reads a NxM matrix from the given stream into the given matrix and returns a reference to the stream.

See also Serializing Qt Data Types.

Publicit�

Best Of

Actualit�s les plus lues

Semaine
Mois
Ann�e
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la sp�cification pour la conception d'applications parall�les C++ utilisant le GPU 22
  2. � Quelque chose ne va vraiment pas avec les d�veloppeurs "modernes" �, un d�veloppeur � "l'ancienne" critique la multiplication des biblioth�ques 38
  3. Les d�veloppeurs ignorent-ils trop les failles d�couvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. RIM : � 13 % des d�veloppeurs ont gagn� plus de 100 000 $ sur l'AppWord �, Qt et open-source au menu du BlackBerry DevCon Europe 0
  5. BlackBerry 10 : premi�res images du prochain OS de RIM qui devrait int�grer des widgets et des tuiles inspir�es de Windows Phone 0
  6. Quelles nouveaut�s de C++11 Visual C++ doit-il rapidement int�grer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil d�claratif et extensible pour la compilation de projets Qt 17
Page suivante

Le Qt Quarterly au hasard

Logo

Le rep�rage des paires de parenth�ses avec QSyntaxHighlighter

Qt Quarterly est la revue trimestrielle propos�e par Nokia et � destination des d�veloppeurs Qt. Ces articles d'une grande qualit� technique sont r�dig�s par des experts Qt. Lire l'article.

Communaut�

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la r�daction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, �crite par Nokia Corporation and/or its subsidiary(-ies). Les �ventuels probl�mes r�sultant d'une mauvaise traduction ne sont pas imputables � Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits r�serv�s Developpez LLC. Aucune reproduction, m�me partielle, ne peut �tre faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'� 3 ans de prison et jusqu'� 300 000 E de dommages et int�r�ts. Cette page est d�pos�e � la SACD.
Vous avez d�nich� une erreur ? Un bug ? Une redirection cass�e ? Ou tout autre probl�me, quel qu'il soit ? Ou bien vous d�sirez participer � ce projet de traduction ? N'h�sitez pas � nous contacter ou par MP !
 
 
 
 
Partenaires

H�bergement Web