Qt 6.x
The Qt SDK
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_PRIVATE_EXPORT QGeoPolygonPrivate : public QGeoPathPrivate
25{
26public:
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;
55};
56
57class Q_POSITIONING_PRIVATE_EXPORT QGeoPolygonPrivateEager : public QGeoPolygonPrivate
58{
59public:
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_PRIVATE_EXPORT QGeoPolygonEager : public QGeoPolygon
88{
90public:
91
97};
98
100
101#endif // QGEOPOLYGON_P_H
\inmodule QtPositioning
virtual bool contains(const QGeoCoordinate &coordinate) const override
Definition qgeopath.cpp:468
virtual void translate(double degreesLatitude, double degreesLongitude)
Definition qgeopath.cpp:521
virtual void addCoordinate(const QGeoCoordinate &coordinate)
Definition qgeopath.cpp:569
virtual void markDirty()
Definition qgeopath.cpp:607
virtual QGeoShapePrivate * clone() const override
Definition qgeopath.cpp:362
virtual bool isValid() const override
Definition qgeopath.cpp:367
virtual void computeBoundingBox()
Definition qgeopath.cpp:612
virtual bool operator==(const QGeoShapePrivate &other) const override
Definition qgeopath.cpp:382
QList< double > m_deltaXs
QClipperUtils m_clipperWrapper
QList< QList< QGeoCoordinate > > m_holesList
\inmodule QtPositioning
Definition qgeopolygon.h:16
\inmodule QtPositioning
Definition qgeoshape.h:17
Definition qlist.h:74
QHash< int, QWidget * > hash
[35multi]
Combined button and popup list for selecting options.
GLuint index
[2]
GLsizei const GLchar *const * path
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define Q_GADGET
ptrdiff_t qsizetype
Definition qtypes.h:70
QSharedPointer< T > other(t)
[5]