Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdeclarativegeomapitemutils_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 Paolo Angelelli <paolo.angelelli@gmail.com>
2// Copyright (C) 2022 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QDECLARATIVEGEOMAPITEMUTILS_P_H
7#define QDECLARATIVEGEOMAPITEMUTILS_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtLocation/private/qlocationglobal_p.h>
21#include <QtLocation/private/qgeoprojection_p.h>
22#include <QtPositioning/private/qdoublevector2d_p.h>
23
24
25QT_BEGIN_NAMESPACE
26
28{
33
34 struct vec2 {
35 float x;
36 float y;
37 vec2(const QDoubleVector2D &p)
38 {
39 x = float(p.x());
40 y = float(p.y());
41 }
42 vec2() = default;
43 vec2 &operator=(const QPointF &p)
44 {
45 x = float(p.x());
46 y = float(p.y());
47 return *this;
48 }
49 vec2 &operator=(const QDoubleVector2D &p)
50 {
51 x = float(p.x());
52 y = float(p.y());
53 return *this;
54 }
56 {
57 return QDoubleVector2D(double(x), double(y));
58 }
59 };
60
61
62 double distanceSqrPointLine(double p0_x
63 , double p0_y
64 , double p1_x
65 , double p1_y
66 , double p2_x
67 , double p2_y);
68
69 void wrapPath(const QList<QGeoCoordinate> &perimeter
70 , const QGeoCoordinate &geoLeftBound
71 , const QGeoProjectionWebMercator &p
72 , QList<QDoubleVector2D> &wrappedPath
73 , QList<QDoubleVector2D> &wrappedPathMinus1
74 , QList<QDoubleVector2D> &wrappedPathPlus1
75 , QDoubleVector2D *leftBoundWrapped = nullptr);
76
77 void wrapPath(const QList<QGeoCoordinate> &perimeter
78 , const QGeoCoordinate &geoLeftBound
79 , const QGeoProjectionWebMercator &p
80 , QList<QDoubleVector2D> &wrappedPath
81 , QDoubleVector2D *leftBoundWrapped = nullptr);
82
83 void wrapPath(const QList<QDoubleVector2D> &path
84 , const QDoubleVector2D &geoLeftBound
85 , QList<QDoubleVector2D> &wrappedPath);
86
87 void clipPolygon(const QList<QDoubleVector2D> &wrappedPath
88 , const QGeoProjectionWebMercator &p
89 , QList<QList<QDoubleVector2D> > &clippedPaths
90 , QDoubleVector2D *leftBoundWrapped = nullptr
91 , bool closed = true);
92
93 void projectBbox(const QList<QDoubleVector2D> &clippedBbox
94 , const QGeoProjectionWebMercator &p
95 , QPainterPath &projectedBbox);
96
97 QRectF boundingRectangleFromList(const QList<QDoubleVector2D> &list);
98
99 QList<QGeoCoordinate> greaterCirclePath(const QList<QGeoCoordinate> &cornerPoints,
101 int N=360);
102};
103
104QT_END_NAMESPACE
105
106#endif // QDECLARATIVEGEOMAPITEMUTILS_P_H
void wrapPath(const QList< QGeoCoordinate > &perimeter, const QGeoCoordinate &geoLeftBound, const QGeoProjectionWebMercator &p, QList< QDoubleVector2D > &wrappedPath, QList< QDoubleVector2D > &wrappedPathMinus1, QList< QDoubleVector2D > &wrappedPathPlus1, QDoubleVector2D *leftBoundWrapped)
QList< QGeoCoordinate > greaterCirclePath(const QList< QGeoCoordinate > &cornerPoints, greaterCirclePathForm form, int N)
QRectF boundingRectangleFromList(const QList< QDoubleVector2D > &list)
void wrapPath(const QList< QDoubleVector2D > &path, const QDoubleVector2D &geoLeftBound, QList< QDoubleVector2D > &wrappedPath)
void clipPolygon(const QList< QDoubleVector2D > &wrappedPath, const QGeoProjectionWebMercator &p, QList< QList< QDoubleVector2D > > &clippedPaths, QDoubleVector2D *leftBoundWrapped, bool closed)
double distanceSqrPointLine(double p0_x, double p0_y, double p1_x, double p1_y, double p2_x, double p2_y)
void projectBbox(const QList< QDoubleVector2D > &clippedBbox, const QGeoProjectionWebMercator &p, QPainterPath &projectedBbox)
void wrapPath(const QList< QGeoCoordinate > &perimeter, const QGeoCoordinate &geoLeftBound, const QGeoProjectionWebMercator &p, QList< QDoubleVector2D > &wrappedPath, QDoubleVector2D *leftBoundWrapped)
Combined button and popup list for selecting options.