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;
27
28
30{
31public:
32 explicit KoPathToolHandle(KoPathTool *tool);
33 virtual ~KoPathToolHandle();
34 virtual void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness, KoColorDisplayRendererInterface *renderInterface) = 0;
35 virtual QRectF boundingRect() const = 0;
37 // test if handle is still valid
38 virtual bool check(const QList<KoPathShape*> &selectedShapes) = 0;
39
40 virtual void trySelectHandle() {};
41
42protected:
44};
45
47{
48public:
50 void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness, KoColorDisplayRendererInterface *renderInterface) override;
51 QRectF boundingRect() const override;
53 bool check(const QList<KoPathShape*> &selectedShapes) override;
54 KoPathPoint *activePoint() const;
56 void trySelectHandle() override;
57private:
60 mutable QRectF m_oldRepaintedRect;
61};
62
64{
65public:
66 ParameterHandle(KoPathTool *tool, KoParameterShape *parameterShape, int handleId);
67 void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness, KoColorDisplayRendererInterface *renderInterface) override;
68 QRectF boundingRect() const override;
70 bool check(const QList<KoPathShape*> &selectedShapes) override;
71protected:
74};
75
76#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, KoColorDisplayRendererInterface *renderInterface)=0
KoParameterShape * m_parameterShape
ParameterHandle(KoPathTool *tool, KoParameterShape *parameterShape, int handleId)
void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness, KoColorDisplayRendererInterface *renderInterface) 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
void paint(QPainter &painter, const KoViewConverter &converter, qreal handleRadius, int decorationThickness, KoColorDisplayRendererInterface *renderInterface) 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
KoPathPoint * m_activePoint
KoPathPoint::PointType activePointType() const