|
Krita Source Code Documentation
|
Handle the selection of points. More...
#include <KoPathToolSelection.h>
Inheritance diagram for KoPathToolSelection:Signals | |
| void | selectionChanged () |
Public Member Functions | |
| void | add (KoPathPoint *point, bool clear) |
| Add a point to the selection. | |
| void | clear () |
| Clear the selection. | |
| bool | contains (KoPathPoint *point) |
| Check if a point is in the selection. | |
| bool | hasSelection () override |
| reimplemented from KoToolSelection | |
| KoPathToolSelection (KoPathTool *tool) | |
| void | notifyPathPointsChanged (KoPathShape *shape) override |
| void | notifyShapeChanged (KoShape::ChangeType type, KoShape *shape) override |
| int | objectCount () const |
| Get the number of path objects in the selection. | |
| void | paint (QPainter &painter, const KoViewConverter &converter, qreal handleRadius, KoColorDisplayRendererInterface *renderInterface) |
| Draw the selected points. | |
| void | recommendPointSelectionChange (KoPathShape *shape, const QList< KoPathPointIndex > &newSelection) override |
| void | remove (KoPathPoint *point) |
| Remove a point form the selection. | |
| void | selectAll () |
| const QSet< KoPathPoint * > & | selectedPoints () const |
| Get all selected points. | |
| QList< KoPathPointData > | selectedPointsData () const |
| Get the point data of all selected points. | |
| QList< KoPathPointData > | selectedSegmentsData () const |
| Get the point data of all selected segments. | |
| QList< KoPathShape * > | selectedShapes () const |
| Returns list of selected shapes. | |
| void | selectPoints (const QRectF &rect, bool clearSelection) |
| Select points in rect. | |
| void | setSelectedShapes (const QList< KoPathShape * > shapes) |
| Sets list of selected shapes. | |
| int | size () const |
| Get the number of path points in the selection. | |
| void | update () |
| Update the selection to contain only valid points. | |
| ~KoPathToolSelection () override | |
Public Member Functions inherited from KoToolSelection | |
| KoToolSelection (QObject *parent=0) | |
| ~KoToolSelection () override | |
Public Member Functions inherited from KoPathShape::PointSelectionChangeListener | |
| void | notifyShapeChanged (ChangeType type, KoShape *shape) override |
Public Member Functions inherited from KoShape::ShapeChangeListener | |
| virtual | ~ShapeChangeListener () |
Private Types | |
| typedef QMap< KoPathShape *, QSet< KoPathPoint * > > | PathShapePointMap |
Private Attributes | |
| QSet< KoPathPoint * > | m_selectedPoints |
| QList< KoPathShape * > | m_selectedShapes |
| PathShapePointMap | m_shapePointMap |
| KoPathTool * | m_tool |
Handle the selection of points.
This class handles the selection of points. It makes sure the canvas is repainted when the selection changes.
Definition at line 29 of file KoPathToolSelection.h.
|
private |
Definition at line 142 of file KoPathToolSelection.h.
|
explicit |
Definition at line 23 of file KoPathToolSelection.cpp.
|
override |
Definition at line 28 of file KoPathToolSelection.cpp.
| void KoPathToolSelection::add | ( | KoPathPoint * | point, |
| bool | clear ) |
Add a point to the selection.
| point | to add to the selection |
| clear | if true the selection will be cleared before adding the point |
Definition at line 48 of file KoPathToolSelection.cpp.
References clear(), m_selectedPoints, m_shapePointMap, KoPathPoint::parent(), selectionChanged(), and size().
| void KoPathToolSelection::clear | ( | ) |
Clear the selection.
Definition at line 88 of file KoPathToolSelection.cpp.
References m_selectedPoints, m_shapePointMap, and selectionChanged().
| bool KoPathToolSelection::contains | ( | KoPathPoint * | point | ) |
Check if a point is in the selection.
Definition at line 137 of file KoPathToolSelection.cpp.
References m_selectedPoints.
|
overridevirtual |
reimplemented from KoToolSelection
Reimplemented from KoToolSelection.
Definition at line 242 of file KoPathToolSelection.cpp.
References m_selectedPoints.
|
overridevirtual |
Implements KoPathShape::PointSelectionChangeListener.
Definition at line 265 of file KoPathToolSelection.cpp.
References m_selectedPoints, m_shapePointMap, m_tool, KoPathTool::notifyPathPointsChanged(), and selectionChanged().
|
overridevirtual |
Implements KoShape::ShapeChangeListener.
Definition at line 279 of file KoPathToolSelection.cpp.
References KoShape::Deleted, KIS_SAFE_ASSERT_RECOVER_NOOP, KoPathShapeId, m_selectedPoints, m_selectedShapes, m_shapePointMap, KoPathShape::PointSelectionChangeListener::notifyShapeChanged(), and KoShape::shapeId().
| int KoPathToolSelection::objectCount | ( | ) | const |
Get the number of path objects in the selection.
Definition at line 127 of file KoPathToolSelection.cpp.
References m_shapePointMap.
| void KoPathToolSelection::paint | ( | QPainter & | painter, |
| const KoViewConverter & | converter, | ||
| qreal | handleRadius, | ||
| KoColorDisplayRendererInterface * | renderInterface ) |
Draw the selected points.
Definition at line 32 of file KoPathToolSelection.cpp.
References KoPathPoint::All, KoShape::createHandlePainterHelperView(), KoToolBase::decorationThickness(), KoColorDisplayRendererInterface::handlePaletteForDisplayColorSpace(), m_shapePointMap, m_tool, p, palette, KisHandleStyle::selectedPrimaryHandles(), and KisHandlePainterHelper::setHandleStyle().
|
overridevirtual |
Implements KoPathShape::PointSelectionChangeListener.
Definition at line 247 of file KoPathToolSelection.cpp.
References add(), KIS_SAFE_ASSERT_RECOVER, m_shapePointMap, KoPathShape::pointByIndex(), remove(), and selectionChanged().
| void KoPathToolSelection::remove | ( | KoPathPoint * | point | ) |
Remove a point form the selection.
| point | to remove from the selection |
Definition at line 76 of file KoPathToolSelection.cpp.
References m_selectedPoints, m_shapePointMap, KoPathPoint::parent(), selectionChanged(), and size().
| void KoPathToolSelection::selectAll | ( | ) |
Definition at line 113 of file KoPathToolSelection.cpp.
References add(), KoParameterShape::isParametricShape(), m_selectedShapes, KoPathShape::outlineRect(), KoPathShape::pointsAt(), and selectionChanged().
| const QSet< KoPathPoint * > & KoPathToolSelection::selectedPoints | ( | ) | const |
Get all selected points.
Definition at line 142 of file KoPathToolSelection.cpp.
References m_selectedPoints.
| QList< KoPathPointData > KoPathToolSelection::selectedPointsData | ( | ) | const |
Get the point data of all selected points.
This is subject to change
Definition at line 147 of file KoPathToolSelection.cpp.
References m_selectedPoints, p, KoShape::parent(), and KoPathShape::pathPointIndex().
| QList< KoPathPointData > KoPathToolSelection::selectedSegmentsData | ( | ) | const |
Get the point data of all selected segments.
This is subject to change
Definition at line 157 of file KoPathToolSelection.cpp.
References KoPathPoint::CloseSubpath, KoPathPointData::pathShape, KoPathPointData::pointIndex, selectedPointsData(), and KoPathPoint::StartSubpath.
| QList< KoPathShape * > KoPathToolSelection::selectedShapes | ( | ) | const |
Returns list of selected shapes.
Definition at line 190 of file KoPathToolSelection.cpp.
References m_selectedShapes.
|
signal |
| void KoPathToolSelection::selectPoints | ( | const QRectF & | rect, |
| bool | clearSelection ) |
Select points in rect.
| rect | the selection rectangle in document coordinates |
| clearSelection | if set clear the current selection before the selection |
Definition at line 95 of file KoPathToolSelection.cpp.
References add(), clear(), KoShape::documentToShape(), KoParameterShape::isParametricShape(), m_selectedShapes, KoPathShape::pointsAt(), and selectionChanged().
| void KoPathToolSelection::setSelectedShapes | ( | const QList< KoPathShape * > | shapes | ) |
Sets list of selected shapes.
Definition at line 195 of file KoPathToolSelection.cpp.
References KoShape::addShapeChangeListener(), m_selectedShapes, and KoShape::removeShapeChangeListener().
| int KoPathToolSelection::size | ( | ) | const |
Get the number of path points in the selection.
Definition at line 132 of file KoPathToolSelection.cpp.
References m_selectedPoints.
| void KoPathToolSelection::update | ( | ) |
Update the selection to contain only valid points.
This function checks which points are no longer valid and removes them from the selection. If e.g. some points are selected and the shape which contains the points is removed by undo, the points are no longer valid and have therefore to be removed from the selection.
Definition at line 208 of file KoPathToolSelection.cpp.
References KoParameterShape::isParametricShape(), m_selectedPoints, m_selectedShapes, m_shapePointMap, and selectionChanged().
|
private |
Definition at line 144 of file KoPathToolSelection.h.
|
private |
Definition at line 147 of file KoPathToolSelection.h.
|
private |
Definition at line 145 of file KoPathToolSelection.h.
|
private |
Definition at line 146 of file KoPathToolSelection.h.