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>.
Loading...
Searching...
No Matches
qpainterpath.cpp File Reference

(2925683268ca9d8dc6811f8f64c50ca488b27acc)

#include "qpainterpath.h"
#include "qpainterpath_p.h"
#include <qbitmap.h>
#include <qdebug.h>
#include <qiodevice.h>
#include <qlist.h>
#include <qpen.h>
#include <qpolygon.h>
#include <qtextlayout.h>
#include <qvarlengtharray.h>
#include <qmath.h>
#include <private/qbezier_p.h>
#include <private/qfontengine_p.h>
#include <private/qnumeric_p.h>
#include <private/qobject_p.h>
#include <private/qpathclipper_p.h>
#include <private/qstroker_p.h>
#include <private/qtextengine_p.h>
#include <limits.h>
+ Include dependency graph for qpainterpath.cpp:

Go to the source code of this file.

Macros

#define PM_INIT
 
#define PM_MEASURE(x)
 
#define PM_DISPLAY
 
#define QT_BEZIER_A(bezier, coord)
 
#define QT_BEZIER_B(bezier, coord)
 
#define QT_BEZIER_C(bezier, coord)
 
#define QT_BEZIER_CHECK_T(bezier, t)
 

Enumerations

enum  PainterDirections { Left , Right , Top , Bottom }
 

Functions

static QT_BEGIN_NAMESPACE bool isValidCoord (qreal c)
 
static bool hasValidCoords (QPointF p)
 
static bool hasValidCoords (QRectF r)
 
QPainterPath qt_stroke_dash (const QPainterPath &path, qreal *dashes, int dashCount)
 
void qt_find_ellipse_coords (const QRectF &r, qreal angle, qreal length, QPointF *startPoint, QPointF *endPoint)
 
static QRectF qt_painterpath_bezier_extrema (const QBezier &b)
 
static void qt_painterpath_isect_line (const QPointF &p1, const QPointF &p2, const QPointF &pos, int *winding)
 
static void qt_painterpath_isect_curve (const QBezier &bezier, const QPointF &pt, int *winding, int depth=0)
 
static bool qt_painterpath_isect_line_rect (qreal x1, qreal y1, qreal x2, qreal y2, const QRectF &rect)
 
static bool qt_isect_curve_horizontal (const QBezier &bezier, qreal y, qreal x1, qreal x2, int depth=0)
 
static bool qt_isect_curve_vertical (const QBezier &bezier, qreal x, qreal y1, qreal y2, int depth=0)
 
static bool pointOnEdge (const QRectF &rect, const QPointF &point)
 
static bool qt_painterpath_check_crossing (const QPainterPath *path, const QRectF &rect)
 
static bool epsilonCompare (const QPointF &a, const QPointF &b, const QSizeF &epsilon)
 
QDataStreamoperator<< (QDataStream &s, const QPainterPath &p)
 
QDataStreamoperator>> (QDataStream &s, QPainterPath &p)
 
void qt_path_stroke_move_to (qfixed x, qfixed y, void *data)
 
void qt_path_stroke_line_to (qfixed x, qfixed y, void *data)
 
void qt_path_stroke_cubic_to (qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data)
 
static qreal slopeAt (qreal t, qreal a, qreal b, qreal c, qreal d)
 
static QBezier bezierAtT (const QPainterPath &path, qreal t, qreal *startingLength, qreal *bezierLength)
 
QDebug operator<< (QDebug s, const QPainterPath &p)
 

Macro Definition Documentation

◆ PM_DISPLAY

#define PM_DISPLAY

Definition at line 32 of file qpainterpath.cpp.

◆ PM_INIT

#define PM_INIT

Definition at line 30 of file qpainterpath.cpp.

◆ PM_MEASURE

#define PM_MEASURE ( x)

Definition at line 31 of file qpainterpath.cpp.

◆ QT_BEZIER_A

