summaryrefslogtreecommitdiff
path: root/src/positioning/qgeoshape.h
diff options
context:
space:
mode:
authorAaron McCarthy <mccarthy.aaron@gmail.com>2014-07-28 09:57:04 +1000
committerAaron McCarthy <mccarthy.aaron@gmail.com>2014-12-04 05:31:54 +0100
commitb8681cdb51cc5d7040ecbe08b014bace2444c6f1 (patch)
treeebfe6a4e4cbbf178b1df2339abf91f7b4c84a2cf /src/positioning/qgeoshape.h
parentfddb7c51231e1649081de3a1d5f2ad191e9cd7dc (diff)
downloadqtlocation-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/qgeoshape.h')
-rw-r--r--src/positioning/qgeoshape.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/positioning/qgeoshape.h b/src/positioning/qgeoshape.h
index 3704ba6a..edaf263f 100644
--- a/src/positioning/qgeoshape.h
+++ b/src/positioning/qgeoshape.h
@@ -61,6 +61,8 @@ public:
bool isEmpty() const;
bool contains(const QGeoCoordinate &coordinate) const;
+ QGeoCoordinate center() const;
+
void extendShape(const QGeoCoordinate &coordinate);
bool operator==(const QGeoShape &other) const;