Krita Source Code Documentation
Loading...
Searching...
No Matches
KoPathPoint.h
Go to the documentation of this file.
1
/* This file is part of the KDE project
2
SPDX-FileCopyrightText: 2006 Thorsten Zachmann <zachmann@kde.org>
3
SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
4
SPDX-FileCopyrightText: 2006-2008 Jan Hambrecht <jaham@gmx.net>
5
6
SPDX-License-Identifier: LGPL-2.0-or-later
7
*/
8
9
#ifndef KOPATHPOINT_H
10
#define KOPATHPOINT_H
11
12
#include "kritaflake_export.h"
13
14
#include <QFlags>
15
16
class
KoPathShape
;
17
class
QPointF;
18
class
QTransform;
19
class
QRectF;
20
class
QPainter;
21
class
KisHandlePainterHelper
;
22
32
class
KRITAFLAKE_EXPORT
KoPathPoint
33
{
34
public
:
36
enum
PointProperty
{
37
Normal = 0,
38
StartSubpath = 1,
39
StopSubpath = 2,
40
CloseSubpath = 8,
41
IsSmooth = 16,
42
IsSymmetric = 32
43
};
44
Q_DECLARE_FLAGS
(PointProperties, PointProperty)
45
46
47
enum
PointType
{
48
None
= 0,
49
Node
= 1,
50
ControlPoint1 = 2,
51
ControlPoint2 = 4,
52
All
= 7
53
};
54
Q_DECLARE_FLAGS
(PointTypes, PointType)
55
56
57
KoPathPoint
();
58
66
KoPathPoint
(
KoPathShape
*path,
const
QPointF &point, PointProperties properties = Normal);
67
71
KoPathPoint
(
const
KoPathPoint
&pathPoint);
72
KoPathPoint
(
const
KoPathPoint
&pathPoint,
KoPathShape
*newParent);
73
77
KoPathPoint
& operator=(
const
KoPathPoint
&other);
78
80
bool
operator ==
(
const
KoPathPoint
&other)
const
;
81
85
~KoPathPoint
();
86
92
QPointF
point
()
const
;
93
101
QPointF
controlPoint1
()
const
;
102
110
QPointF
controlPoint2
()
const
;
111
117
void
setPoint(
const
QPointF &point);
118
124
void
setControlPoint1(
const
QPointF &point);
125
131
void
setControlPoint2(
const
QPointF &point);
132
134
void
removeControlPoint1();
135
137
void
removeControlPoint2();
138
144
PointProperties
properties
()
const
;
145
150
void
setProperties(PointProperties properties);
151
156
void
setProperty(
PointProperty
property);
157
162
void
unsetProperty(
PointProperty
property);
163
174
bool
activeControlPoint1
()
const
;
175
186
bool
activeControlPoint2
()
const
;
187
195
void
map(
const
QTransform &matrix);
196
205
void
paint(
KisHandlePainterHelper
&handlesHelper, PointTypes types,
bool
active =
true
);
206
211
void
setParent(
KoPathShape
* parent);
212
217
KoPathShape
*parent()
const
;
218
229
QRectF boundingRect(
bool
active =
true
)
const
;
230
238
void
reverse();
239
252
bool
isSmooth(
KoPathPoint
*previous,
KoPathPoint
*next)
const
;
253
254
protected
:
255
friend
class
KoPathShapePrivate;
256
private
:
257
class
Private
;
258
Private
*
const
d
;
259
};
260
261
// /// a KoSubpath contains a path from a moveTo until a close or a new moveTo
262
// typedef QList<KoPathPoint *> KoSubpath;
263
// typedef QList<KoSubpath *> KoSubpathList;
264
// /// A KoPathSegment is a pair two neighboring KoPathPoints
265
// typedef QPair<KoPathPoint*,KoPathPoint*> KoPathSegment;
266
// /// The position of a path point within a path shape
267
// typedef QPair<KoSubpath*, int> KoPointPosition;
268
269
Q_DECLARE_OPERATORS_FOR_FLAGS
(KoPathPoint::PointProperties)
270
Q_DECLARE_OPERATORS_FOR_FLAGS
(KoPathPoint::PointTypes)
271
272
#endif
operator==
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
Definition
KisRegion.cpp:398
Q_DECLARE_FLAGS
Q_DECLARE_FLAGS(KisUpdaterContextSnapshotEx, KisUpdaterContextSnapshotExTag)
None
@ None
Definition
KoColorConversionSystem_p.h:21
All
@ All
Definition
StoryboardDockerDock.cpp:55
KisHandlePainterHelper
The KisHandlePainterHelper class is a special helper for painting handles around objects....
Definition
KisHandlePainterHelper.h:35
KoPathPoint
A KoPathPoint represents a point in a path.
Definition
KoPathPoint.cpp:25
KoPathPoint::controlPoint2
QPointF controlPoint2() const
get the second control point
KoPathPoint::activeControlPoint2
bool activeControlPoint2() const
Checks if there is a controlPoint2.
KoPathPoint::point
QPointF point() const
return the position relative to the shape origin
KoPathPoint::properties
PointProperties properties() const
Get the properties of a point.
KoPathPoint::PointProperty
PointProperty
property enum
Definition
KoPathPoint.h:36
KoPathPoint::PointType
PointType
the type for identifying part of a KoPathPoint
Definition
KoPathPoint.h:47
KoPathPoint::activeControlPoint1
bool activeControlPoint1() const
Checks if there is a controlPoint1.
KoPathPoint::d
Private *const d
Definition
KoPathPoint.h:258
KoPathPoint::controlPoint1
QPointF controlPoint1() const
get the control point 1
KoPathShape
The position of a path point within a path shape.
Definition
KoPathShape.h:63
Node
Definition
Node.h:24
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(KisBaseRectsWalker::SubtreeVisitFlags)
Private
Definition
SvgTransformParser.cpp:20
libs
flake
KoPathPoint.h
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52