#define QT_BEZIER_A ( bezier,
coord )
Value:
3 * (-bezier.coord##1 \
+ 3*bezier.coord##2 \
- 3*bezier.coord##3 \
+bezier.coord##4)

Definition at line 1339 of file qpainterpath.cpp.

Referenced by qt_painterpath_bezier_extrema().

◆ QT_BEZIER_B

#define QT_BEZIER_B ( bezier,
coord )
Value:
6 * (bezier.coord##1 \
- 2*bezier.coord##2 \
+ bezier.coord##3)

Definition at line 1344 of file qpainterpath.cpp.

Referenced by qt_painterpath_bezier_extrema().

◆ QT_BEZIER_C

#define QT_BEZIER_C ( bezier,
coord )
Value:
3 * (- bezier.coord##1 \
+ bezier.coord##2)

Definition at line 1348 of file qpainterpath.cpp.

Referenced by qt_painterpath_bezier_extrema().

◆ QT_BEZIER_CHECK_T

#define QT_BEZIER_CHECK_T ( bezier,
t )
Value:
if (t >= 0 && t <= 1) { \
QPointF p(b.pointAt(t)); \
if (p.x() < minx) minx = p.x(); \
else if (p.x() > maxx) maxx = p.x(); \
if (p.y() < miny) miny = p.y(); \
else if (p.y() > maxy) maxy = p.y(); \
}
\inmodule QtCore\reentrant
Definition qpoint.h:217
GLboolean GLboolean GLboolean b
GLdouble GLdouble t
Definition qopenglext.h:243
GLfloat GLfloat p
[1]

Definition at line 1351 of file qpainterpath.cpp.

Referenced by qt_painterpath_bezier_extrema().

Enumeration Type Documentation

◆ PainterDirections

Enumerator
Left 
Right 
Top 
Bottom 

Definition at line 1847 of file qpainterpath.cpp.

Function Documentation

◆ bezierAtT()

static QBezier bezierAtT ( const QPainterPath & path,
qreal t,
qreal * startingLength,
qreal * bezierLength )
inlinestatic

Definition at line 2933 of file qpainterpath.cpp.

References QPainterPath::CurveToElement, QBezier::fromPoints(), i, QString::length(), line, QPainterPath::LineToElement, QPainterPath::MoveToElement, and QPainterPath::Element::type.

Referenced by QPainterPath::angleAtPercent(), QPainterPath::pointAtPercent(), and QPainterPath::slopeAtPercent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ epsilonCompare()

static bool epsilonCompare ( const QPointF & a,
const QPointF & b,
const QSizeF & epsilon )
inlinestatic

Definition at line 2242 of file qpainterpath.cpp.

References epsilon, and qAbs().

Referenced by QPainterPath::operator==().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasValidCoords() [1/2]

static bool hasValidCoords ( QPointF p)
static

Definition at line 45 of file qpainterpath.cpp.

References isValidCoord().

Referenced by QPainterPath::addEllipse(), QPainterPath::addRect(), QPainterPath::arcTo(), QPainterPath::cubicTo(), QPainterPath::lineTo(), QPainterPath::moveTo(), and QPainterPath::quadTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasValidCoords() [2/2]

static bool hasValidCoords ( QRectF r)
static

Definition at line 50 of file qpainterpath.cpp.

References isValidCoord().

+ Here is the call graph for this function:

◆ isValidCoord()

static QT_BEGIN_NAMESPACE bool isValidCoord ( qreal c)
inlinestatic

Definition at line 37 of file qpainterpath.cpp.

References qIsFinite().

Referenced by QPainterPath::arcTo(), hasValidCoords(), and hasValidCoords().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<() [1/2]

QDataStream & operator<< ( QDataStream & s,
const QPainterPath & p )
related

Definition at line 2412 of file qpainterpath.cpp.

◆ operator<<() [2/2]

QDebug operator<< ( QDebug s,
const QPainterPath & p )

Definition at line 3365 of file qpainterpath.cpp.

References Qt::endl(), and i.

+ Here is the call graph for this function:

◆ operator>>()

QDataStream & operator>> ( QDataStream & s,
QPainterPath & p )
related

Definition at line 2439 of file qpainterpath.cpp.

◆ pointOnEdge()

static bool pointOnEdge ( const QRectF & rect,
const QPointF & point )
static

Definition at line 1964 of file qpainterpath.cpp.

References rect, QPointF::x(), and QPointF::y().

Referenced by qt_painterpath_check_crossing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_find_ellipse_coords()

void qt_find_ellipse_coords ( const QRectF & r,
qreal angle,
qreal length,
QPointF * startPoint,
QPointF * endPoint )

Definition at line 65 of file qpainterpath.cpp.

References QBezier::coefficients(), d, i, qFloor(), QT_PATH_KAPPA, and qt_t_for_arc_angle().

Referenced by QPainterPath::arcMoveTo(), and qt_curves_for_arc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_isect_curve_horizontal()

static bool qt_isect_curve_horizontal ( const QBezier & bezier,
qreal y,
qreal x1,
qreal x2,
int depth = 0 )
static

Definition at line 1928 of file qpainterpath.cpp.

References QRectF::bottom(), QBezier::bounds(), QRectF::height(), QRectF::left(), qt_isect_curve_horizontal(), QRectF::right(), QBezier::split(), QRectF::top(), and QRectF::width().

