183 #define MAPDOUBLE(x, y, nx, ny) \ 187 nx = _m11*fx + _m21*fy + _dx; \ 188 ny = _m12*fx + _m22*fy + _dy; \ 191 #define MAPINT(x, y, nx, ny) \ 195 nx = qRound(_m11*fx + _m21*fy + _dx); \ 196 ny = qRound(_m12*fx + _m22*fy + _dy); \ 405 result =
QRect(x, y, w, h);
416 xmin =
qMin(xmin, x);
417 ymin =
qMin(ymin, y);
418 xmax =
qMax(xmax, x);
419 ymax =
qMax(ymax, y);
421 xmin =
qMin(xmin, x);
422 ymin =
qMin(ymin, y);
423 xmax =
qMax(xmax, x);
424 ymax =
qMax(ymax, y);
426 xmin =
qMin(xmin, x);
427 ymin =
qMin(ymin, y);
428 xmax =
qMax(xmax, x);
429 ymax =
qMax(ymax, y);
473 result =
QRectF(x, y, w, h);
483 xmin =
qMin(xmin, x);
484 ymin =
qMin(ymin, y);
485 xmax =
qMax(xmax, x);
486 ymax =
qMax(ymax, y);
488 xmin =
qMin(xmin, x);
489 ymin =
qMin(ymin, y);
490 xmax =
qMax(xmax, x);
491 ymax =
qMax(ymax, y);
493 xmin =
qMin(xmin, x);
494 ymin =
qMin(ymin, y);
495 xmax =
qMax(xmax, x);
496 ymax =
qMax(ymax, y);
497 result =
QRectF(xmin, ymin, xmax-xmin, ymax - ymin);
645 for(i = 0; i < size; i++) {
646 MAPINT(da[i].x(), da[i].y(), dp[i].rx(), dp[i].ry());
669 for(i = 0; i < size; i++) {
670 MAPDOUBLE(da[i].xp, da[i].yp, dp[i].xp, dp[i].yp);
715 if (
_dx == 0.0 &&
_dy == 0.0)
756 if (
_dx != 0.0 ||
_dy != 0.0) {
797 }
else if (
m12() == 0.0F &&
m21() == 0.0F) {
810 result =
QRect(x, y, w, h);
874 for(i = 0; i< 4; i++)
876 qDebug(
"width=%f, height=%f",
qSqrt((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0])),
877 qSqrt((x[0]-x[3])*(x[0]-x[3]) + (y[0]-y[3])*(y[0]-y[3])));
994 if (a == 90. || a == -270.)
996 else if (a == 270. || a == -90.)
1010 _m21 = tm21; _m22 = tm22;
1071 *invertible =
false;
1077 qreal dinv = 1.0/dtr;
1170 return QMatrix(tm11, tm12, tm21, tm22, tdx, tdy,
true);
1209 #ifndef QT_NO_DATASTREAM 1226 s << (float)m.
m11() << (float)m.
m12() << (float)m.
m21()
1227 << (float)m.
m22() << (float)m.
dx() << (float)m.
dy();
1229 s << double(m.
m11())
1258 m.
setMatrix(m11, m12, m21, m22, dx, dy);
1268 m.
setMatrix(m11, m12, m21, m22, dx, dy);
1272 #endif // QT_NO_DATASTREAM 1274 #ifndef QT_NO_DEBUG_STREAM 1279 <<
" 12=" << m.
m12()
1280 <<
" 21=" << m.
m21()
1281 <<
" 22=" << m.
m22()
The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
The QPainterPath::Element class specifies the position and type of a subpath.
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
QMatrix()
Constructs an identity matrix.
Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion ®ion)
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
The QLine class provides a two-dimensional vector using integer precision.
The QMatrix class specifies 2D transformations of a coordinate system.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
QPoint p1() const
Returns the line's start point.
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
QPointF p1() const
Returns the line's start point.
QPoint p2() const
Returns the line's end point.
qreal dx() const
Returns the horizontal translation factor.
The QPointF class defines a point in the plane using floating point precision.
#define MAPDOUBLE(x, y, nx, ny)
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
void reset()
Resets the matrix to an identity matrix, i.e.
long ASN1_INTEGER_get ASN1_INTEGER * a
The QPolygon class provides a vector of points using integer precision.
int height() const
Returns the height of the rectangle.
qreal m12() const
Returns the vertical shearing factor.
qreal y
the y coordinate of the element's position.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
#define MAPINT(x, y, nx, ny)
QMatrix & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
qreal determinant() const
Returns the matrix's determinant.
QPolygon toPolygon() const
Creates and returns a QPolygon by converting each QPointF to a QPoint.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
qreal x() const
Returns the x-coordinate of this point.
The QLineF class provides a two-dimensional vector using floating point precision.
qreal m11() const
Returns the horizontal scaling factor.
QPolygon mapToPolygon(const QRect &r) const
Creates and returns a QPolygon representation of the given rectangle, mapped into the coordinate syst...
Q_CORE_EXPORT void qDebug(const char *,...)
QMatrix & operator*=(const QMatrix &)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qreal m21() const
Returns the horizontal shearing factor.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
QMatrix & rotate(qreal a)
Rotates the coordinate system the given degrees counterclockwise.
QPolygonF toFillPolygon(const QMatrix &matrix=QMatrix()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
qreal height() const
Returns the height of the rectangle.
The QPolygonF class provides a vector of points using floating point precision.
QMatrix & operator=(const QMatrix &)
Assigns the given matrix's values to this matrix.
qreal width() const
Returns the width of the rectangle.
The QRegion class specifies a clip region for a painter.
QMatrix & shear(qreal sh, qreal sv)
Shears the coordinate system by sh horizontally and sv vertically, and returns a reference to the mat...
void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy)
Sets the matrix elements to the specified values, m11, m12, m21, m22, dx and dy.
QDataStream & operator<<(QDataStream &stream, const QMatrix &matrix)
Writes the given matrix to the given stream and returns a reference to the stream.
int version() const
Returns the version number of the data serialization format.
int top() const
Returns the y-coordinate of the rectangle's top edge.
QDataStream & operator>>(QDataStream &stream, QMatrix &matrix)
Reads the given matrix from the given stream and returns a reference to the stream.
int right() const
Returns the x-coordinate of the rectangle's right edge.
void map(int x, int y, int *tx, int *ty) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QMatrix operator*(const QMatrix &o) const
Returns the result of multiplying this matrix by the given matrix.
int y() const
Returns the y-coordinate of the rectangle's top edge.
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
qreal dy() const
Returns the vertical translation factor.
The QPoint class defines a point in the plane using integer precision.
QPointF p2() const
Returns the line's end point.
QVector< QPainterPath::Element > elements
The QRect class defines a rectangle in the plane using integer precision.
#define Q_AUTOTEST_EXPORT
bool operator==(const QMatrix &) const
Returns true if this matrix is equal to the given matrix, otherwise returns false.
qreal x
the x coordinate of the element's position.
int y() const
Returns the y coordinate of this point.
qreal y() const
Returns the y-coordinate of this point.
bool operator!=(const QMatrix &) const
Returns true if this matrix is not equal to the given matrix, otherwise returns false.
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
T * data()
Returns a pointer to the data stored in the vector.
void setPoints(int nPoints, const int *points)
Resizes the polygon to nPoints and populates it with the given points.
bool isIdentity() const
Returns true if the matrix is the identity matrix, otherwise returns false.
int elementCount() const
Returns the number of path elements in the painter path.
The QDataStream class provides serialization of binary data to a QIODevice.
const T * constData() const
Returns a const pointer to the data stored in the vector.
int x() const
Returns the x coordinate of this point.
QMatrix & scale(qreal sx, qreal sy)
Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the mat...
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
int size() const
Returns the number of items in the vector.
Q_DECL_CONSTEXPR int qRound(qreal d)
qreal m22() const
Returns the vertical scaling factor.
QMatrix inverted(bool *invertible=0) const
Returns an inverted copy of this matrix.
QScopedPointer< QPainterPathPrivate, QPainterPathPrivateDeleter > d_ptr