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
qgeopolygon_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
4#ifndef QGEOPOLYGON_P_H
5#define QGEOPOLYGON_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtPositioning/private/qgeopath_p.h>
19#include <QtPositioning/qgeopolygon.h>
20#include <QtPositioning/private/qclipperutils_p.h>
21
23
24class Q_POSITIONING_EXPORT QGeoPolygonPrivate : public QGeoPathPrivate
25{
26public:
28 QGeoPolygonPrivate(const QList<QGeoCoordinate> &path);
30
31// QGeoShape API
32 virtual QGeoShapePrivate *clone() const override;
33 virtual bool isValid() const override;
34 virtual bool contains(const QGeoCoordinate &coordinate) const override;
35 virtual void translate(double degreesLatitude, double degreesLongitude) override;
36 virtual bool operator==(const QGeoShapePrivate &other) const override;
37 size_t hash(size_t seed) const override;
38
39// QGeoPath API
40 virtual void markDirty() override;
41
42// QGeoPolygonPrivate API
43 qsizetype holesCount() const;
44 bool polygonContains(const QGeoCoordinate &coordinate) const;
45 const QList<QGeoCoordinate> holePath(qsizetype index) const;
46
47 virtual void addHole(const QList<QGeoCoordinate> &holePath);
48 virtual void removeHole(qsizetype index);
49 virtual void updateClipperPath();
50
51// data members
52 bool m_clipperDirty = true;
53 QList<QList<QGeoCoordinate>> m_holesList;
55};
56
57class Q_POSITIONING_EXPORT QGeoPolygonPrivateEager : public QGeoPolygonPrivate
58{
59public:
61 QGeoPolygonPrivateEager(const QList<QGeoCoordinate> &path);
63
64// QGeoShape API
65 virtual QGeoShapePrivate *clone() const override;
66 virtual void translate(double degreesLatitude, double degreesLongitude) override;
67
68// QGeoPath API
69 virtual void markDirty() override;
70 virtual void addCoordinate(const QGeoCoordinate &coordinate) override;
71 virtual void computeBoundingBox() override;
72
73// QGeoPolygonPrivate API
74
75// *Eager API
76 void updateBoundingBox();
77
78// data members
79 QList<double> m_deltaXs; // longitude deltas from m_path[0]
80 double m_minX = 0; // minimum value inside deltaXs
81 double m_maxX = 0; // maximum value inside deltaXs
82 double m_minLati = 0; // minimum latitude. paths do not wrap around through the poles
83 double m_maxLati = 0; // minimum latitude. paths do not wrap around through the poles
84};
85
86// This is a mean of creating a QGeoPolygonPrivateEager and injecting it into QGeoPolygons via operator=
87class Q_POSITIONING_EXPORT QGeoPolygonEager : public QGeoPolygon
88{
90public:
91
93 QGeoPolygonEager(const QList<QGeoCoordinate> &path);
97};
98
100
101#endif // QGEOPOLYGON_P_H
\inmodule QtPositioning
QList< double > m_deltaXs
QClipperUtils m_clipperWrapper
QList< QList< QGeoCoordinate > > m_holesList
\inmodule QtPositioning
Definition qgeopolygon.h:16
\inmodule QtPositioning
Definition qgeoshape.h:17
QHash< int, QWidget * > hash
[35multi]
Combined button and popup list for selecting options.
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLuint index
[2]
GLsizei const GLchar *const * path
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
#define Q_GADGET
ptrdiff_t qsizetype
Definition qtypes.h:165
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)
QSharedPointer< T > other(t)
[5]