11#include <klocalizedstring.h>
23 , m_deletePoints(true)
26 std::sort(sortedPointDataList.begin(), sortedPointDataList.end());
30 for (; it != sortedPointDataList.constEnd(); ++it) {
38 if(it->pointIndex.second == 0
87 pointIndex.second = pointIndex.second + offset + 1;
95 breakIndex.second += offset;
119 QMap<KoPathShape *, QList<KoPathPointIndex>> pointsMap;
129 pointIndex.second = pointIndex.second +
m_closedIndex.at(i).second;
137 if (lastPathShape != pathShape) {
141 lastPathShape = pathShape;
148 for (
auto it = pointsMap.constBegin(); it != pointsMap.constEnd(); ++it) {
149 it.key()->recommendPointSelectionChange(it.value());
QPair< int, int > KoPathPointIndex
void setText(const KUndo2MagicString &text)
QList< KoPathPointData > m_pointDataList
QList< KoPathPointIndex > m_closedIndex
void redo() override
redo the command
~KoPathBreakAtPointCommand() override
QList< KoPathPoint * > m_points
void undo() override
revert the actions done in redo
KoPathBreakAtPointCommand(const QList< KoPathPointData > &pointDataList, KUndo2Command *parent=0)
Describe a KoPathPoint by a KoPathShape and its indices.
KoPathPointIndex pointIndex
position of the point in the path shape
KoPathShape * pathShape
path shape the path point belongs too
A KoPathPoint represents a point in a path.
The position of a path point within a path shape.
bool breakAfter(const KoPathPointIndex &pointIndex)
Breaks the path after the point index.
int subpathPointCount(int subpathIndex) const
Returns the number of points in a subpath.
bool isClosedSubpath(int subpathIndex) const
Checks if a subpath is closed.
bool join(int subpathIndex)
Joins the given subpath with the following one.
KoPathPointIndex closeSubpath(const KoPathPointIndex &pointIndex)
Close a open subpath.
KoPathPointIndex openSubpath(const KoPathPointIndex &pointIndex)
Opens a closed subpath.
KoPathPoint * removePoint(const KoPathPointIndex &pointIndex)
Removes a point from the path.
KoPathPoint * pointByIndex(const KoPathPointIndex &pointIndex) const
Returns the path point specified by a path point index.
bool insertPoint(KoPathPoint *point, const KoPathPointIndex &pointIndex)
Inserts a new point into the given subpath at the specified position.
void update() const override
reimplemented
KUndo2MagicString kundo2_i18n(const char *text)