src/gui/painting/qmatrix.cpp File Reference

#include "qdatastream.h"
#include "qdebug.h"
#include "qmath_p.h"
#include "qmatrix.h"
#include "qregion.h"
#include "qpainterpath.h"
#include "qvariant.h"
#include <limits.h>

Include dependency graph for qmatrix.cpp:

Go to the source code of this file.

Defines

#define MAPDOUBLE(x, y, nx, ny)
#define MAPINT(x, y, nx, ny)

Functions

Q_GUI_EXPORT QPainterPath operator * (const QPainterPath &p, const QMatrix &m)
QDataStreamoperator<< (QDataStream &s, const QMatrix &m)
QDataStreamoperator>> (QDataStream &s, QMatrix &m)
QDebug operator<< (QDebug dbg, const QMatrix &m)

Variables

const qreal deg2rad = qreal(0.017453292519943295769)


Define Documentation

#define MAPDOUBLE ( x,
y,
nx,
ny   ) 

Value:

{ \
    qreal fx = x; \
    qreal fy = y; \
    nx = _m11*fx + _m21*fy + _dx; \
    ny = _m12*fx + _m22*fy + _dy; \
}

Definition at line 170 of file qmatrix.cpp.

Referenced by QMatrix::map(), QMatrix::mapRect(), and QMatrix::mapToPolygon().

#define MAPINT ( x,
y,
nx,
ny   ) 

Value:

{ \
    qreal fx = x; \
    qreal fy = y; \
    nx = qRound(_m11*fx + _m21*fy + _dx); \
    ny = qRound(_m12*fx + _m22*fy + _dy); \
}

Definition at line 178 of file qmatrix.cpp.

Referenced by QMatrix::map().


Function Documentation

Q_GUI_EXPORT QPainterPath operator * ( const QPainterPath p,
const QMatrix m 
) [related]

Definition at line 1135 of file qmatrix.cpp.

01136 {
01137     return m.map(p);
01138 }

QDebug operator<< ( QDebug  dbg,
const QMatrix m 
)

Definition at line 1204 of file qmatrix.cpp.

01205 {
01206     dbg.nospace() << "QMatrix("
01207                   << "11=" << m.m11()
01208                   << " 12=" << m.m12()
01209                   << " 21=" << m.m21()
01210                   << " 22=" << m.m22()
01211                   << " dx=" << m.dx()
01212                   << " dy=" << m.dy()
01213                   << ")";
01214     return dbg.space();
01215 }

QDataStream& operator<< ( QDataStream s,
const QMatrix m 
) [related]

Definition at line 1155 of file qmatrix.cpp.

01156 {
01157     if (s.version() == 1) {
01158         s << (float)m.m11() << (float)m.m12() << (float)m.m21()
01159           << (float)m.m22() << (float)m.dx()  << (float)m.dy();
01160     } else {
01161         s << double(m.m11())
01162           << double(m.m12())
01163           << double(m.m21())
01164           << double(m.m22())
01165           << double(m.dx())
01166           << double(m.dy());
01167     }
01168     return s;
01169 }

QDataStream& operator>> ( QDataStream s,
QMatrix m 
) [related]

Definition at line 1181 of file qmatrix.cpp.

01182 {
01183     if (s.version() == 1) {
01184         float m11, m12, m21, m22, dx, dy;
01185         s >> m11;  s >> m12;  s >> m21;  s >> m22;
01186         s >> dx;   s >> dy;
01187         m.setMatrix(m11, m12, m21, m22, dx, dy);
01188     }
01189     else {
01190         double m11, m12, m21, m22, dx, dy;
01191         s >> m11;
01192         s >> m12;
01193         s >> m21;
01194         s >> m22;
01195         s >> dx;
01196         s >> dy;
01197         m.setMatrix(m11, m12, m21, m22, dx, dy);
01198     }
01199     return s;
01200 }


Variable Documentation

const qreal deg2rad = qreal(0.017453292519943295769)

Definition at line 940 of file qmatrix.cpp.

Referenced by parseTransformationMatrix(), QSvgAnimateTransform::resolveMatrix(), and Q3SVGPaintEnginePrivate::setTransform().


Generated on Thu Mar 15 13:33:58 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1