Krita Source Code Documentation
Loading...
Searching...
No Matches
Shape.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_SHAPE_H
7#define LIBKIS_SHAPE_H
8
9#include <QObject>
10#include <KoShape.h>
11
12#include "kritalibkis_export.h"
13#include "libkis.h"
14#include <kis_types.h>
15
37class KRITALIBKIS_EXPORT Shape : public QObject
38{
39 Q_OBJECT
40 Q_DISABLE_COPY(Shape)
41
42public:
43 explicit Shape(KoShape *shape, QObject *parent = 0);
44 ~Shape();
45
46 bool operator==(const Shape &other) const;
47 bool operator!=(const Shape &other) const;
48
49public Q_SLOTS:
50
55 QString name() const;
56
61 void setName(const QString &name);
62
67 virtual QString type() const;
68
73 int zIndex() const;
74
79 void setZIndex(int zindex);
80
85 bool selectable() const;
86
91 void setSelectable(bool selectable);
92
97 bool geometryProtected() const;
98
103 void setGeometryProtected(bool protect);
104
109 bool visible() const;
110
115 void setVisible(bool visible);
116
121 QRectF boundingBox() const;
122
127 QPointF position() const;
128
133 void setPosition(QPointF point);
134
139 QTransform transformation() const;
140
145 void setTransformation(QTransform matrix);
146
151 QTransform absoluteTransformation() const;
152
156 bool remove();
157
161 void update();
162
167 void updateAbsolute(QRectF box);
168
177 QString toSvg(bool prependStyles = false, bool stripTextMode = true);
178
182 void select();
183
187 void deselect();
188
193 bool isSelected();
194
199 Shape* parentShape() const;
200
201private:
202 friend class GroupShape;
203 friend class VectorLayer;
204
205 struct Private;
206 Private *const d;
207
208 KoShape *shape();
209};
210
211#endif // LIBKIS_SHAPE_H
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
bool operator!=(const KoID &v1, const KoID &v2)
Definition KoID.h:103
The GroupShape class A group shape is a vector object with child shapes.
Definition GroupShape.h:21
The Shape class The shape class is a wrapper around Krita's vector objects.
Definition Shape.h:38
Private *const d
Definition Shape.h:206
The VectorLayer class A vector layer is a special layer that stores and shows vector shapes.
Definition VectorLayer.h:32