Referenced by qt_isect_curve_horizontal(), and qt_painterpath_check_crossing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_isect_curve_vertical()

static bool qt_isect_curve_vertical ( const QBezier & bezier,
qreal x,
qreal y1,
qreal y2,
int depth = 0 )
static

Definition at line 1946 of file qpainterpath.cpp.

References QRectF::bottom(), QBezier::bounds(), QRectF::height(), QRectF::left(), qt_isect_curve_vertical(), QRectF::right(), QBezier::split(), QRectF::top(), and QRectF::width().

Referenced by qt_isect_curve_vertical(), and qt_painterpath_check_crossing().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_painterpath_bezier_extrema()

static QRectF qt_painterpath_bezier_extrema ( const QBezier & b)
static

Definition at line 1361 of file qpainterpath.cpp.

References qFuzzyIsNull(), qSqrt(), QT_BEZIER_A, QT_BEZIER_B, QT_BEZIER_C, QT_BEZIER_CHECK_T, and t2.

+ Here is the call graph for this function:

◆ qt_painterpath_check_crossing()

static bool qt_painterpath_check_crossing ( const QPainterPath * path,
const QRectF & rect )
static

Definition at line 1978 of file qpainterpath.cpp.

References QPainterPath::CurveToElement, QBezier::fromPoints(), i, QPainterPath::LineToElement, QPainterPath::MoveToElement, pointOnEdge(), qFuzzyCompare(), qt_isect_curve_horizontal(), qt_isect_curve_vertical(), qt_painterpath_isect_line_rect(), rect, QPainterPath::Element::type, QPainterPath::Element::x, and QPainterPath::Element::y.

Referenced by QPainterPath::contains(), and QPainterPath::intersects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_painterpath_isect_curve()

static void qt_painterpath_isect_curve ( const QBezier & bezier,
const QPointF & pt,
int * winding,
int depth = 0 )
static

Definition at line 1754 of file qpainterpath.cpp.

References QBezier::bounds(), QRectF::height(), QBezier::pt1(), QBezier::pt4(), qt_painterpath_isect_curve(), QBezier::split(), QRectF::width(), QPointF::x(), QPointF::y(), and QRectF::y().

Referenced by QPainterPath::contains(), and qt_painterpath_isect_curve().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_painterpath_isect_line()

static void qt_painterpath_isect_line ( const QPointF & p1,
const QPointF & p2,
const QPointF & pos,
int * winding )
static

Definition at line 1722 of file qpainterpath.cpp.

References dir, p1, p2, pos, and qFuzzyCompare().

Referenced by QPainterPath::contains().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_painterpath_isect_line_rect()

static bool qt_painterpath_isect_line_rect ( qreal x1,
qreal y1,
qreal x2,
qreal y2,
const QRectF & rect )
static

Definition at line 1849 of file qpainterpath.cpp.

References Bottom, Left, p1, p2, rect, Right, and Top.

Referenced by qt_painterpath_check_crossing().

+ Here is the caller graph for this function:

◆ qt_path_stroke_cubic_to()

void qt_path_stroke_cubic_to ( qfixed c1x,
qfixed c1y,
qfixed c2x,
qfixed c2y,
qfixed ex,
qfixed ey,
void * data )

Definition at line 2496 of file qpainterpath.cpp.

References qt_fixed_to_real.

Referenced by QPainterPathStrokerPrivate::QPainterPathStrokerPrivate().

+ Here is the caller graph for this function:

◆ qt_path_stroke_line_to()

void qt_path_stroke_line_to ( qfixed x,
qfixed y,
void * data )

Definition at line 2491 of file qpainterpath.cpp.

References qt_fixed_to_real.

Referenced by QPainterPathStrokerPrivate::QPainterPathStrokerPrivate().

+ Here is the caller graph for this function:

◆ qt_path_stroke_move_to()

void qt_path_stroke_move_to ( qfixed x,
qfixed y,
void * data )

Definition at line 2486 of file qpainterpath.cpp.

References qt_fixed_to_real.

Referenced by QPainterPathStrokerPrivate::QPainterPathStrokerPrivate().

+ Here is the caller graph for this function:

◆ qt_stroke_dash()

QPainterPath qt_stroke_dash ( const QPainterPath & path,
qreal * dashes,
int dashCount )

◆ slopeAt()

static qreal slopeAt ( qreal t,
qreal a,
qreal b,
qreal c,
qreal d )
inlinestatic

Definition at line 2828 of file qpainterpath.cpp.

References d.

Referenced by QPainterPath::angleAtPercent(), and QPainterPath::slopeAtPercent().

+ Here is the caller graph for this function: