Krita Source Code Documentation
Loading...
Searching...
No Matches
KisHandlePainterHelper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISHANDLEPAINTERHELPER_H
8#define KISHANDLEPAINTERHELPER_H
9
10#include "kritaglobal_export.h"
11#include "kis_algebra_2d.h"
12
13#include <QPainter>
14#include <KisHandleStyle.h>
15class QPainter;
16class KoShape;
17class KoViewConverter;
18
34class KRITAGLOBAL_EXPORT KisHandlePainterHelper
35{
36public:
37
42 KisHandlePainterHelper(QPainter *_painter, qreal handleRadius = 0.0, int decorationThickness = 1);
43
49 KisHandlePainterHelper(QPainter *_painter, const QTransform &originalPainterTransform, qreal handleRadius, int decorationThickness = 1);
50
56
61
66 void setHandleStyle(const KisHandleStyle &style);
67
71 void drawHandleRect(const QPointF &center, qreal radius);
72 void drawHandleRect(const QPointF &center, qreal radius, QPoint offset);
73 void fillHandleRect(const QPointF &center, qreal radius, QColor fillColor, QPoint offset);
74
78 void drawHandleCircle(const QPointF &center, qreal radius);
79
84 void drawHandleRect(const QPointF &center);
85
90 void drawHandleCircle(const QPointF &center);
91
96 void drawHandleSmallCircle(const QPointF &center);
97
101 void drawHandleLine(const QLineF &line, qreal width = 1.0, QVector<qreal> dashPattern = {}, qreal dashOffset = 0.0);
102
106 void drawGradientHandle(const QPointF &center, qreal radius);
107
111 void drawGradientHandle(const QPointF &center);
112
116 void drawGradientCrossHandle(const QPointF &center, qreal radius);
117
121 void drawGradientArrow(const QPointF &start, const QPointF &end, qreal radius);
122
126 void drawRubberLine(const QPolygonF &poly);
127
131 void drawConnectionLine(const QLineF &line);
132
136 void drawConnectionLine(const QPointF &p1, const QPointF &p2);
137
141 void drawPath(const QPainterPath &path);
142
146 void drawPixmap(const QPixmap &pixmap, QPointF position, int size, QRectF sourceRect);
147
148private:
149
154 void drawArrow(const QPointF &pos, const QPointF &from, qreal radius);
155
156 void init();
157
158private:
159 QPainter *m_painter;
168};
169
170#endif // KISHANDLEPAINTERHELPER_H
QPointF p2
QPointF p1
The KisHandlePainterHelper class is a special helper for painting handles around objects....
void drawHandleRect(const QPointF &center, qreal radius)
KisAlgebra2D::DecomposedMatrix m_decomposedMatrix
KisHandlePainterHelper(KisHandlePainterHelper &rhs)=delete