diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-07-11 15:55:27 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-08-04 11:19:14 +0000 |
commit | 92d8e4dc93400250b47f8dbe96ec7e2f748d8d4b (patch) | |
tree | 0545f115d23f74be1979ec483a63f19bbc9b1d55 /src/positioning/qgeopath_p.h | |
parent | 4511bc9b9bc85a0021ce59feab1a28c711dec691 (diff) | |
download | qtlocation-92d8e4dc93400250b47f8dbe96ec7e2f748d8d4b.tar.gz |
Add QGeoPolygon to QtPositioning
This patch introduces a new QGeoShape, QGeoPolygon, together
with helper functions in the location singleton (QtPositioning.*)
to create and convert geopolygons from QML.
[ChangeLog][QtPositioning][QGeoPolygon] Added QGeoPolygon shape.
Change-Id: I111c576d7428f2a953f0459d16c25eea7ab2bd7c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/positioning/qgeopath_p.h')
-rw-r--r-- | src/positioning/qgeopath_p.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/positioning/qgeopath_p.h b/src/positioning/qgeopath_p.h index 48334017..3eceff24 100644 --- a/src/positioning/qgeopath_p.h +++ b/src/positioning/qgeopath_p.h @@ -54,6 +54,7 @@ #include "qgeoshape_p.h" #include "qgeocoordinate.h" #include "qlocationutils_p.h" +#include <QtPositioning/private/qclipperutils_p.h> #include <QtCore/QVector> @@ -62,14 +63,16 @@ QT_BEGIN_NAMESPACE class QGeoPathPrivate : public QGeoShapePrivate { public: - QGeoPathPrivate(); - QGeoPathPrivate(const QList<QGeoCoordinate> &path, const qreal width = 0.0); + QGeoPathPrivate(QGeoShape::ShapeType type); + QGeoPathPrivate(QGeoShape::ShapeType type, const QList<QGeoCoordinate> &path, const qreal width = 0.0); QGeoPathPrivate(const QGeoPathPrivate &other); ~QGeoPathPrivate(); bool isValid() const Q_DECL_OVERRIDE; bool isEmpty() const Q_DECL_OVERRIDE; bool contains(const QGeoCoordinate &coordinate) const Q_DECL_OVERRIDE; + bool lineContains(const QGeoCoordinate &coordinate) const; + bool polygonContains(const QGeoCoordinate &coordinate) const; QGeoCoordinate center() const Q_DECL_OVERRIDE; QGeoRectangle boundingGeoRectangle() const Q_DECL_OVERRIDE; @@ -95,7 +98,7 @@ public: void removeCoordinate(int index); void computeBoundingBox(); void updateBoundingBox(); - + void updateClipperPath(); QList<QGeoCoordinate> m_path; QVector<double> m_deltaXs; // longitude deltas from m_path[0] @@ -105,6 +108,8 @@ public: double m_maxLati; // minimum latitude. paths do not wrap around through the poles QGeoRectangle m_bbox; qreal m_width; + bool m_clipperDirty; + QtClipperLib::Path m_clipperPath; }; QT_END_NAMESPACE |