Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qtransform.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5050#include <QtCore/qpoint.h>
    5151#include <QtCore/qrect.h>
     52
     53#if defined(Q_OS_VXWORKS) && defined(m_type)
     54#  undef m_type
     55#endif
    5256
    5357QT_BEGIN_HEADER
     
    7276    };
    7377
     78    inline explicit QTransform(Qt::Initialization) : affine(Qt::Uninitialized) {}
    7479    QTransform();
    7580    QTransform(qreal h11, qreal h12, qreal h13,
     
    160165
    161166private:
     167    inline QTransform(qreal h11, qreal h12, qreal h13,
     168                      qreal h21, qreal h22, qreal h23,
     169                      qreal h31, qreal h32, qreal h33, bool)
     170        : affine(h11, h12, h21, h22, h31, h32, true)
     171        , m_13(h13), m_23(h23), m_33(h33)
     172        , m_type(TxNone)
     173        , m_dirty(TxProject) {}
     174    inline QTransform(bool)
     175        : affine(true)
     176        , m_13(0), m_23(0), m_33(1)
     177        , m_type(TxNone)
     178        , m_dirty(TxNone) {}
     179    inline TransformationType inline_type() const;
    162180    QMatrix affine;
    163181    qreal   m_13;
     
    174192
    175193/******* inlines *****/
     194inline QTransform::TransformationType QTransform::inline_type() const
     195{
     196    if (m_dirty == TxNone)
     197        return static_cast<TransformationType>(m_type);
     198    return type();
     199}
     200
    176201inline bool QTransform::isAffine() const
    177202{
    178     return type() < TxProject;
     203    return inline_type() < TxProject;
    179204}
    180205inline bool QTransform::isIdentity() const
    181206{
    182     return type() == TxNone;
     207    return inline_type() == TxNone;
    183208}
    184209
    185210inline bool QTransform::isInvertible() const
    186211{
    187     return !qFuzzyCompare(determinant() + 1, 1);
     212    return !qFuzzyIsNull(determinant());
    188213}
    189214
     
    194219inline bool QTransform::isRotating() const
    195220{
    196     return type() >= TxRotate;
     221    return inline_type() >= TxRotate;
    197222}
    198223
    199224inline bool QTransform::isTranslating() const
    200225{
    201     return type() >= TxTranslate;
     226    return inline_type() >= TxTranslate;
    202227}
    203228
     
    312337}
    313338
     339inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
     340{
     341    return qFuzzyCompare(t1.m11(), t2.m11())
     342        && qFuzzyCompare(t1.m12(), t2.m12())
     343        && qFuzzyCompare(t1.m13(), t2.m13())
     344        && qFuzzyCompare(t1.m21(), t2.m21())
     345        && qFuzzyCompare(t1.m22(), t2.m22())
     346        && qFuzzyCompare(t1.m23(), t2.m23())
     347        && qFuzzyCompare(t1.m31(), t2.m31())
     348        && qFuzzyCompare(t1.m32(), t2.m32())
     349        && qFuzzyCompare(t1.m33(), t2.m33());
     350}
     351
     352
    314353/****** stream functions *******************/
     354#ifndef QT_NO_DATASTREAM
    315355Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &);
    316356Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTransform &);
     357#endif
    317358
    318359#ifndef QT_NO_DEBUG_STREAM
Note: See TracChangeset for help on using the changeset viewer.