Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
#ifndef QCLIPPERUTILS_P_H
4
#define QCLIPPERUTILS_P_H
5
6
//
7
// W A R N I N G
8
// -------------
9
//
10
// This file is not part of the Qt API. It exists purely as an
11
// implementation detail. This header file may change from version to
12
// version without notice, or even be removed.
13
//
14
// We mean it.
15
//
16
17
/*
18
* This file is intended to be include only in source files of
19
* QtPositioning/QtLocation. It is in QtPositioning to enable manipulation
20
* of geo polygons
21
*/
22
23
#include <QtPositioning/private/qpositioningglobal_p.h>
24
#include <QtCore/QtGlobal>
25
#include <QtCore/QList>
26
#include <QtPositioning/private/qdoublevector2d_p.h>
27
28
QT_BEGIN_NAMESPACE
29
30
/*
31
* This class provides a wrapper around the clip2tri library, so that
32
* we do not need to export any of the internal types. That is needed
33
* because after QtLocation and QtPositioning are moved to different
34
* repos, we need to use the features of the library in QtLocation without
35
* explicitly linking to it.
36
*/
37
38
class
QClipperUtilsPrivate
;
39
class
Q_POSITIONING_EXPORT
QClipperUtils
40
{
41
public
:
42
QClipperUtils
();
43
QClipperUtils
(
const
QClipperUtils
&
other
);
44
~QClipperUtils
();
45
46
// Must be in sync with c2t::clip2tri::Operation
47
enum
Operation
{
48
Union
,
49
Intersection
,
50
Difference
,
51
Xor
52
};
53
54
// Must be in sync with QtClipperLib::PolyFillType
55
enum
PolyFillType
{
56
pftEvenOdd
,
57
pftNonZero
,
58
pftPositive
,
59
pftNegative
60
};
61
62
static
double
clipperScaleFactor();
63
64
static
int
pointInPolygon(
const
QDoubleVector2D
&point,
const
QList<QDoubleVector2D> &
polygon
);
65
66
// wrap some useful non-static methods of c2t::clip2tri
67
void
clearClipper();
68
void
addSubjectPath(
const
QList<QDoubleVector2D> &
path
,
bool
closed);
69
void
addClipPolygon(
const
QList<QDoubleVector2D> &
path
);
70
QList<QList<QDoubleVector2D>> execute(
Operation
op, PolyFillType subjFillType = pftNonZero,
71
PolyFillType clipFillType = pftNonZero);
72
73
// For optimization purposes. Set the polygon once and check for multiple
74
// points. Without the need to convert between Qt and clip2tri types
75
// every time
76
void
setPolygon(
const
QList<QDoubleVector2D> &
polygon
);
77
int
pointInPolygon(
const
QDoubleVector2D
&point)
const
;
78
79
private
:
80
QClipperUtilsPrivate
*d_ptr;
81
};
82
83
QT_END_NAMESPACE
84
85
#endif
// QCLIPPERUTILS_P_H
Operation
Definition
dialogs.cpp:188
QClipperUtilsPrivate
Definition
qclipperutils.cpp:10
QClipperUtils
Definition
qclipperutils_p.h:40
QClipperUtils::Intersection
@ Intersection
Definition
qclipperutils_p.h:49
QClipperUtils::Union
@ Union
Definition
qclipperutils_p.h:48
QClipperUtils::Difference
@ Difference
Definition
qclipperutils_p.h:50
QClipperUtils::PolyFillType
PolyFillType
Definition
qclipperutils_p.h:55
QClipperUtils::pftPositive
@ pftPositive
Definition
qclipperutils_p.h:58
QClipperUtils::pftNonZero
@ pftNonZero
Definition
qclipperutils_p.h:57
QClipperUtils::pftEvenOdd
@ pftEvenOdd
Definition
qclipperutils_p.h:56
QDoubleVector2D
Definition
qdoublevector2d_p.h:31
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
polygon
Definition
polygon.cpp:4
path
GLsizei const GLchar *const * path
Definition
qopenglext.h:4283
other
QSharedPointer< T > other(t)
[5]
qtpositioning
src
positioning
qclipperutils_p.h
Generated by
1.10.0