Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPathPointTypeCommand.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2006, 2008 Jan Hambrecht <jaham@gmx.net>
3 * SPDX-FileCopyrightText: 2006, 2007 Thorsten Zachmann <zachmann@kde.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef KOPATHPOINTTYPECOMMAND_H
9#define KOPATHPOINTTYPECOMMAND_H
10
11#include <kundo2command.h>
12#include <QList>
13#include "KoPathBaseCommand.h"
14#include "KoPathPoint.h"
15#include "KoPathPointData.h"
16#include "kritaflake_export.h"
17
19class KRITAFLAKE_EXPORT KoPathPointTypeCommand : public KoPathBaseCommand
20{
21public:
36 KoPathPointTypeCommand(const QList<KoPathPointData> &pointDataList, PointType pointType, KUndo2Command *parent = 0);
37 ~KoPathPointTypeCommand() override;
38
40 void redo() override;
42 void undo() override;
43
44 static void makeCubicPointSmooth(KoPathPoint *point);
45
46private:
47 // used for storing the data for undo
48 struct PointData {
49 PointData(const KoPathPointData pointData)
50 : m_pointData(pointData) {}
52 // old control points in document coordinates
55 KoPathPoint::PointProperties m_oldProperties;
56 bool m_hadControlPoint1 {false};
57 bool m_hadControlPoint2 {false};
58 };
59
60 bool appendPointData(KoPathPointData data);
61 void undoChanges(const QList<PointData> &data);
62
66};
67
68#endif // KOPATHPOINTTYPECOMMAND_H
virtual void undo()
virtual void redo()
the base command for commands altering a path shape
Describe a KoPathPoint by a KoPathShape and its indices.
The undo / redo command for changing the path point type.
QList< PointData > m_additionalPointData
PointType
The type of the point.
QList< PointData > m_oldPointData
A KoPathPoint represents a point in a path.
KoPathPoint::PointProperties m_oldProperties
PointData(const KoPathPointData pointData)