Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qclipperutils_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
#
ifndef
QCLIPPERUTILS_P_H
5
#
define
QCLIPPERUTILS_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
/*
19
* This file is intended to be include only in source files of
20
* QtPositioning/QtLocation. It is in QtPositioning to enable manipulation
21
* of geo polygons
22
*/
23
24
#
include
<
QtPositioning
/
private
/
qpositioningglobal_p
.
h
>
25
#
include
<
QtCore
/
QtGlobal
>
26
#
include
<
QtCore
/
QList
>
27
#
include
<
QtPositioning
/
private
/
qdoublevector2d_p
.
h
>
28
29
QT_BEGIN_NAMESPACE
30
31
/*
32
* This class provides a wrapper around the clip2tri library, so that
33
* we do not need to export any of the internal types. That is needed
34
* because after QtLocation and QtPositioning are moved to different
35
* repos, we need to use the features of the library in QtLocation without
36
* explicitly linking to it.
37
*/
38
39
class
QClipperUtilsPrivate;
40
class
Q_POSITIONING_EXPORT
QClipperUtils
41
{
42
public
:
43
QClipperUtils();
44
QClipperUtils(
const
QClipperUtils &other);
45
~QClipperUtils();
46
47
// Must be in sync with c2t::clip2tri::Operation
48
enum
Operation {
49
Union,
50
Intersection,
51
Difference,
52
Xor
53
};
54
55
// Must be in sync with QtClipperLib::PolyFillType
56
enum
PolyFillType {
57
pftEvenOdd,
58
pftNonZero,
59
pftPositive,
60
pftNegative
61
};
62
63
static
double
clipperScaleFactor();
64
65
static
int
pointInPolygon(
const
QDoubleVector2D &point,
const
QList<QDoubleVector2D> &polygon);
66
67
// wrap some useful non-static methods of c2t::clip2tri
68
void
clearClipper();
69
void
addSubjectPath(
const
QList<QDoubleVector2D> &path,
bool
closed);
70
void
addClipPolygon(
const
QList<QDoubleVector2D> &path);
71
QList<QList<QDoubleVector2D>> execute(Operation op, PolyFillType subjFillType = pftNonZero,
72
PolyFillType clipFillType = pftNonZero);
73
74
// For optimization purposes. Set the polygon once and check for multiple
75
// points. Without the need to convert between Qt and clip2tri types
76
// every time
77
void
setPolygon(
const
QList<QDoubleVector2D> &polygon);
78
int
pointInPolygon(
const
QDoubleVector2D &point)
const
;
79
80
private
:
81
QClipperUtilsPrivate *d_ptr;
82
};
83
84
QT_END_NAMESPACE
85
86
#
endif
// QCLIPPERUTILS_P_H
QClipperUtilsPrivate
Definition
qclipperutils.cpp:11
QClipperUtilsPrivate::m_clipper
c2t::clip2tri m_clipper
Definition
qclipperutils.cpp:13
QClipperUtilsPrivate::m_cachedPolygon
Path m_cachedPolygon
Definition
qclipperutils.cpp:14
QClipperUtils
Definition
qclipperutils_p.h:41
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
toIntPoint
static IntPoint toIntPoint(const QDoubleVector2D &p)
Definition
qclipperutils.cpp:20
kClipperScaleFactor
static const double kClipperScaleFactor
Definition
qclipperutils.cpp:17
toVector2D
static QDoubleVector2D toVector2D(const IntPoint &p)
Definition
qclipperutils.cpp:25
kClipperScaleFactorInv
static const double kClipperScaleFactorInv
Definition
qclipperutils.cpp:18
pathsToQList
static QList< QList< QDoubleVector2D > > pathsToQList(const Paths &paths)
Definition
qclipperutils.cpp:39
pathToQList
static QList< QDoubleVector2D > pathToQList(const Path &path)
Definition
qclipperutils.cpp:30
qListToPath
static Path qListToPath(const QList< QDoubleVector2D > &list)
Definition
qclipperutils.cpp:49
qtpositioning
src
positioning
qclipperutils_p.h
Generated on
for Qt by
1.18.0