13#include "kritaflake_export.h"
20#define KoPathShapeId "KoPathShape"
24class KoPathShapePrivate;
78 void paint(QPainter &painter)
const override;
84 QPainterPath
outline()
const override;
88 QSizeF
size()
const override;
90 QPainterPath pathStroke(
const QPen &pen)
const;
102 void setSize(
const QSizeF &size)
override;
105 bool hitTest(
const QPointF &position)
const override;
139 KoPathPoint *curveTo(
const QPointF &c1,
const QPointF &c2,
const QPointF &
p);
152 KoPathPoint *curveTo(
const QPointF &c,
const QPointF &
p);
167 KoPathPoint *arcTo(qreal rx, qreal ry, qreal startAngle, qreal sweepAngle);
195 virtual QPointF normalize();
249 int pointCount()
const;
256 int subpathCount()
const;
263 int subpathPointCount(
int subpathIndex)
const;
272 bool isClosedSubpath(
int subpathIndex)
const;
330 bool join(
int subpathIndex);
340 bool moveSubpath(
int oldSubpathIndex,
int newSubpathIndex);
372 bool reverseSubpath(
int subpathIndex);
379 KoSubpath *removeSubpath(
int subpathIndex);
387 bool addSubpath(
KoSubpath *subpath,
int subpathIndex);
416 virtual QString pathShapeId()
const;
419 QString toString(
const QTransform &matrix = QTransform())
const;
442 QString nodeTypes()
const;
447 void loadNodeTypes(
const QString &nodeTypes);
450 Qt::FillRule fillRule()
const;
453 void setFillRule(Qt::FillRule fillRule);
456 static KoPathShape *createShapeFromPainterPath(
const QPainterPath &path);
460 bool hasMarkers()
const;
462 bool autoFillMarkers()
const;
463 void setAutoFillMarkers(
bool value);
475 void notifyPointsChanged();
499 int arcToCurve(qreal rx, qreal ry, qreal startAngle, qreal sweepAngle,
const QPointF &offset, QPointF *curvePoints)
const;
507 QTransform resizeMatrix(
const QSizeF &newSize )
const;
511 void closeMergeSubpathPriv(
KoSubpath *subpath);
513 void closeSubpathPriv(
KoSubpath *subpath);
520 void map(
const QTransform &matrix);
524 QScopedPointer<Private>
d;
float value(const T *src, size_t ch)
QList< KoPathPoint * > KoSubpath
a KoSubpath contains a path from a moveTo until a close or a new moveTo
QList< KoSubpath * > KoSubpathList
QPair< int, int > KoPathPointIndex
The KisHandlePainterHelper class is a special helper for painting handles around objects....
A KoPathPoint represents a point in a path.
A KoPathSegment consist of two neighboring KoPathPoints.
The position of a path point within a path shape.
QScopedPointer< Private > d
void paint(QPainter &painter) const override
reimplemented
virtual QSizeF size() const
Get the size of the shape in pt.
virtual QRectF outlineRect() const
virtual QPainterPath outline() const
virtual QRectF boundingRect() const
Get the bounding box of the shape.
ChangeType
Used by shapeChanged() to select which change was made.
virtual KoShape * cloneShape() const
creates a deep copy of the shape or shape's subtree
virtual bool hitTest(const QPointF &position) const
Check if the shape is hit on position.
virtual void setSize(const QSizeF &size)
Resize the shape.
Q_DECLARE_METATYPE(KisPaintopLodLimitations)
virtual void recommendPointSelectionChange(KoPathShape *shape, const QList< KoPathPointIndex > &newSelection)=0
virtual void notifyPathPointsChanged(KoPathShape *shape)=0