Changeset 561 for trunk/src/gui/painting/qtransform.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/qtransform.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 ** … … 50 50 #include <QtCore/qpoint.h> 51 51 #include <QtCore/qrect.h> 52 53 #if defined(Q_OS_VXWORKS) && defined(m_type) 54 # undef m_type 55 #endif 52 56 53 57 QT_BEGIN_HEADER … … 72 76 }; 73 77 78 inline explicit QTransform(Qt::Initialization) : affine(Qt::Uninitialized) {} 74 79 QTransform(); 75 80 QTransform(qreal h11, qreal h12, qreal h13, … … 160 165 161 166 private: 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; 162 180 QMatrix affine; 163 181 qreal m_13; … … 174 192 175 193 /******* inlines *****/ 194 inline QTransform::TransformationType QTransform::inline_type() const 195 { 196 if (m_dirty == TxNone) 197 return static_cast<TransformationType>(m_type); 198 return type(); 199 } 200 176 201 inline bool QTransform::isAffine() const 177 202 { 178 return type() < TxProject;203 return inline_type() < TxProject; 179 204 } 180 205 inline bool QTransform::isIdentity() const 181 206 { 182 return type() == TxNone;207 return inline_type() == TxNone; 183 208 } 184 209 185 210 inline bool QTransform::isInvertible() const 186 211 { 187 return !qFuzzy Compare(determinant() + 1, 1);212 return !qFuzzyIsNull(determinant()); 188 213 } 189 214 … … 194 219 inline bool QTransform::isRotating() const 195 220 { 196 return type() >= TxRotate;221 return inline_type() >= TxRotate; 197 222 } 198 223 199 224 inline bool QTransform::isTranslating() const 200 225 { 201 return type() >= TxTranslate;226 return inline_type() >= TxTranslate; 202 227 } 203 228 … … 312 337 } 313 338 339 inline 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 314 353 /****** stream functions *******************/ 354 #ifndef QT_NO_DATASTREAM 315 355 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &); 316 356 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTransform &); 357 #endif 317 358 318 359 #ifndef QT_NO_DEBUG_STREAM
Note:
See TracChangeset
for help on using the changeset viewer.