Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPathToolHandle.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, 2010 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 KOPATHTOOLHANDLE_H
11#define KOPATHTOOLHANDLE_H
12
13#include <KoPathPoint.h>
15
16#include <QList>
17#include <QRectF>
18
19class KoPathTool;
21class KoViewConverter;
22class KoPointerEvent;
23class QPainter;
24class KoPathShape;
26
27
29{
30public:
31 explicit KoPathToolHandle(KoPathTool *tool);
32 virtual ~KoPathToolHandle();
33 virtual void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness) = 0;
34 virtual QRectF boundingRect() const = 0;
36 // test if handle is still valid
37 virtual bool check(const QList<KoPathShape*> &selectedShapes) = 0;
38
39 virtual void trySelectHandle() {};
40
41protected:
43};
44
46{
47public:
49 void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness) override;
50 QRectF boundingRect() const override;
52 bool check(const QList<KoPathShape*> &selectedShapes) override;
53 KoPathPoint *activePoint() const;
55 void trySelectHandle() override;
56private:
59 mutable QRectF m_oldRepaintedRect;
60};
61
63{
64public:
65 ParameterHandle(KoPathTool *tool, KoParameterShape *parameterShape, int handleId);
66 void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness) override;
67 QRectF boundingRect() const override;
69 bool check(const QList<KoPathShape*> &selectedShapes) override;
70protected:
73};
74
75#endif // KOPATHTOOLHANDLE_H
The KisHandlePainterHelper class is a special helper for painting handles around objects....
A KoPathPoint represents a point in a path.
PointType
the type for identifying part of a KoPathPoint
Definition KoPathPoint.h:47
The position of a path point within a path shape.
Definition KoPathShape.h:63
virtual QRectF boundingRect() const =0
virtual KoInteractionStrategy * handleMousePress(KoPointerEvent *event)=0
KoPathToolHandle(KoPathTool *tool)
KoPathTool * m_tool
virtual void trySelectHandle()
virtual bool check(const QList< KoPathShape * > &selectedShapes)=0
virtual void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness)=0
KoParameterShape * m_parameterShape
ParameterHandle(KoPathTool *tool, KoParameterShape *parameterShape, int handleId)
void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness) override
QRectF boundingRect() const override
KoInteractionStrategy * handleMousePress(KoPointerEvent *event) override
bool check(const QList< KoPathShape * > &selectedShapes) override
bool check(const QList< KoPathShape * > &selectedShapes) override
void trySelectHandle() override
PointHandle(KoPathTool *tool, KoPathPoint *activePoint, KoPathPoint::PointType activePointType)
KoPathPoint::PointType m_activePointType
QRectF m_oldRepaintedRect
QRectF boundingRect() const override
KoInteractionStrategy * handleMousePress(KoPointerEvent *event) override
KoPathPoint * activePoint() const
void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness) override
KoPathPoint * m_activePoint
KoPathPoint::PointType activePointType() const