Changeset 846 for trunk/src/gui/math3d
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/math3d/qgenericmatrix.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 253 253 reference to the stream. 254 254 255 \sa { Format of the QDataStream Operators}255 \sa {s} 256 256 */ 257 257 … … 263 263 and returns a reference to the stream. 264 264 265 \sa { Format of the QDataStream Operators}265 \sa {s} 266 266 */ 267 267 -
trunk/src/gui/math3d/qgenericmatrix.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 199 199 Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator+=(const QGenericMatrix<N, M, T>& other) 200 200 { 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]; 203 204 return *this; 204 205 } … … 207 208 Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator-=(const QGenericMatrix<N, M, T>& other) 208 209 { 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]; 211 213 return *this; 212 214 } … … 215 217 Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator*=(T factor) 216 218 { 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; 219 222 return *this; 220 223 } … … 223 226 Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatrix<N, M, T>& other) const 224 227 { 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 } 229 233 return true; 230 234 } … … 233 237 Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator!=(const QGenericMatrix<N, M, T>& other) const 234 238 { 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 } 239 244 return false; 240 245 } … … 243 248 Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator/=(T divisor) 244 249 { 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; 247 253 return *this; 248 254 } … … 252 258 { 253 259 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]; 256 263 return result; 257 264 } … … 261 268 { 262 269 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]; 265 273 return result; 266 274 } … … 285 293 { 286 294 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]; 289 298 return result; 290 299 } … … 294 303 { 295 304 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; 298 308 return result; 299 309 } … … 303 313 { 304 314 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; 307 318 return result; 308 319 } … … 312 323 { 313 324 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; 316 328 return result; 317 329 } -
trunk/src/gui/math3d/qmatrix4x4.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 1879 1879 reference to the stream. 1880 1880 1881 \sa { Format of the QDataStream Operators}1881 \sa {s} 1882 1882 */ 1883 1883 … … 1897 1897 and returns a reference to the stream. 1898 1898 1899 \sa { Format of the QDataStream Operators}1899 \sa {s} 1900 1900 */ 1901 1901 -
trunk/src/gui/math3d/qmatrix4x4.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 208 208 friend class QGraphicsRotation; 209 209 }; 210 211 210 212 211 213 inline QMatrix4x4::QMatrix4x4 -
trunk/src/gui/math3d/qquaternion.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 596 596 reference to the stream. 597 597 598 \sa { Format of the QDataStream Operators}598 \sa {s} 599 599 */ 600 600 … … 613 613 and returns a reference to the stream. 614 614 615 \sa { Format of the QDataStream Operators}615 \sa {s} 616 616 */ 617 617 -
trunk/src/gui/math3d/qquaternion.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 137 137 }; 138 138 139 140 139 141 inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} 140 142 -
trunk/src/gui/math3d/qvector2d.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 435 435 reference to the stream. 436 436 437 \sa { Format of the QDataStream Operators}437 \sa {s} 438 438 */ 439 439 … … 451 451 and returns a reference to the stream. 452 452 453 \sa { Format of the QDataStream Operators}453 \sa {s} 454 454 */ 455 455 -
trunk/src/gui/math3d/qvector2d.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 127 127 }; 128 128 129 130 129 131 inline QVector2D::QVector2D() : xp(0.0f), yp(0.0f) {} 130 132 -
trunk/src/gui/math3d/qvector3d.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 586 586 reference to the stream. 587 587 588 \sa { Format of the QDataStream Operators}588 \sa {s} 589 589 */ 590 590 … … 603 603 and returns a reference to the stream. 604 604 605 \sa { Format of the QDataStream Operators}605 \sa {s} 606 606 */ 607 607 -
trunk/src/gui/math3d/qvector3d.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 142 142 }; 143 143 144 145 144 146 inline QVector3D::QVector3D() : xp(0.0f), yp(0.0f), zp(0.0f) {} 145 147 -
trunk/src/gui/math3d/qvector4d.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 539 539 reference to the stream. 540 540 541 \sa { Format of the QDataStream Operators}541 \sa {s} 542 542 */ 543 543 … … 556 556 and returns a reference to the stream. 557 557 558 \sa { Format of the QDataStream Operators}558 \sa {s} 559 559 */ 560 560 -
trunk/src/gui/math3d/qvector4d.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 139 139 }; 140 140 141 142 141 143 inline QVector4D::QVector4D() : xp(0.0f), yp(0.0f), zp(0.0f), wp(0.0f) {} 142 144
Note:
See TracChangeset
for help on using the changeset viewer.