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
qgeocameratiles_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 QGEOCAMERATILES_P_P_H
4#define QGEOCAMERATILES_P_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
18#include "qgeomaptype_p.h"
20#include "qgeotilespec_p.h"
21
22#include <QtCore/qlist.h>
23#include <QtCore/qset.h>
24
25#include <QtPositioning/private/qwebmercator_p.h>
26#include <QtPositioning/private/qdoublevector2d_p.h>
27#include <QtPositioning/private/qdoublevector3d_p.h>
28
29QT_BEGIN_NAMESPACE
30
31struct Q_LOCATION_EXPORT Frustum
32{
33 QDoubleVector3D apex;
34 QDoubleVector3D topLeftNear;
35 QDoubleVector3D topLeftFar;
36 QDoubleVector3D topRightNear;
37 QDoubleVector3D topRightFar;
38 QDoubleVector3D bottomLeftNear;
39 QDoubleVector3D bottomLeftFar;
40 QDoubleVector3D bottomRightNear;
41 QDoubleVector3D bottomRightFar;
42};
43
45
46class Q_LOCATION_EXPORT QGeoCameraTilesPrivate
47{
48public:
49 struct ClippedFootprint
50 {
51 ClippedFootprint()
52 {}
53 ClippedFootprint(const PolygonVector &left_, const PolygonVector &mid_, const PolygonVector &right_)
54 : left(left_), mid(mid_), right(right_)
55 {}
56 PolygonVector left;
57 PolygonVector mid;
58 PolygonVector right;
59 };
60
61 struct TileMap
62 {
63 TileMap();
64
65 void add(int tileX, int tileY);
66
67 QMap<int, QPair<int, int> > data;
68 };
69
70 void updateMetadata();
71 void updateGeometry();
72
73 Frustum createFrustum(double viewExpansion) const;
74 PolygonVector frustumFootprint(const Frustum &frustum) const;
75
76 QPair<PolygonVector, PolygonVector> splitPolygonAtAxisValue(const PolygonVector &polygon, int axis, double value) const;
77 ClippedFootprint clipFootprintToMap(const PolygonVector &footprint) const;
78
79 QList<QPair<double, int> > tileIntersections(double p1, int t1, double p2, int t2) const;
80 QSet<QGeoTileSpec> tilesFromPolygon(const PolygonVector &polygon) const;
81
82 static QGeoCameraTilesPrivate *get(QGeoCameraTiles *o) {
83 return o->d_ptr.get();
84 }
85
86public:
87 QString m_pluginString;
88 QGeoMapType m_mapType;
89 int m_mapVersion = -1;
90 QGeoCameraData m_camera;
91 QSize m_screenSize;
92 QRectF m_visibleArea;
93 int m_tileSize = 0;
94 QSet<QGeoTileSpec> m_tiles;
95
96 int m_intZoomLevel = 0;
97 int m_sideLength = 0;
98 bool m_dirtyGeometry = false;
99 bool m_dirtyMetadata = false;
100 double m_viewExpansion = 1.0;
101
102#ifdef QT_LOCATION_DEBUG
103 // updateGeometry
104 ClippedFootprint m_clippedFootprint;
105 PolygonVector m_frustumFootprint;
106 Frustum m_frustum;
107
108 // createFrustum
109 mutable QDoubleVector3D m_createFrustum_center;
110 mutable QDoubleVector3D m_createFrustum_eye;
111#endif
112};
113
114QT_END_NAMESPACE
115
116#endif // QGEOCAMERATILES_P_P_H
static QDoubleVector3D toDoubleVector3D(const QVector3D &in)
static bool appendZIntersects(const QDoubleVector3D &start, const QDoubleVector3D &end, double z, QList< QDoubleVector3D > &results)
static QVector3D toVector3D(const QDoubleVector3D &in)
static void addXOffset(PolygonVector &footprint, double xoff)
QList< QDoubleVector3D > PolygonVector