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;
21class QPainter;
22
30{
31 Q_OBJECT
32
33public:
34 explicit KoPathToolSelection(KoPathTool *tool);
35
36 ~KoPathToolSelection() override;
37
39 void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, KoColorDisplayRendererInterface *renderInterface);
40
47 void add(KoPathPoint *point, bool clear);
48
54 void remove(KoPathPoint *point);
55
59 void clear();
60
67 void selectPoints(const QRectF &rect, bool clearSelection);
68
69 void selectAll();
70
76 int objectCount() const;
77
83 int size() const;
84
90 bool contains(KoPathPoint *point);
91
97 const QSet<KoPathPoint *> &selectedPoints() const;
98
104 QList<KoPathPointData> selectedPointsData() const;
105
111 QList<KoPathPointData> selectedSegmentsData() const;
112
114 QList<KoPathShape*> selectedShapes() const;
115
117 void setSelectedShapes(const QList<KoPathShape*> shapes);
118
128 void update();
129
131 bool hasSelection() override;
132
133
134 void recommendPointSelectionChange(KoPathShape *shape, const QList<KoPathPointIndex> &newSelection) override;
135 void notifyPathPointsChanged(KoPathShape *shape) override;
136 void notifyShapeChanged(KoShape::ChangeType type, KoShape *shape) override;
137
138Q_SIGNALS:
140
141private:
142 typedef QMap<KoPathShape *, QSet<KoPathPoint *> > PathShapePointMap;
143
144 QSet<KoPathPoint *> m_selectedPoints;
148};
149
150#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
virtual void update() const
Definition KoShape.cpp:529
ChangeType
Used by shapeChanged() to select which change was made.
Definition KoShape.h:92
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