12 class QPainterPathData;
34 bool isMoveTo()
const {
return type == MoveToElement; }
35 bool isLineTo()
const {
return type == LineToElement; }
36 bool isCurveTo()
const {
return type == CurveToElement; }
40 bool operator==(
const Element &e)
const {
41 return Math::FuzzyCompare(x, e.x)
42 && Math::FuzzyCompare(y, e.y) && type == e.type;
44 inline bool operator!=(
const Element &e)
const {
return !operator==(e); }
57 inline void moveTo(
float x,
float y);
60 inline void lineTo(
float x,
float y);
62 void arcMoveTo(
const QRectF &rect,
float angle);
63 inline void arcMoveTo(
float x,
float y,
float w,
float h,
float angle);
65 void arcTo(
const QRectF &rect,
float startAngle,
float arcLength);
66 inline void arcTo(
float x,
float y,
float w,
float h,
float startAngle,
float arcLength);
69 inline void cubicTo(
float ctrlPt1x,
float ctrlPt1y,
float ctrlPt2x,
float ctrlPt2y,
70 float endPtx,
float endPty);
72 inline void quadTo(
float ctrlPtx,
float ctrlPty,
float endPtx,
float endPty);
74 QPointF currentPosition()
const;
76 void addRect(
const QRectF &rect);
77 inline void addRect(
float x,
float y,
float w,
float h);
78 void addEllipse(
const QRectF &rect);
79 inline void addEllipse(
float x,
float y,
float w,
float h);
80 inline void addEllipse(
const QPointF ¢er,
float rx,
float ry);
81 void addPolygon(
const QPolygonF &polygon);
82 void addText(
const QPointF &point,
const QFont &f,
const std::string &text);
83 inline void addText(
float x,
float y,
const QFont &f,
const std::string &text);
85 void addRegion(
const QRegion ®ion);
87 void addRoundedRect(
const QRectF &rect,
float xRadius,
float yRadius,
88 SizeMode mode = AbsoluteSize);
89 inline void addRoundedRect(
float x,
float y,
float w,
float h,
90 float xRadius,
float yRadius,
91 SizeMode mode = AbsoluteSize);
93 void addRoundRect(
const QRectF &rect,
int xRnd,
int yRnd);
94 inline void addRoundRect(
float x,
float y,
float w,
float h,
96 inline void addRoundRect(
const QRectF &rect,
int roundness);
97 inline void addRoundRect(
float x,
float y,
float w,
float h,
102 bool contains(
const QPointF &pt)
const;
103 bool contains(
const QRectF &rect)
const;
104 bool intersects(
const QRectF &rect)
const;
106 void translate(
float dx,
float dy);
107 inline void translate(
const QPointF &offset);
112 QRectF boundingRect()
const;
113 QRectF controlPointRect()
const;
115 FillRule fillRule()
const;
116 void setFillRule(FillRule fillRule);
118 bool isEmpty()
const;
121 std::list<QPolygonF> toSubpathPolygons(
const QMatrix &matrix =
QMatrix())
const;
122 std::list<QPolygonF> toFillPolygons(
const QMatrix &matrix =
QMatrix())
const;
124 std::list<QPolygonF> toSubpathPolygons(
const QTransform &matrix)
const;
125 std::list<QPolygonF> toFillPolygons(
const QTransform &matrix)
const;
128 int elementCount()
const;
130 void setElementPositionAt(
int i,
float x,
float y);
132 float length()
const;
133 float percentAtLength(
float t)
const;
134 QPointF pointAtPercent(
float t)
const;
135 float angleAtPercent(
float t)
const;
136 float slopeAtPercent(
float t)
const;
162 void computeBoundingRect()
const;
163 void computeControlPointRect()
const;
176 void setWidth(
float width);
182 inline void QPainterPath::moveTo(
float x,
float y)
187 inline void QPainterPath::lineTo(
float x,
float y)
192 inline void QPainterPath::arcTo(
float x,
float y,
float w,
float h,
float startAngle,
float arcLength)
194 arcTo(
QRectF(x, y, w, h), startAngle, arcLength);
197 inline void QPainterPath::arcMoveTo(
float x,
float y,
float w,
float h,
float angle)
199 arcMoveTo(
QRectF(x, y, w, h), angle);
202 inline void QPainterPath::cubicTo(
float ctrlPt1x,
float ctrlPt1y,
float ctrlPt2x,
float ctrlPt2y,
203 float endPtx,
float endPty)
209 inline void QPainterPath::quadTo(
float ctrlPtx,
float ctrlPty,
float endPtx,
float endPty)
214 inline void QPainterPath::addEllipse(
float x,
float y,
float w,
float h)
216 addEllipse(
QRectF(x, y, w, h));
219 inline void QPainterPath::addEllipse(
const QPointF ¢er,
float rx,
float ry)
221 addEllipse(
QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
224 inline void QPainterPath::addRect(
float x,
float y,
float w,
float h)
226 addRect(
QRectF(x, y, w, h));
229 inline void QPainterPath::addRoundedRect(
float x,
float y,
float w,
float h,
230 float xRadius,
float yRadius,
233 addRoundedRect(
QRectF(x, y, w, h), xRadius, yRadius, mode);
236 inline void QPainterPath::addRoundRect(
float x,
float y,
float w,
float h,
239 addRoundRect(
QRectF(x, y, w, h), xRnd, yRnd);
242 inline void QPainterPath::addRoundRect(
const QRectF &rect,
245 int xRnd = roundness;
246 int yRnd = roundness;
247 if (rect.width() > rect.height())
248 xRnd =
int(roundness * rect.height() / rect.width());
250 yRnd = int(roundness * rect.width() / rect.height());
251 addRoundRect(rect, xRnd, yRnd);
254 inline void QPainterPath::addRoundRect(
float x,
float y,
float w,
float h,
257 addRoundRect(
QRectF(x, y, w, h), roundness);
260 inline void QPainterPath::addText(
float x,
float y,
const QFont &f,
const std::string &text)
262 addText(
QPointF(x, y), f, text);
265 inline void QPainterPath::translate(
const QPointF &offset)
267 translate(offset.x(), offset.y());
272 return translated(offset.x(), offset.y());
The QPen class defines how a CPainter should draw lines and outlines of shapes.
Definition: qpen.h:13
Definition: ParaPoint.h:203
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ParaRect.h:517
Definition: qpainterpath.h:28
Definition: qpainterpath.h:169
Definition: qvectorpath.h:17
Definition: qpolygon.h:87
Definition: ParaRegion.h:7
Definition: qpainterpath.h:18