Changeset 846 for trunk/src/gui/math3d


Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/math3d/qgenericmatrix.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    253253    reference to the stream.
    254254
    255     \sa {Format of the QDataStream Operators}
     255    \sa {s}
    256256*/
    257257
     
    263263    and returns a reference to the stream.
    264264
    265     \sa {Format of the QDataStream Operators}
     265    \sa {s}
    266266*/
    267267
  • trunk/src/gui/math3d/qgenericmatrix.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    199199Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator+=(const QGenericMatrix<N, M, T>& other)
    200200{
    201     for (int index = 0; index < N * M; ++index)
    202         m[0][index] += other.m[0][index];
     201    for (int row = 0; row < M; ++row)
     202        for (int col = 0; col < N; ++col)
     203            m[col][row] += other.m[col][row];
    203204    return *this;
    204205}
     
    207208Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator-=(const QGenericMatrix<N, M, T>& other)
    208209{
    209     for (int index = 0; index < N * M; ++index)
    210         m[0][index] -= other.m[0][index];
     210    for (int row = 0; row < M; ++row)
     211        for (int col = 0; col < N; ++col)
     212            m[col][row] -= other.m[col][row];
    211213    return *this;
    212214}
     
    215217Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator*=(T factor)
    216218{
    217     for (int index = 0; index < N * M; ++index)
    218         m[0][index] *= factor;
     219    for (int row = 0; row < M; ++row)
     220        for (int col = 0; col < N; ++col)
     221            m[col][row] *= factor;
    219222    return *this;
    220223}
     
    223226Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatrix<N, M, T>& other) const
    224227{
    225     for (int index = 0; index < N * M; ++index) {
    226         if (m[0][index] != other.m[0][index])
    227             return false;
    228     }
     228    for (int row = 0; row < M; ++row)
     229        for (int col = 0; col < N; ++col)  {
     230            if (m[col][row] != other.m[col][row])
     231                return false;
     232        }
    229233    return true;
    230234}
     
    233237Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator!=(const QGenericMatrix<N, M, T>& other) const
    234238{
    235     for (int index = 0; index < N * M; ++index) {
    236         if (m[0][index] != other.m[0][index])
    237             return true;
    238     }
     239    for (int row = 0; row < M; ++row)
     240        for (int col = 0; col < N; ++col) {
     241            if (m[col][row] != other.m[col][row])
     242                return true;
     243        }
    239244    return false;
    240245}
     
    243248Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator/=(T divisor)
    244249{
    245     for (int index = 0; index < N * M; ++index)
    246         m[0][index] /= divisor;
     250    for (int row = 0; row < M; ++row)
     251        for (int col = 0; col < N; ++col)
     252            m[col][row] /= divisor;
    247253    return *this;
    248254}
     
    252258{
    253259    QGenericMatrix<N, M, T> result(1);
    254     for (int index = 0; index < N * M; ++index)
    255         result.m[0][index] = m1.m[0][index] + m2.m[0][index];
     260    for (int row = 0; row < M; ++row)
     261        for (int col = 0; col < N; ++col)
     262            result.m[col][row] = m1.m[col][row] + m2.m[col][row];
    256263    return result;
    257264}
     
    261268{
    262269    QGenericMatrix<N, M, T> result(1);
    263     for (int index = 0; index < N * M; ++index)
    264         result.m[0][index] = m1.m[0][index] - m2.m[0][index];
     270    for (int row = 0; row < M; ++row)
     271        for (int col = 0; col < N; ++col)
     272            result.m[col][row] = m1.m[col][row] - m2.m[col][row];
    265273    return result;
    266274}
     
    285293{
    286294    QGenericMatrix<N, M, T> result(1);
    287     for (int index = 0; index < N * M; ++index)
    288         result.m[0][index] = -matrix.m[0][index];
     295    for (int row = 0; row < M; ++row)
     296        for (int col = 0; col < N; ++col)
     297            result.m[col][row] = -matrix.m[col][row];
    289298    return result;
    290299}
     
    294303{
    295304    QGenericMatrix<N, M, T> result(1);
    296     for (int index = 0; index < N * M; ++index)
    297         result.m[0][index] = matrix.m[0][index] * factor;
     305    for (int row = 0; row < M; ++row)
     306        for (int col = 0; col < N; ++col)
     307            result.m[col][row] = matrix.m[col][row] * factor;
    298308    return result;
    299309}
     
    303313{
    304314    QGenericMatrix<N, M, T> result(1);
    305     for (int index = 0; index < N * M; ++index)
    306         result.m[0][index] = matrix.m[0][index] * factor;
     315    for (int row = 0; row < M; ++row)
     316        for (int col = 0; col < N; ++col)
     317            result.m[col][row] = matrix.m[col][row] * factor;
    307318    return result;
    308319}
     
    312323{
    313324    QGenericMatrix<N, M, T> result(1);
    314     for (int index = 0; index < N * M; ++index)
    315         result.m[0][index] = matrix.m[0][index] / divisor;
     325    for (int row = 0; row < M; ++row)
     326        for (int col = 0; col < N; ++col)
     327            result.m[col][row] = matrix.m[col][row] / divisor;
    316328    return result;
    317329}
  • trunk/src/gui/math3d/qmatrix4x4.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    18791879    reference to the stream.
    18801880
    1881     \sa {Format of the QDataStream Operators}
     1881    \sa {s}
    18821882*/
    18831883
     
    18971897    and returns a reference to the stream.
    18981898
    1899     \sa {Format of the QDataStream Operators}
     1899    \sa {s}
    19001900*/
    19011901
  • trunk/src/gui/math3d/qmatrix4x4.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    208208    friend class QGraphicsRotation;
    209209};
     210
     211
    210212
    211213inline QMatrix4x4::QMatrix4x4
  • trunk/src/gui/math3d/qquaternion.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    596596    reference to the stream.
    597597
    598     \sa {Format of the QDataStream Operators}
     598    \sa {s}
    599599*/
    600600
     
    613613    and returns a reference to the stream.
    614614
    615     \sa {Format of the QDataStream Operators}
     615    \sa {s}
    616616*/
    617617
  • trunk/src/gui/math3d/qquaternion.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    137137};
    138138
     139
     140
    139141inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {}
    140142
  • trunk/src/gui/math3d/qvector2d.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    435435    reference to the stream.
    436436
    437     \sa {Format of the QDataStream Operators}
     437    \sa {s}
    438438*/
    439439
     
    451451    and returns a reference to the stream.
    452452
    453     \sa {Format of the QDataStream Operators}
     453    \sa {s}
    454454*/
    455455
  • trunk/src/gui/math3d/qvector2d.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    127127};
    128128
     129
     130
    129131inline QVector2D::QVector2D() : xp(0.0f), yp(0.0f) {}
    130132
  • trunk/src/gui/math3d/qvector3d.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    586586    reference to the stream.
    587587
    588     \sa {Format of the QDataStream Operators}
     588    \sa {s}
    589589*/
    590590
     
    603603    and returns a reference to the stream.
    604604
    605     \sa {Format of the QDataStream Operators}
     605    \sa {s}
    606606*/
    607607
  • trunk/src/gui/math3d/qvector3d.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    142142};
    143143
     144
     145
    144146inline QVector3D::QVector3D() : xp(0.0f), yp(0.0f), zp(0.0f) {}
    145147
  • trunk/src/gui/math3d/qvector4d.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    539539    reference to the stream.
    540540
    541     \sa {Format of the QDataStream Operators}
     541    \sa {s}
    542542*/
    543543
     
    556556    and returns a reference to the stream.
    557557
    558     \sa {Format of the QDataStream Operators}
     558    \sa {s}
    559559*/
    560560
  • trunk/src/gui/math3d/qvector4d.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    139139};
    140140
     141
     142
    141143inline QVector4D::QVector4D() : xp(0.0f), yp(0.0f), zp(0.0f), wp(0.0f) {}
    142144
Note: See TracChangeset for help on using the changeset viewer.