Krita Source Code Documentation
Loading...
Searching...
No Matches
SpiralShape.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2007 Rob Buis <buis@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KOSPIRALSHAPE_H
8#define KOSPIRALSHAPE_H
9
10#include "KoParameterShape.h"
11
12#define SpiralShapeId "SpiralShape"
13
19{
20public:
23 Curve = 0,
24 Line = 1
25 };
26
28 ~SpiralShape() override;
29
30 KoShape* cloneShape() const override;
31
32 void setSize(const QSizeF &newSize) override;
33 QPointF normalize() override;
34
40
42 SpiralType type() const;
43
48 void setFade(qreal fade);
49
51 qreal fade() const;
52
53 bool clockWise() const;
54 void setClockWise(bool clockwise);
55
57 QString pathShapeId() const override;
58
59protected:
60 SpiralShape(const SpiralShape &rhs);
61
62 void moveHandleAction(int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers = Qt::NoModifier) override;
63 void updatePath(const QSizeF &size) override;
64 void createPath(const QSizeF &size);
65
66private:
67 void updateKindHandle();
68 void updateAngleHandles();
69
70 // fade parameter
71 qreal m_fade;
72 // angle for modifying the kind in radiant
74 // the center of the spiral
75 QPointF m_center;
76 // the radii of the spiral
77 QPointF m_radii;
78 // the actual spiral type
80 //
82
84};
85
86#endif /* KOSPIRALSHAPE_H */
87
QSizeF size() const override
reimplemented
void updateKindHandle()
void updatePath(const QSizeF &size) override
Update the path of the parameter shape.
void setSize(const QSizeF &newSize) override
reimplemented from KoShape
SpiralType
the possible spiral types
Definition SpiralShape.h:22
@ Line
spiral uses lines
Definition SpiralShape.h:24
@ Curve
spiral uses curves
Definition SpiralShape.h:23
KoShape * cloneShape() const override
creates a deep copy of the shape or shape's subtree
qreal m_kindAngle
Definition SpiralShape.h:73
QPointF m_center
Definition SpiralShape.h:75
QPointF normalize() override
Normalizes the path data.
void moveHandleAction(int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier) override
Updates the internal state of a KoParameterShape.
SpiralType m_type
Definition SpiralShape.h:79
void setType(SpiralType type)
QString pathShapeId() const override
reimplemented
bool clockWise() const
void setClockWise(bool clockwise)
~SpiralShape() override
KoSubpath m_points
Definition SpiralShape.h:83
qreal fade() const
Returns the actual fade parameter.
void updateAngleHandles()
bool m_clockwise
Definition SpiralShape.h:81
QPointF m_radii
Definition SpiralShape.h:77
SpiralType type() const
Returns the actual spiral type.
void createPath(const QSizeF &size)
void setFade(qreal fade)