Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPathToolSelection.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 * SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
5 * SPDX-FileCopyrightText: 2007 Boudewijn Rempt <boud@valdyas.org>
6 *
7 * SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9
10#ifndef KOPATHTOOLSELECTION_H
11#define KOPATHTOOLSELECTION_H
12
13#include <KoToolSelection.h>
14#include <KoPathShape.h>
15
16class KoPathTool;
17class KoPathPoint;
18class KoPathPointData;
19class KoViewConverter;
20class QPainter;
21
29{
30 Q_OBJECT
31
32public:
33 explicit KoPathToolSelection(KoPathTool *tool);
34
35 ~KoPathToolSelection() override;
36
38 void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius);
39
46 void add(KoPathPoint *point, bool clear);
47
53 void remove(KoPathPoint *point);
54
58 void clear();
59
66 void selectPoints(const QRectF &rect, bool clearSelection);
67
68 void selectAll();
69
75 int objectCount() const;
76
82 int size() const;
83
89 bool contains(KoPathPoint *point);
90
96 const QSet<KoPathPoint *> &selectedPoints() const;
97
103 QList<KoPathPointData> selectedPointsData() const;
104
110 QList<KoPathPointData> selectedSegmentsData() const;
111
113 QList<KoPathShape*> selectedShapes() const;
114
116 void setSelectedShapes(const QList<KoPathShape*> shapes);
117
127 void update();
128
130 bool hasSelection() override;
131
132
133 void recommendPointSelectionChange(KoPathShape *shape, const QList<KoPathPointIndex> &newSelection) override;
134 void notifyPathPointsChanged(KoPathShape *shape) override;
135 void notifyShapeChanged(KoShape::ChangeType type, KoShape *shape) override;
136
137Q_SIGNALS:
139
140private:
141 typedef QMap<KoPathShape *, QSet<KoPathPoint *> > PathShapePointMap;
142
143 QSet<KoPathPoint *> m_selectedPoints;
147};
148
149#endif // KOPATHTOOLSELECTION_H
Describe a KoPathPoint by a KoPathShape and its indices.
A KoPathPoint represents a point in a path.
The position of a path point within a path shape.
Definition KoPathShape.h:63
QSizeF size() const override
reimplemented
void paint(QPainter &painter) const override
reimplemented
void clear()
Removes all subpaths and their points from the path.
Handle the selection of points.
QList< KoPathShape * > m_selectedShapes
QMap< KoPathShape *, QSet< KoPathPoint * > > PathShapePointMap
QSet< KoPathPoint * > m_selectedPoints
PathShapePointMap m_shapePointMap
void update() const override
reimplemented
ChangeType
Used by shapeChanged() to select which change was made.
Definition KoShape.h:95
virtual bool hasSelection()
return true if the tool currently has something selected that can be copied or deleted.
virtual void recommendPointSelectionChange(KoPathShape *shape, const QList< KoPathPointIndex > &newSelection)=0
virtual void notifyPathPointsChanged(KoPathShape *shape)=0
void notifyShapeChanged(ChangeType type, KoShape *shape) override