Changeset 561 for trunk/src/gui/painting/qmatrix.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/painting/qmatrix.h
r2 r561 2 2 ** 3 3 ** 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) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 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. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** 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. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 62 62 { 63 63 public: 64 inline explicit QMatrix(Qt::Initialization) {} 64 65 QMatrix(); 65 66 QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, … … 100 101 QMatrix &rotate(qreal a); 101 102 102 bool isInvertible() const { return !qFuzzyCompare(_m11*_m22 - _m12*_m21 + 1, 1); } 103 qreal det() const { return _m11*_m22 - _m12*_m21; } 103 bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); } 104 qreal determinant() const { return _m11*_m22 - _m12*_m21; } 105 #ifdef QT_DEPRECATED 106 QT_DEPRECATED qreal det() const { return _m11*_m22 - _m12*_m21; } 107 #endif 104 108 105 109 QMatrix inverted(bool *invertible = 0) const; … … 122 126 123 127 private: 128 inline QMatrix(bool) 129 : _m11(1.) 130 , _m12(0.) 131 , _m21(0.) 132 , _m22(1.) 133 , _dx(0.) 134 , _dy(0.) {} 135 inline QMatrix(qreal am11, qreal am12, qreal am21, qreal am22, qreal adx, qreal ady, bool) 136 : _m11(am11) 137 , _m12(am12) 138 , _m21(am21) 139 , _m22(am22) 140 , _dx(adx) 141 , _dy(ady) {} 124 142 friend class QTransform; 125 143 qreal _m11, _m12; … … 148 166 inline bool QMatrix::isIdentity() const 149 167 { 150 return qFuzzy Compare(_m11, 1) && qFuzzyCompare(_m22, 1) && qFuzzyCompare(_m12 + 1, 1)151 && qFuzzy Compare(_m21 + 1, 1) && qFuzzyCompare(_dx + 1, 1) && qFuzzyCompare(_dy + 1, 1);168 return qFuzzyIsNull(_m11 - 1) && qFuzzyIsNull(_m22 - 1) && qFuzzyIsNull(_m12) 169 && qFuzzyIsNull(_m21) && qFuzzyIsNull(_dx) && qFuzzyIsNull(_dy); 152 170 } 171 172 inline bool qFuzzyCompare(const QMatrix& m1, const QMatrix& m2) 173 { 174 return qFuzzyCompare(m1.m11(), m2.m11()) 175 && qFuzzyCompare(m1.m12(), m2.m12()) 176 && qFuzzyCompare(m1.m21(), m2.m21()) 177 && qFuzzyCompare(m1.m22(), m2.m22()) 178 && qFuzzyCompare(m1.dx(), m2.dx()) 179 && qFuzzyCompare(m1.dy(), m2.dy()); 180 } 181 153 182 154 183 /***************************************************************************** … … 156 185 *****************************************************************************/ 157 186 187 #ifndef QT_NO_DATASTREAM 158 188 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QMatrix &); 159 189 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QMatrix &); 190 #endif 160 191 161 192 #ifndef QT_NO_DEBUG_STREAM
Note:
See TracChangeset
for help on using the changeset viewer.