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
5#ifndef QDECLARATIVEGEOMAPITEMUTILS_P_H
6#define QDECLARATIVEGEOMAPITEMUTILS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtLocation/private/qlocationglobal_p.h>
20#include <QtLocation/private/qgeoprojection_p.h>
21#include <QtPositioning/private/qdoublevector2d_p.h>
22
23
24QT_BEGIN_NAMESPACE
25
27{
32
33 struct vec2 {
34 float x;
35 float y;
36 vec2(const QDoubleVector2D &p)
37 {
38 x = float(p.x());
39 y = float(p.y());
40 }
41 vec2() = default;
42 vec2 &operator=(const QPointF &p)
43 {
44 x = float(p.x());
45 y = float(p.y());
46 return *this;
47 }
48 vec2 &operator=(const QDoubleVector2D &p)
49 {
50 x = float(p.x());
51 y = float(p.y());
52 return *this;
53 }
55 {
56 return QDoubleVector2D(double(x), double(y));
57 }
58 };
59
60
61 double distanceSqrPointLine(double p0_x
62 , double p0_y
63 , double p1_x
64 , double p1_y
65 , double p2_x
66 , double p2_y);
67
68 void wrapPath(const QList<QGeoCoordinate> &perimeter
69 , const QGeoCoordinate &geoLeftBound
70 , const QGeoProjectionWebMercator &p
71 , QList<QDoubleVector2D> &wrappedPath
72 , QList<QDoubleVector2D> &wrappedPathMinus1
73 , QList<QDoubleVector2D> &wrappedPathPlus1
74 , QDoubleVector2D *leftBoundWrapped = nullptr);
75
76 void wrapPath(const QList<QGeoCoordinate> &perimeter
77 , const QGeoCoordinate &geoLeftBound
78 , const QGeoProjectionWebMercator &p
79 , QList<QDoubleVector2D> &wrappedPath
80 , QDoubleVector2D *leftBoundWrapped = nullptr);
81
82 void wrapPath(const QList<QDoubleVector2D> &path
83 , const QDoubleVector2D &geoLeftBound
84 , QList<QDoubleVector2D> &wrappedPath);
85
86 void clipPolygon(const QList<QDoubleVector2D> &wrappedPath
87 , const QGeoProjectionWebMercator &p
88 , QList<QList<QDoubleVector2D> > &clippedPaths
89 , QDoubleVector2D *leftBoundWrapped = nullptr
90 , bool closed = true);
91
92 void projectBbox(const QList<QDoubleVector2D> &clippedBbox
93 , const QGeoProjectionWebMercator &p
94 , QPainterPath &projectedBbox);
95
96 QRectF boundingRectangleFromList(const QList<QDoubleVector2D> &list);
97
98 QList<QGeoCoordinate> greaterCirclePath(const QList<QGeoCoordinate> &cornerPoints,
100 int N=360);
101};
102
103QT_END_NAMESPACE
104
105#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)