Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_shape.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2005 Adrian Page <adrian@pagenet.plus.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_TOOL_SHAPE_H_
8#define KIS_TOOL_SHAPE_H_
9
10
11#include <kritaui_export.h>
12#include <kconfig.h>
13#include <kconfiggroup.h>
14
15#include <kis_painter.h>
16
17#include "kis_tool_paint.h"
19#include "KisToolShapeUtils.h"
20
21#include "ui_wdggeometryoptions.h"
22
23class KoCanvasBase;
24class KoPathShape;
25
26
27class WdgGeometryOptions : public QWidget, public Ui::WdgGeometryOptions
28{
29 Q_OBJECT
30
31public:
32 WdgGeometryOptions(QWidget *parent) : QWidget(parent) {
33 setupUi(this);
34 }
35};
36
40class KRITAUI_EXPORT KisToolShape : public KisToolPaint
41{
42
43 Q_OBJECT
44
45public:
46 KisToolShape(KoCanvasBase * canvas, const QCursor & cursor);
47 ~KisToolShape() override;
48 int flags() const override;
50
51public Q_SLOTS:
52 void activate(const QSet<KoShape*> &shapes) override;
53 virtual void outlineSettingChanged(int value);
54 virtual void fillSettingChanged(int value);
55 virtual void patternRotationSettingChanged(qreal value);
56 virtual void patternScaleSettingChanged(qreal value);
57
58protected:
59 QWidget* createOptionWidget() override;
60
63 QTransform fillTransform();
64
65 qreal currentStrokeWidth() const;
66
67 struct KRITAUI_EXPORT ShapeAddInfo {
68 bool shouldAddShape = false;
69 bool shouldAddSelectionShape = false;
70
71 void markAsSelectionShapeIfNeeded(KoShape *shape) const;
72 };
73
74 ShapeAddInfo shouldAddShape(KisNodeSP currentNode) const;
75
76 void addShape(KoShape* shape);
77
78 void addPathShape(KoPathShape* pathShape, const KUndo2MagicString& name);
79
84 virtual void beginShape() {}
85 virtual void endShape() {}
86
87 KConfigGroup m_configGroup;
88};
89
90#endif // KIS_TOOL_SHAPE_H_
91
float value(const T *src, size_t ch)
int flags() const override
QWidget * createOptionWidget() override
void activate(const QSet< KoShape * > &shapes) override
WdgGeometryOptions * m_shapeOptionsWidget
KConfigGroup m_configGroup
virtual void beginShape()
virtual void endShape()
The position of a path point within a path shape.
Definition KoPathShape.h:63
WdgGeometryOptions(QWidget *parent)