diff options
author | Aaron McCarthy <mccarthy.aaron@gmail.com> | 2014-07-28 09:57:04 +1000 |
---|---|---|
committer | Aaron McCarthy <mccarthy.aaron@gmail.com> | 2014-12-04 05:31:54 +0100 |
commit | b8681cdb51cc5d7040ecbe08b014bace2444c6f1 (patch) | |
tree | ebfe6a4e4cbbf178b1df2339abf91f7b4c84a2cf /src/positioning/qgeocircle_p.h | |
parent | fddb7c51231e1649081de3a1d5f2ad191e9cd7dc (diff) | |
download | qtlocation-b8681cdb51cc5d7040ecbe08b014bace2444c6f1.tar.gz |
Add center() function to QGeoShape.
It is frequently useful to calculate the geometric center of a shape.
Both QGeoCircle and QGeoRectangle already define center() functions,
however, the application developer must cast each QGeoShape into either
a QGeoCirlce or QGeoRectangle before calling. Providing
QGeoShape::center() allows application code to be simplified.
Existing QGeoCircle::center() and QGeoRectangle::center() functions are
kept for compatibility.
Change-Id: I92b727ab5e713f70174588a27040446c992ae14e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/positioning/qgeocircle_p.h')
-rw-r--r-- | src/positioning/qgeocircle_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/positioning/qgeocircle_p.h b/src/positioning/qgeocircle_p.h index d6fe37b5..635bd2ec 100644 --- a/src/positioning/qgeocircle_p.h +++ b/src/positioning/qgeocircle_p.h @@ -62,13 +62,15 @@ public: bool isEmpty() const; bool contains(const QGeoCoordinate &coordinate) const; + QGeoCoordinate center() const Q_DECL_OVERRIDE; + void extendShape(const QGeoCoordinate &coordinate); QGeoShapePrivate *clone() const; bool operator==(const QGeoShapePrivate &other) const; - QGeoCoordinate center; + QGeoCoordinate m_center; qreal radius; }; |