Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qquadpath_p.h>
Classes | |
class | Element |
Public Types | |
enum | PathHint : quint8 { PathLinear = 0x1 , PathQuadratic = 0x2 , PathConvex = 0x4 , PathFillOnRight = 0x8 , PathSolid = 0x10 , PathNonIntersecting = 0x20 , PathNonOverlappingControlPointTriangles = 0x40 } |
Public Member Functions | |
void | moveTo (const QVector2D &to) |
void | lineTo (const QVector2D &to) |
void | quadTo (const QVector2D &control, const QVector2D &to) |
Element & | elementAt (int i) |
const Element & | elementAt (int i) const |
int | indexOfChildAt (int i, int childNumber) const |
QRectF | controlPointRect () const |
Qt::FillRule | fillRule () const |
void | setFillRule (Qt::FillRule rule) |
void | reserve (int size) |
int | elementCount () const |
bool | isEmpty () const |
int | elementCountRecursive () const |
QPainterPath | toPainterPath () const |
QString | asSvgString () const |
QQuadPath | subPathsClosed (bool *didClose=nullptr) const |
void | addCurvatureData () |
QQuadPath | flattened () const |
QQuadPath | dashed (qreal lineWidth, const QList< qreal > &dashPattern, qreal dashOffset=0) const |
void | splitElementAt (int index) |
bool | contains (const QVector2D &point) const |
bool | contains (const QVector2D &point, int fromIndex, int toIndex) const |
Element::FillSide | fillSideOf (int elementIdx, float elementT) const |
template<typename Func > | |
void | iterateChildrenOf (Element &e, Func &&lambda) |
template<typename Func > | |
void | iterateChildrenOf (const Element &e, Func &&lambda) const |
template<typename Func > | |
void | iterateElements (Func &&lambda) |
template<typename Func > | |
void | iterateElements (Func &&lambda) const |
bool | testHint (PathHint hint) const |
void | setHint (PathHint hint, bool on=true) |
PathHints | pathHints () const |
void | setPathHints (PathHints newHints) |
Static Public Member Functions | |
static QQuadPath | fromPainterPath (const QPainterPath &path, PathHints hints={}) |
static QVector2D | closestPointOnLine (const QVector2D &p, const QVector2D &sp, const QVector2D &ep) |
static bool | isPointOnLeft (const QVector2D &p, const QVector2D &sp, const QVector2D &ep) |
static bool | isPointOnLine (const QVector2D &p, const QVector2D &sp, const QVector2D &ep) |
static bool | isPointNearLine (const QVector2D &p, const QVector2D &sp, const QVector2D &ep) |
Friends | |
class | QSGCurveProcessor |
Q_QUICK_EXPORT QDebug | operator<< (QDebug, const QQuadPath &) |
Definition at line 27 of file qquadpath_p.h.
enum QQuadPath::PathHint : quint8 |
Enumerator | |
---|---|
PathLinear | |
PathQuadratic | |
PathConvex | |
PathFillOnRight | |
PathSolid | |
PathNonIntersecting | |
PathNonOverlappingControlPointTriangles |
Definition at line 31 of file qquadpath_p.h.
void QQuadPath::addCurvatureData | ( | ) |
Definition at line 543 of file qquadpath.cpp.
References PathFillOnRight, Q_ASSERT, qDebug, qEnvironmentVariableIntValue(), and testHint().
Referenced by QQuickGenerator::optimizePaths().
QString QQuadPath::asSvgString | ( | ) | const |
Definition at line 632 of file qquadpath.cpp.
References str.
|
static |
Definition at line 313 of file qquadpath.cpp.
References QVector2D::dotProduct(), line, qBound(), and sp.
bool QQuadPath::contains | ( | const QVector2D & | point | ) | const |
Definition at line 321 of file qquadpath.cpp.
Referenced by operator<<().
bool QQuadPath::contains | ( | const QVector2D & | point, |
int | fromIndex, | ||
int | toIndex ) const |
Definition at line 326 of file qquadpath.cpp.
References QList< T >::at(), QQuadPath::Element::controlPoint(), dir, QQuadPath::Element::endPoint(), fillRule(), i, QQuadPath::Element::pointAtFraction(), qMax(), qMin(), qSwap(), QQuadPath::Element::startPoint(), QQuadPath::Element::tangentAtFraction(), toIndex(), Qt::WindingFill, QVector2D::x(), and QVector2D::y().
QRectF QQuadPath::controlPointRect | ( | ) | const |
Definition at line 589 of file qquadpath.cpp.
References QList< T >::constFirst(), elementCount(), QVector2D::setX(), QVector2D::setY(), QVector2D::toPointF(), QVector2D::x(), QWidget::x, QVector2D::y(), and QWidget::y.
QQuadPath QQuadPath::dashed | ( | qreal | lineWidth, |
const QList< qreal > & | dashPattern, | ||
qreal | dashOffset = 0 ) const |
Definition at line 822 of file qquadpath.cpp.
References elementAt(), elementCount(), fillRule(), i, QQuadPath::Element::isLine(), QQuadPath::Element::isSubpathStart(), pathHints(), qMax(), and QQuadPath::Element::startPoint().
|
inline |
Definition at line 204 of file qquadpath_p.h.
References i.
Referenced by dashed(), QSGCurveProcessor::processFill(), and splitElementAt().
|
inline |
Definition at line 209 of file qquadpath_p.h.
References i.
|
inline |
Definition at line 225 of file qquadpath_p.h.
Referenced by controlPointRect(), dashed(), fillSideOf(), operator<<(), subPathsClosed(), and toPainterPath().
int QQuadPath::elementCountRecursive | ( | ) | const |
Definition at line 608 of file qquadpath.cpp.
References iterateElements().
Referenced by flattened().
|
inline |
Definition at line 221 of file qquadpath_p.h.
References Qt::OddEvenFill, and Qt::WindingFill.
Referenced by contains(), dashed(), fillSideOf(), flattened(), and toPainterPath().
QQuadPath::Element::FillSide QQuadPath::fillSideOf | ( | int | elementIdx, |
float | elementT ) const |
Definition at line 377 of file qquadpath.cpp.
References QList< T >::at(), QQuadPath::Element::controlPoint(), dir, elementCount(), QQuadPath::Element::endPoint(), fillRule(), i, j, QQuadPath::Element::pointAtFraction(), qAbs(), qMax(), qMin(), qSwap(), QQuadPath::Element::startPoint(), QQuadPath::Element::tangentAtFraction(), Qt::WindingFill, QVector2D::x(), and QVector2D::y().
QQuadPath QQuadPath::flattened | ( | ) | const |
Definition at line 700 of file qquadpath.cpp.
References elementCountRecursive(), fillRule(), iterateElements(), pathHints(), and reserve().
|
static |
Definition at line 492 of file qquadpath.cpp.
References QPainterPath::CurveToElement, QBezier::fromPoints(), i, QPainterPath::LineToElement, QPainterPath::MoveToElement, PathQuadratic, qt_toQuadratics(), reserve(), sp, and QPainterPath::Element::type.
Referenced by QQuickGenerator::optimizePaths(), and QSGCurveGlyphAtlas::populate().
|
inline |
Definition at line 214 of file qquadpath_p.h.
References i.
|
inline |
Definition at line 226 of file qquadpath_p.h.
|
static |
Definition at line 301 of file qquadpath.cpp.
References QVector2D::dotProduct(), epsilon, and sp.
|
static |
Definition at line 289 of file qquadpath.cpp.
References crossProduct(), and sp.
Referenced by QSGCurveProcessor::processFill().
|
static |
Definition at line 295 of file qquadpath.cpp.
References crossProduct(), qFuzzyIsNull(), and sp.
|
inline |
Definition at line 256 of file qquadpath_p.h.
References QQuadPath::Element::childCount(), and i.
Definition at line 243 of file qquadpath_p.h.
References QQuadPath::Element::childCount(), and i.
|
inline |
Definition at line 269 of file qquadpath_p.h.
References QQuadPath::Element::childCount(), and i.
Referenced by elementCountRecursive(), flattened(), and QSGCurveProcessor::processFill().
|
inline |
Definition at line 281 of file qquadpath_p.h.
References QQuadPath::Element::childCount(), and i.
Definition at line 194 of file qquadpath_p.h.
Definition at line 188 of file qquadpath_p.h.
|
inline |
Definition at line 307 of file qquadpath_p.h.
Referenced by dashed(), and flattened().
Definition at line 199 of file qquadpath_p.h.
|
inline |
Definition at line 224 of file qquadpath_p.h.
Referenced by flattened(), and fromPainterPath().
|
inline |
Definition at line 222 of file qquadpath_p.h.
References rule, and Qt::WindingFill.
Definition at line 302 of file qquadpath_p.h.
References hint().
|
inline |
Definition at line 312 of file qquadpath_p.h.
Referenced by QSGCurveProcessor::removeNestedSubpaths().
void QQuadPath::splitElementAt | ( | int | index | ) |
Definition at line 879 of file qquadpath.cpp.
References elementAt(), QQuadPath::Element::midPoint(), qCDebug, qFuzzyCompare(), QList< T >::resize(), and QList< T >::size().
Definition at line 652 of file qquadpath.cpp.
References QList< T >::append(), QList< T >::at(), elementCount(), i, QList< T >::isEmpty(), QList< T >::last(), Q_ASSERT, and sp.
Referenced by QQuickGenerator::optimizePaths().
|
inline |
Definition at line 297 of file qquadpath_p.h.
References hint().
Referenced by addCurvatureData().
QPainterPath QQuadPath::toPainterPath | ( | ) | const |
Definition at line 615 of file qquadpath.cpp.
References elementCount(), fillRule(), and QPainterPath::reserve().
Definition at line 933 of file qquadpath.cpp.
|
friend |
Definition at line 331 of file qquadpath_p.h.