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
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
39class Q_POSITIONING_EXPORT QClipperUtils
40{
41public:
45
46 // Must be in sync with c2t::clip2tri::Operation
53
54 // Must be in sync with QtClipperLib::PolyFillType
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
79private:
81};
82
84
85#endif // QCLIPPERUTILS_P_H
Combined button and popup list for selecting options.
GLsizei const GLchar *const * path
QSharedPointer< T > other(t)
[5]