Qt 4.8
Classes | Macros | Functions
qdeclarativeparticles.cpp File Reference
#include "qdeclarativeparticles_p.h"
#include <qdeclarativeinfo.h>
#include <private/qdeclarativeitem_p.h>
#include <private/qdeclarativepixmapcache_p.h>
#include <QtCore/QAbstractAnimation>
#include <QPainter>
#include <QtGui/qdrawutil.h>
#include <QVarLengthArray>
#include <stdlib.h>
#include <math.h>

Go to the source code of this file.

Classes

class  QDeclarativeParticle
 
class  QDeclarativeParticlesPainter
 
class  QDeclarativeParticlesPrivate
 
class  TickAnimationProxy< T, method >
 

Macros

#define INT_MAX   2147483647
 
#define M_PI   3.14159265358979323846
 
#define M_PI_2   (M_PI / 2.)
 
#define PI_SQR   9.8696044
 

Functions

qreal fastCos (qreal theta)
 
qreal fastSin (qreal theta)
 

Macro Definition Documentation

◆ INT_MAX

#define INT_MAX   2147483647

Definition at line 62 of file qdeclarativeparticles.cpp.

Referenced by QScriptDebuggerPrivate::_q_goToLine(), QTextControlPrivate::_q_updateBlock(), QDeclarativeImportsPrivate::add(), QList< QPostEvent >::append(), QContiguousCache< T >::areIndexesValid(), QDeclarativeObjectMethodScriptClass::callOverloaded(), QScript::callQtMethod(), clampScrollStep(), QDesktopWidgetPrivate::cleanup(), QPrintDialogPrivate::closeCarbonPrintPanel(), QListViewPrivate::closestIndex(), closestMatch(), QUnifiedTimer::closestPauseAnimationTimeToFinish(), QCompletionModel::completionCount(), QImageData::create(), QDefaultItemEditorFactory::createEditor(), QTextLayout::createLine(), QAbstractItemModel::decodeData(), directorySizeDistance(), QTextDocumentLayout::documentChanged(), QListModeViewBase::doStaticLayout(), QTextLayout::draw(), QCommonStyle::drawControl(), QMotifStyle::drawControl(), QTableWidget::dropEvent(), QAbstractTableModel::dropMimeData(), QAbstractListModel::dropMimeData(), QStandardItemModel::dropMimeData(), QGridLayoutPrivate::effectiveMargins(), QTextLayout::endLayout(), QTextDocumentLayoutPrivate::ensureLayoutedByPosition(), QTextDocumentLayoutPrivate::ensureLayoutFinished(), QIconLoaderEngine::entryForSize(), QUnsortedModelEngine::filter(), findArgEscapes(), QClipData::fixup(), QPlainTextDocumentLayout::frameBoundingRect(), QWidgetPrivate::frameStrut(), getWinLocaleName(), QIntersectionFinder::hasIntersections(), QHeaderView::headerDataChanged(), QDesktopWidgetPrivate::init(), QContiguousCache< T >::insert(), QTextLine::layout_helper(), QPlainTextDocumentLayout::layoutBlock(), QTextDocumentLayoutPrivate::layoutBlock(), QTextDocumentLayoutPrivate::layoutFrame(), mdiAreaNavigate(), QWin32PrintEngine::metric(), QPdfBaseEngine::metric(), QWidget::metric(), QSizeGrip::mousePressEvent(), QTreeView::moveCursor(), QList< QPostEvent >::operator+=(), QPdf::patternForBrush(), QTextDocument::print(), QTessellatorPrivate::processIntersections(), QSortFilterProxyModelPrivate::proxy_item_range(), PtsToRegion(), q_round_bound(), qAllocMore(), QImage::QImage(), QIntValidator::QIntValidator(), qSafeFloatToQ16Dot16(), qt_fetch_linear_gradient(), qt_grab_cursor(), qt_region_strictContains(), query_colormap(), QIODevice::read(), QTextStream::readAll(), QIODevice::readLine(), QTriangulator< T >::ComplexToSimple::removeUnwantedEdgesAndConnect(), QDeclarativeText::resetMaximumLineCount(), QDesktopWidget::screenNumber(), QTextControl::setExtraSelections(), QTextLine::setLineWidth(), QDeclarativeText::setMaximumLineCount(), QTestLog::setMaxWarnings(), QMacPrintEngine::setProperty(), QRegion::setRects(), QDeclarativeTextPrivate::setupTextLayout(), QProgressDialog::setValue(), QStyle::sliderPositionFromValue(), QCommonStyle::subControlRect(), QPlastiqueStyle::subControlRect(), QWindowsMobileStyle::subControlRect(), QStyleSheetStyle::subControlRect(), QByteArray::toInt(), QString::toInt(), QLocale::toInt(), QETWidget::translateGestureEvent(), QDeclarativeTextEdit::updateImgCache(), QPrintDialogPrivate::updateWidgets(), QFutureInterfaceBase::waitForResult(), xic_draw_callback(), and QTextLine::xToCursor().

◆ M_PI

#define M_PI   3.14159265358979323846

◆ M_PI_2

#define M_PI_2   (M_PI / 2.)

Definition at line 59 of file qdeclarativeparticles.cpp.

Referenced by fastCos().

◆ PI_SQR

#define PI_SQR   9.8696044

Definition at line 66 of file qdeclarativeparticles.cpp.

Referenced by fastSin().

Function Documentation

◆ fastCos()

qreal fastCos ( qreal  theta)
inline

Definition at line 77 of file qdeclarativeparticles.cpp.

Referenced by QDeclarativeParticlesPrivate::createParticle().

78 {
79  theta += M_PI_2;
80  if (theta > M_PI)
81  theta -= 2 * M_PI;
82 
83  return fastSin(theta);
84 }
#define M_PI_2
#define M_PI
qreal fastSin(qreal theta)

◆ fastSin()

qreal fastSin ( qreal  theta)
inline

Definition at line 68 of file qdeclarativeparticles.cpp.

Referenced by QDeclarativeParticlesPrivate::createParticle(), and fastCos().

69 {
70  const qreal b = 4 / M_PI;
71  const qreal c = -4 / PI_SQR;
72 
73  qreal y = b * theta + c * theta * qAbs(theta);
74  return y;
75 }
double qreal
Definition: qglobal.h:1193
unsigned char c[8]
Definition: qnumeric_p.h:62
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define PI_SQR
#define M_PI