summaryrefslogtreecommitdiffstats
path: root/src/location
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2012-06-19 12:55:53 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-21 04:09:32 +0200
commit6b68304f59de5fa3f6c861186d98b0c7fe54a4ba (patch)
tree1d94a6db5a3ad399149e44510a86c008c58814f2 /src/location
parent4b10442e2e83bf7440837e469af344579d1ad9d5 (diff)
Rename QGeoBoundingArea and related classes to QGeoShape.
QGeoBoundingArea is used for describing more than just a bounding area. Renaming it to a more appropriate name, QGeoShape. The same is done for subclasses and QML equivalents. In C++: QGeoBoundingArea -> QGeoShape QGeoBoundingCircle -> QGeoCircle QGeoBoundingBox -> QGeoRectangle In QML: BoundingArea -> GeoShape BoundingCircle -> GeoCircle BoundingBox -> GeoRectangle Change-Id: I93c6df8f1b6c5179ed52fd8354a05f709063b1cf Reviewed-by: abcd <amos.choy@nokia.com>
Diffstat (limited to 'src/location')
-rw-r--r--src/location/location.pro21
-rw-r--r--src/location/maps/qgeocodereply.cpp4
-rw-r--r--src/location/maps/qgeocodereply.h16
-rw-r--r--src/location/maps/qgeocodereply_p.h4
-rw-r--r--src/location/maps/qgeocodingmanager.cpp16
-rw-r--r--src/location/maps/qgeocodingmanager.h8
-rw-r--r--src/location/maps/qgeocodingmanagerengine.cpp14
-rw-r--r--src/location/maps/qgeocodingmanagerengine.h24
-rw-r--r--src/location/maps/qgeomappingmanager_p.h2
-rw-r--r--src/location/maps/qgeomappingmanagerengine_p.h2
-rw-r--r--src/location/maps/qgeoroute.cpp6
-rw-r--r--src/location/maps/qgeoroute.h6
-rw-r--r--src/location/maps/qgeoroute_p.h4
-rw-r--r--src/location/maps/qgeorouterequest.cpp6
-rw-r--r--src/location/maps/qgeorouterequest.h6
-rw-r--r--src/location/maps/qgeorouterequest_p.h2
-rw-r--r--src/location/places/qplace.h2
-rw-r--r--src/location/places/qplace_p.h2
-rw-r--r--src/location/places/qplacesearchrequest.cpp17
-rw-r--r--src/location/places/qplacesearchrequest.h6
-rw-r--r--src/location/qgeoboundingcircle.cpp320
-rw-r--r--src/location/qgeocircle.cpp311
-rw-r--r--src/location/qgeocircle.h (renamed from src/location/qgeoboundingcircle.h)50
-rw-r--r--src/location/qgeocircle_p.h (renamed from src/location/qgeoboundingcircle_p.h)20
-rw-r--r--src/location/qgeolocation.cpp4
-rw-r--r--src/location/qgeolocation.h19
-rw-r--r--src/location/qgeolocation_p.h7
-rw-r--r--src/location/qgeorectangle.cpp (renamed from src/location/qgeoboundingbox.cpp)350
-rw-r--r--src/location/qgeorectangle.h (renamed from src/location/qgeoboundingbox.h)66
-rw-r--r--src/location/qgeorectangle_p.h (renamed from src/location/qgeoboundingbox_p.h)20
-rw-r--r--src/location/qgeoshape.cpp (renamed from src/location/qgeoboundingarea.cpp)94
-rw-r--r--src/location/qgeoshape.h (renamed from src/location/qgeoboundingarea.h)39
-rw-r--r--src/location/qgeoshape_p.h (renamed from src/location/qgeoboundingarea_p.h)23
33 files changed, 734 insertions, 757 deletions
diff --git a/src/location/location.pro b/src/location/location.pro
index 45fe54d7..7d76f851 100644
--- a/src/location/location.pro
+++ b/src/location/location.pro
@@ -21,9 +21,9 @@ include(places/places.pri)
PUBLIC_HEADERS += \
qgeoaddress.h \
qgeoareamonitor.h \
- qgeoboundingarea.h \
- qgeoboundingbox.h \
- qgeoboundingcircle.h \
+ qgeoshape.h \
+ qgeorectangle.h \
+ qgeocircle.h \
qgeocoordinate.h \
qgeolocation.h \
qgeopositioninfo.h \
@@ -37,9 +37,9 @@ PUBLIC_HEADERS += \
PRIVATE_HEADERS += \
qgeoaddress_p.h \
- qgeoboundingarea_p.h \
- qgeoboundingbox_p.h \
- qgeoboundingcircle_p.h \
+ qgeoshape_p.h \
+ qgeorectangle_p.h \
+ qgeocircle_p.h \
qgeolocation_p.h \
qlocationutils_p.h \
qnmeapositioninfosource_p.h \
@@ -52,9 +52,9 @@ HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
SOURCES += \
qgeoaddress.cpp \
qgeoareamonitor.cpp \
- qgeoboundingarea.cpp \
- qgeoboundingbox.cpp \
- qgeoboundingcircle.cpp \
+ qgeoshape.cpp \
+ qgeorectangle.cpp \
+ qgeocircle.cpp \
qgeocoordinate.cpp \
qgeolocation.cpp \
qgeopositioninfo.cpp \
@@ -65,5 +65,4 @@ SOURCES += \
qnmeapositioninfosource.cpp \
qgeoareamonitor_polling.cpp \
qgeopositioninfosourcefactory.cpp \
- qtlocation.cpp
-
+ qtlocation.cpp \
diff --git a/src/location/maps/qgeocodereply.cpp b/src/location/maps/qgeocodereply.cpp
index f8b1fb23..c388c61d 100644
--- a/src/location/maps/qgeocodereply.cpp
+++ b/src/location/maps/qgeocodereply.cpp
@@ -186,7 +186,7 @@ QString QGeocodeReply::errorString() const
/*!
Sets the viewport which contains the results to \a viewport.
*/
-void QGeocodeReply::setViewport(const QGeoBoundingArea &viewport)
+void QGeocodeReply::setViewport(const QGeoShape &viewport)
{
d_ptr->viewport = viewport;
}
@@ -197,7 +197,7 @@ void QGeocodeReply::setViewport(const QGeoBoundingArea &viewport)
This function will return 0 if no viewport bias
was specified in the QGeocodingManager function which created this reply.
*/
-QGeoBoundingArea QGeocodeReply::viewport() const
+QGeoShape QGeocodeReply::viewport() const
{
return d_ptr->viewport;
}
diff --git a/src/location/maps/qgeocodereply.h b/src/location/maps/qgeocodereply.h
index 5a988cb4..a9a2cf9b 100644
--- a/src/location/maps/qgeocodereply.h
+++ b/src/location/maps/qgeocodereply.h
@@ -42,17 +42,15 @@
#ifndef QGEOCODEREPLY_H
#define QGEOCODEREPLY_H
-#include "qgeolocation.h"
-
-#include <QObject>
-#include <QList>
+#include <QtCore/QObject>
+#include <QtCore/QList>
+#include <QtLocation/QGeoLocation>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
-
+class QGeoShape;
class QGeocodeReplyPrivate;
class Q_LOCATION_EXPORT QGeocodeReply : public QObject
@@ -77,8 +75,8 @@ public:
Error error() const;
QString errorString() const;
- QGeoBoundingArea viewport() const;
- QList<QGeoLocation>locations() const;
+ QGeoShape viewport() const;
+ QList<QGeoLocation> locations() const;
int limit() const;
int offset() const;
@@ -95,7 +93,7 @@ protected:
void setError(Error error, const QString &errorString);
void setFinished(bool finished);
- void setViewport(const QGeoBoundingArea &viewport);
+ void setViewport(const QGeoShape &viewport);
void addLocation(const QGeoLocation &location);
void setLocations(const QList<QGeoLocation> &locations);
diff --git a/src/location/maps/qgeocodereply_p.h b/src/location/maps/qgeocodereply_p.h
index 3e32ddd4..9d274925 100644
--- a/src/location/maps/qgeocodereply_p.h
+++ b/src/location/maps/qgeocodereply_p.h
@@ -55,7 +55,7 @@
#include "qgeocodereply.h"
-#include "qgeoboundingarea.h"
+#include "qgeoshape.h"
#include <QList>
@@ -74,7 +74,7 @@ public:
QString errorString;
bool isFinished;
- QGeoBoundingArea viewport;
+ QGeoShape viewport;
QList<QGeoLocation> locations;
int limit;
diff --git a/src/location/maps/qgeocodingmanager.cpp b/src/location/maps/qgeocodingmanager.cpp
index 3208bf44..3d7c1a07 100644
--- a/src/location/maps/qgeocodingmanager.cpp
+++ b/src/location/maps/qgeocodingmanager.cpp
@@ -43,8 +43,8 @@
#include "qgeocodingmanager_p.h"
#include "qgeocodingmanagerengine.h"
-#include "qgeoboundingbox.h"
-#include "qgeoboundingcircle.h"
+#include "qgeorectangle.h"
+#include "qgeocircle.h"
#include <QLocale>
@@ -163,7 +163,7 @@ int QGeocodingManager::managerVersion() const
This will usually occur if the geocoding service backend uses a different
canonical form of addresses or if \a address was only partially filled out.
- If \a bounds is non-null and valid QGeoBoundingArea it will be used to
+ If \a bounds is non-null and is a valid QGeoShape it will be used to
limit the results to those that are contained within \a bounds. This is
particularly useful if \a address is only partially filled out, as the
service will attempt to geocode all matches for the specified data.
@@ -173,7 +173,7 @@ int QGeocodingManager::managerVersion() const
QGeocodingManager::error(), QGeocodeReply::finished() or
QGeocodeReply::error() with deleteLater().
*/
-QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeoBoundingArea &bounds)
+QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeoShape &bounds)
{
// if (!d_ptr->engine)
// return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this);
@@ -210,7 +210,7 @@ QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeo
As an example, some services will return address and coordinate pairs for
the street address, the city, the state and the country.
- If \a bounds is non-null and a valid QGeoBoundingBox it will be used to
+ If \a bounds is non-null and a valid QGeoRectangle it will be used to
limit the results to those that are contained within \a bounds.
The user is responsible for deleting the returned reply object, although
@@ -218,7 +218,7 @@ QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeo
QGeocodingManager::error(), QGeocodeReply::finished() or
QGeocodeReply::error() with deleteLater().
*/
-QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoBoundingArea &bounds)
+QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds)
{
// if (!d_ptr->engine)
// return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this);
@@ -247,7 +247,7 @@ QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinat
The \a limit and \a offset results are used together to implement paging.
- If \a bounds is non-null and a valid QGeoBoundingArea it will be used to
+ If \a bounds is non-null and a valid QGeoShape it will be used to
limit the results to those that are contained within \a bounds.
The user is responsible for deleting the returned reply object, although
@@ -258,7 +258,7 @@ QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinat
QGeocodeReply *QGeocodingManager::geocode(const QString &address,
int limit,
int offset,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
// if (!d_ptr->engine)
// return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this);
diff --git a/src/location/maps/qgeocodingmanager.h b/src/location/maps/qgeocodingmanager.h
index b5ef6abb..bb10ac1d 100644
--- a/src/location/maps/qgeocodingmanager.h
+++ b/src/location/maps/qgeocodingmanager.h
@@ -43,7 +43,7 @@
#define QGEOCODINGMANAGER_H
#include "qgeocodereply.h"
-#include "qgeoboundingbox.h"
+#include "qgeorectangle.h"
#include <QObject>
#include <QList>
@@ -70,14 +70,14 @@ public:
int managerVersion() const;
QGeocodeReply *geocode(const QGeoAddress &address,
- const QGeoBoundingArea &bounds = QGeoBoundingArea());
+ const QGeoShape &bounds = QGeoShape());
QGeocodeReply *geocode(const QString &searchString,
int limit = -1,
int offset = 0,
- const QGeoBoundingArea &bounds = QGeoBoundingArea());
+ const QGeoShape &bounds = QGeoShape());
QGeocodeReply *reverseGeocode(const QGeoCoordinate &coordinate,
- const QGeoBoundingArea &bounds = QGeoBoundingArea());
+ const QGeoShape &bounds = QGeoShape());
void setLocale(const QLocale &locale);
QLocale locale() const;
diff --git a/src/location/maps/qgeocodingmanagerengine.cpp b/src/location/maps/qgeocodingmanagerengine.cpp
index eef080cb..737cc58e 100644
--- a/src/location/maps/qgeocodingmanagerengine.cpp
+++ b/src/location/maps/qgeocodingmanagerengine.cpp
@@ -45,6 +45,8 @@
#include "qgeoaddress.h"
#include "qgeocoordinate.h"
+#include <QtLocation/QGeoShape>
+
QT_BEGIN_NAMESPACE
/*!
@@ -164,7 +166,7 @@ int QGeocodingManagerEngine::managerVersion() const
This will usually occur if the geocoding service backend uses a different
canonical form of addresses or if \a address was only partially filled out.
- If \a bounds is non-null and a valid QGeoBoundingArea it will be used to
+ If \a bounds is non-null and a valid QGeoShape it will be used to
limit the results to those that are contained by \a bounds. This is
particularly useful if \a address is only partially filled out, as the
service will attempt to geocode all matches for the specified data.
@@ -175,7 +177,7 @@ int QGeocodingManagerEngine::managerVersion() const
QGeocodeReply::error() with deleteLater().
*/
QGeocodeReply *QGeocodingManagerEngine::geocode(const QGeoAddress &address,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
Q_UNUSED(address)
Q_UNUSED(bounds)
@@ -211,7 +213,7 @@ QGeocodeReply *QGeocodingManagerEngine::geocode(const QGeoAddress &address,
As an example, some services will return address and coordinate pairs for
the street address, the city, the state and the country.
- If \a bounds is non-null and a valid QGeoBoundingArea it will be used to
+ If \a bounds is non-null and a valid QGeoShape it will be used to
limit the results to those that are contained by \a bounds.
The user is responsible for deleting the returned reply object, although
@@ -220,7 +222,7 @@ QGeocodeReply *QGeocodingManagerEngine::geocode(const QGeoAddress &address,
QGeocodeReply::error() with deleteLater().
*/
QGeocodeReply *QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coordinate,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
Q_UNUSED(coordinate)
Q_UNUSED(bounds)
@@ -249,7 +251,7 @@ QGeocodeReply *QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coo
The \a limit and \a offset results are used together to implement paging.
- If \a bounds is non-null and a valid QGeoBoundingArea it will be used to
+ If \a bounds is non-null and a valid QGeoShape it will be used to
limit the results to those that are contained by \a bounds.
The user is responsible for deleting the returned reply object, although
@@ -260,7 +262,7 @@ QGeocodeReply *QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coo
QGeocodeReply *QGeocodingManagerEngine::geocode(const QString &address,
int limit,
int offset,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
Q_UNUSED(address)
Q_UNUSED(limit)
diff --git a/src/location/maps/qgeocodingmanagerengine.h b/src/location/maps/qgeocodingmanagerengine.h
index 64f560bf..5916fcda 100644
--- a/src/location/maps/qgeocodingmanagerengine.h
+++ b/src/location/maps/qgeocodingmanagerengine.h
@@ -42,19 +42,16 @@
#ifndef QGEOCODINGMANAGERENGINE_H
#define QGEOCODINGMANAGERENGINE_H
-#include "qgeocodingmanager.h"
-#include "qgeocodereply.h"
-#include "qgeoboundingbox.h"
-
-#include <QObject>
-#include <QList>
+#include <QtCore/QObject>
+#include <QtLocation/qlocationglobal.h>
+#include <QtLocation/QGeocodeReply>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
-
+class QGeoAddress;
+class QGeoShape;
class QGeocodingManagerEnginePrivate;
class Q_LOCATION_EXPORT QGeocodingManagerEngine : public QObject
@@ -67,14 +64,13 @@ public:
QString managerName() const;
int managerVersion() const;
- virtual QGeocodeReply *geocode(const QGeoAddress &address,
- const QGeoBoundingArea &bounds);
+ virtual QGeocodeReply *geocode(const QGeoAddress &address, const QGeoShape &bounds);
virtual QGeocodeReply *geocode(const QString &address,
- int limit,
- int offset,
- const QGeoBoundingArea &bounds);
+ int limit,
+ int offset,
+ const QGeoShape &bounds);
virtual QGeocodeReply *reverseGeocode(const QGeoCoordinate &coordinate,
- const QGeoBoundingArea &bounds);
+ const QGeoShape &bounds);
void setLocale(const QLocale &locale);
diff --git a/src/location/maps/qgeomappingmanager_p.h b/src/location/maps/qgeomappingmanager_p.h
index 2b04a0e7..63dd1f67 100644
--- a/src/location/maps/qgeomappingmanager_p.h
+++ b/src/location/maps/qgeomappingmanager_p.h
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QGeoMap;
class QLocale;
-class QGeoBoundingBox;
+class QGeoRectangle;
class QGeoCoordinate;
class QGeoMappingManagerPrivate;
class QGeoMapRequestOptions;
diff --git a/src/location/maps/qgeomappingmanagerengine_p.h b/src/location/maps/qgeomappingmanagerengine_p.h
index bb9f2471..495014bf 100644
--- a/src/location/maps/qgeomappingmanagerengine_p.h
+++ b/src/location/maps/qgeomappingmanagerengine_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
class QLocale;
-class QGeoBoundingBox;
+class QGeoRectangle;
class QGeoCoordinate;
class QGeoMappingManagerPrivate;
class QGeoMapRequestOptions;
diff --git a/src/location/maps/qgeoroute.cpp b/src/location/maps/qgeoroute.cpp
index 6614f7bc..9ec86133 100644
--- a/src/location/maps/qgeoroute.cpp
+++ b/src/location/maps/qgeoroute.cpp
@@ -42,7 +42,7 @@
#include "qgeoroute.h"
#include "qgeoroute_p.h"
-#include "qgeoboundingbox.h"
+#include "qgeorectangle.h"
#include "qgeoroutesegment.h"
#include <QDateTime>
@@ -165,7 +165,7 @@ QGeoRouteRequest QGeoRoute::request() const
/*!
Sets the bounding box which encompasses the entire route to \a bounds.
*/
-void QGeoRoute::setBounds(const QGeoBoundingBox &bounds)
+void QGeoRoute::setBounds(const QGeoRectangle &bounds)
{
d_ptr->bounds = bounds;
}
@@ -173,7 +173,7 @@ void QGeoRoute::setBounds(const QGeoBoundingBox &bounds)
/*!
Returns a bounding box which encompasses the entire route.
*/
-QGeoBoundingBox QGeoRoute::bounds() const
+QGeoRectangle QGeoRoute::bounds() const
{
return d_ptr->bounds;
}
diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h
index ea4d4cb1..d43debe7 100644
--- a/src/location/maps/qgeoroute.h
+++ b/src/location/maps/qgeoroute.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
-class QGeoBoundingBox;
+class QGeoRectangle;
class QGeoRouteSegment;
class QGeoRoutePrivate;
@@ -78,8 +78,8 @@ public:
void setRequest(const QGeoRouteRequest &request);
QGeoRouteRequest request() const;
- void setBounds(const QGeoBoundingBox &bounds);
- QGeoBoundingBox bounds() const;
+ void setBounds(const QGeoRectangle &bounds);
+ QGeoRectangle bounds() const;
void setFirstRouteSegment(const QGeoRouteSegment &routeSegment);
QGeoRouteSegment firstRouteSegment() const;
diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h
index fbeaf84d..d0495e35 100644
--- a/src/location/maps/qgeoroute_p.h
+++ b/src/location/maps/qgeoroute_p.h
@@ -55,7 +55,7 @@
#include "qgeoroute.h"
#include "qgeorouterequest.h"
-#include "qgeoboundingbox.h"
+#include "qgeorectangle.h"
#include "qgeoroutesegment.h"
#include <QSharedData>
@@ -76,7 +76,7 @@ public:
QString id;
QGeoRouteRequest request;
- QGeoBoundingBox bounds;
+ QGeoRectangle bounds;
// QList<QGeoRouteSegment> routeSegments;
int travelTime;
diff --git a/src/location/maps/qgeorouterequest.cpp b/src/location/maps/qgeorouterequest.cpp
index 26ae244b..4866aa31 100644
--- a/src/location/maps/qgeorouterequest.cpp
+++ b/src/location/maps/qgeorouterequest.cpp
@@ -43,7 +43,7 @@
#include "qgeorouterequest_p.h"
#include "qgeocoordinate.h"
-#include "qgeoboundingbox.h"
+#include "qgeorectangle.h"
QT_BEGIN_NAMESPACE
@@ -304,7 +304,7 @@ QList<QGeoCoordinate> QGeoRouteRequest::waypoints() const
/*!
Sets \a areas as excluded areas that the route must not cross.
*/
-void QGeoRouteRequest::setExcludeAreas(const QList<QGeoBoundingBox> &areas)
+void QGeoRouteRequest::setExcludeAreas(const QList<QGeoRectangle> &areas)
{
d_ptr->excludeAreas = areas;
}
@@ -312,7 +312,7 @@ void QGeoRouteRequest::setExcludeAreas(const QList<QGeoBoundingBox> &areas)
/*!
Returns areas the route must not cross.
*/
-QList<QGeoBoundingBox> QGeoRouteRequest::excludeAreas() const
+QList<QGeoRectangle> QGeoRouteRequest::excludeAreas() const
{
return d_ptr->excludeAreas;
}
diff --git a/src/location/maps/qgeorouterequest.h b/src/location/maps/qgeorouterequest.h
index c903183a..7f3dee78 100644
--- a/src/location/maps/qgeorouterequest.h
+++ b/src/location/maps/qgeorouterequest.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
class QGeoCoordinate;
-class QGeoBoundingBox;
+class QGeoRectangle;
class QGeoRouteRequestPrivate;
class Q_LOCATION_EXPORT QGeoRouteRequest
@@ -127,8 +127,8 @@ public:
void setWaypoints(const QList<QGeoCoordinate> &waypoints);
QList<QGeoCoordinate> waypoints() const;
- void setExcludeAreas(const QList<QGeoBoundingBox> &areas);
- QList<QGeoBoundingBox> excludeAreas() const;
+ void setExcludeAreas(const QList<QGeoRectangle> &areas);
+ QList<QGeoRectangle> excludeAreas() const;
// defaults to 0
void setNumberAlternativeRoutes(int alternatives);
diff --git a/src/location/maps/qgeorouterequest_p.h b/src/location/maps/qgeorouterequest_p.h
index 762384de..535fae22 100644
--- a/src/location/maps/qgeorouterequest_p.h
+++ b/src/location/maps/qgeorouterequest_p.h
@@ -72,7 +72,7 @@ public:
bool operator ==(const QGeoRouteRequestPrivate &other) const;
QList<QGeoCoordinate> waypoints;
- QList<QGeoBoundingBox> excludeAreas;
+ QList<QGeoRectangle> excludeAreas;
int numberAlternativeRoutes;
QGeoRouteRequest::TravelModes travelModes;
QMap < QGeoRouteRequest::FeatureType,
diff --git a/src/location/places/qplace.h b/src/location/places/qplace.h
index 9ab0a5ec..ac08c5c9 100644
--- a/src/location/places/qplace.h
+++ b/src/location/places/qplace.h
@@ -46,7 +46,7 @@
#include <QtLocation/qtlocation.h>
#include "qgeoaddress.h"
-#include "qgeoboundingbox.h"
+#include "qgeorectangle.h"
#include "qgeocoordinate.h"
#include "qgeolocation.h"
#include "qplacecategory.h"
diff --git a/src/location/places/qplace_p.h b/src/location/places/qplace_p.h
index 4e50552a..411f06f9 100644
--- a/src/location/places/qplace_p.h
+++ b/src/location/places/qplace_p.h
@@ -58,7 +58,7 @@
#include "qplace.h"
#include "qgeoaddress.h"
-#include "qgeoboundingbox.h"
+#include "qgeorectangle.h"
#include "qgeocoordinate.h"
#include "qplacesupplier.h"
#include <QtLocation/QPlaceIcon>
diff --git a/src/location/places/qplacesearchrequest.cpp b/src/location/places/qplacesearchrequest.cpp
index 9a120e2f..fbd56f65 100644
--- a/src/location/places/qplacesearchrequest.cpp
+++ b/src/location/places/qplacesearchrequest.cpp
@@ -41,7 +41,7 @@
#include "qplacesearchrequest.h"
#include "qgeocoordinate.h"
-#include "qgeoboundingarea.h"
+#include "qgeoshape.h"
#include <QtCore/QSharedData>
#include <QtCore/QList>
@@ -62,7 +62,7 @@ public:
QString searchTerm;
QList<QPlaceCategory> categories;
- QGeoBoundingArea searchArea;
+ QGeoShape searchArea;
int dymNumber;
QtLocation::VisibilityScope visibilityScope;
QPlaceSearchRequest::RelevanceHint relevanceHint;
@@ -128,7 +128,7 @@ void QPlaceSearchRequestPrivate::clear()
offset = 0;
searchTerm.clear();
categories.clear();
- searchArea = QGeoBoundingArea();
+ searchArea = QGeoShape();
dymNumber = 0;
visibilityScope = QtLocation::UnspecifiedVisibility;
relevanceHint = QPlaceSearchRequest::UnspecifiedHint;
@@ -150,9 +150,6 @@ void QPlaceSearchRequestPrivate::clear()
a center but no radius. The default radius is set to -1, which indicates an undefined radius. The provider will
interpret this as being free to choose its own default radius.
- The QPlaceSearchRequest will assume ownership of the bounding area and will be responsible
- for its destruction.
-
The QPlaceSearchRequest is primarily used with the QPlaceManager to
\l {QPlaceManager::search()} {search for places}, however it is also
used to provide parameters for \l {QPlaceManager::searchSuggestions()}{generating search term suggestions}
@@ -176,7 +173,7 @@ void QPlaceSearchRequestPrivate::clear()
\value DistanceHint
Distance to a search center is relevant for the user. Closer places
are more highly weighted. This hint is only useful
- if a circular bounding area is used in the query.
+ if a circular search area is used in the query.
\value LexicalPlaceNameHint
Alphabetic ordering of places according to name is relevant to the user.
*/
@@ -295,9 +292,9 @@ void QPlaceSearchRequest::setCategories(const QList<QPlaceCategory> &categories)
/*!
Returns the search area which will be used to limit search results. The default search area is
- an invalid QGeoBoundingArea, indicating that no specific search area is defined.
+ an invalid QGeoShape, indicating that no specific search area is defined.
*/
-QGeoBoundingArea QPlaceSearchRequest::searchArea() const
+QGeoShape QPlaceSearchRequest::searchArea() const
{
Q_D(const QPlaceSearchRequest);
return d->searchArea;
@@ -306,7 +303,7 @@ QGeoBoundingArea QPlaceSearchRequest::searchArea() const
/*!
Sets the search request to search within the given \a area.
*/
-void QPlaceSearchRequest::setSearchArea(const QGeoBoundingArea &area)
+void QPlaceSearchRequest::setSearchArea(const QGeoShape &area)
{
Q_D(QPlaceSearchRequest);
d->searchArea = area;
diff --git a/src/location/places/qplacesearchrequest.h b/src/location/places/qplacesearchrequest.h
index 32639519..0612c771 100644
--- a/src/location/places/qplacesearchrequest.h
+++ b/src/location/places/qplacesearchrequest.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
-class QGeoBoundingArea;
+class QGeoShape;
class QPlaceSearchRequestPrivate;
class Q_LOCATION_EXPORT QPlaceSearchRequest
@@ -83,8 +83,8 @@ public:
void setCategory(const QPlaceCategory &category);
void setCategories(const QList<QPlaceCategory> &categories);
- QGeoBoundingArea searchArea() const;
- void setSearchArea(const QGeoBoundingArea &area);
+ QGeoShape searchArea() const;
+ void setSearchArea(const QGeoShape &area);
QtLocation::VisibilityScope visibilityScope() const;
void setVisibilityScope(QtLocation::VisibilityScope visibilityScopes);
diff --git a/src/location/qgeoboundingcircle.cpp b/src/location/qgeoboundingcircle.cpp
deleted file mode 100644
index e941661a..00000000
--- a/src/location/qgeoboundingcircle.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeoboundingcircle.h"
-#include "qgeoboundingcircle_p.h"
-
-#include "qgeocoordinate.h"
-#include "qnumeric.h"
-
-#include <QDebug>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGeoBoundingCircle
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoBoundingCircle class defines a circular geographic area.
-
- The circle is defined in terms of a QGeoCoordinate which specifies the
- center of the circle and a qreal which specifies the radius of the circle
- in meters.
-
- The circle is considered invalid if the center coordinate is invalid
- or if the radius is less than zero.
-*/
-
-#ifdef Q_NO_USING_KEYWORD
-/*!
- \fn bool QGeoBoundingCircle::operator==(const QGeoBoundingArea &other) const
-
- Returns true if \a other is equal to this bounding circle; otherwise returns false.
-*/
-
-/*!
- \fn bool QGeoBoundingCircle::operator!=(const QGeoBoundingArea &other) const
-
- Returns true if \a other is not equal to this bounding circle; otherwise returns false.
-*/
-#endif
-
-inline QGeoBoundingCirclePrivate *QGeoBoundingCircle::d_func()
-{
- return static_cast<QGeoBoundingCirclePrivate *>(d_ptr.data());
-}
-
-inline const QGeoBoundingCirclePrivate *QGeoBoundingCircle::d_func() const
-{
- return static_cast<const QGeoBoundingCirclePrivate *>(d_ptr.constData());
-}
-
-/*!
- Constructs a new, invalid bounding circle.
-*/
-QGeoBoundingCircle::QGeoBoundingCircle()
-: QGeoBoundingArea(new QGeoBoundingCirclePrivate)
-{
-}
-
-/*!
- Constructs a new bounding circle centered at \a center and with a radius of \a
- radius meters.
-*/
-QGeoBoundingCircle::QGeoBoundingCircle(const QGeoCoordinate &center, qreal radius)
-{
- d_ptr = new QGeoBoundingCirclePrivate(center, radius);
-}
-
-/*!
- Constructs a new bounding circle from the contents of \a other.
-*/
-QGeoBoundingCircle::QGeoBoundingCircle(const QGeoBoundingCircle &other)
-: QGeoBoundingArea(other)
-{
-}
-
-/*!
- Constructs a new bounding circle from the contents of \a other.
-*/
-QGeoBoundingCircle::QGeoBoundingCircle(const QGeoBoundingArea &other)
-: QGeoBoundingArea(other)
-{
- if (type() != QGeoBoundingArea::CircleType)
- d_ptr = new QGeoBoundingCirclePrivate;
-}
-
-/*!
- Destroys this bounding circle.
-*/
-QGeoBoundingCircle::~QGeoBoundingCircle() {}
-
-/*!
- Assigns \a other to this bounding circle and returns a reference to this
- bounding circle.
-*/
-QGeoBoundingCircle &QGeoBoundingCircle::operator = (const QGeoBoundingCircle & other)
-{
- if (this == &other)
- return *this;
-
- QGeoBoundingArea::operator=(other);
- d_ptr = other.d_ptr;
- return *this;
-}
-
-/*!
- Returns whether this bounding circle is equal to \a other.
-*/
-bool QGeoBoundingCircle::operator==(const QGeoBoundingCircle &other) const
-{
- Q_D(const QGeoBoundingCircle);
-
- return *d == *other.d_func();
-}
-
-/*!
- Returns whether this bounding circle is not equal to \a other.
-*/
-bool QGeoBoundingCircle::operator!=(const QGeoBoundingCircle &other) const
-{
- Q_D(const QGeoBoundingCircle);
-
- return !(*d == *other.d_func());
-}
-
-bool QGeoBoundingCirclePrivate::isValid() const
-{
- return center.isValid() && !qIsNaN(radius) && radius >= -1e-7;
-}
-
-bool QGeoBoundingCirclePrivate::isEmpty() const
-{
- return !isValid() || radius <= 1e-7;
-}
-
-/*!
- Sets the center coordinate of this bounding circle to \a center.
-*/
-void QGeoBoundingCircle::setCenter(const QGeoCoordinate &center)
-{
- Q_D(QGeoBoundingCircle);
-
- d->center = center;
-}
-
-/*!
- Returns the center coordinate of this bounding circle.
-*/
-QGeoCoordinate QGeoBoundingCircle::center() const
-{
- Q_D(const QGeoBoundingCircle);
-
- return d->center;
-}
-
-/*!
- Sets the radius in meters of this bounding circle to \a radius.
-*/
-void QGeoBoundingCircle::setRadius(qreal radius)
-{
- Q_D(QGeoBoundingCircle);
-
- d->radius = radius;
-}
-
-/*!
- Returns the radius in meters of this bounding circle.
-*/
-qreal QGeoBoundingCircle::radius() const
-{
- Q_D(const QGeoBoundingCircle);
-
- return d->radius;
-}
-
-bool QGeoBoundingCirclePrivate::contains(const QGeoCoordinate &coordinate) const
-{
- if (!isValid() || !coordinate.isValid())
- return false;
-
- return center.distanceTo(coordinate) <= radius;
-}
-
-/*!
- Translates this bounding circle by \a degreesLatitude northwards and \a
- degreesLongitude eastwards.
-
- Negative values of \a degreesLatitude and \a degreesLongitude correspond to
- southward and westward translation respectively.
-*/
-void QGeoBoundingCircle::translate(double degreesLatitude, double degreesLongitude)
-{
- // TODO handle dlat, dlon larger than 360 degrees
-
- Q_D(QGeoBoundingCircle);
-
- double lat = d->center.latitude();
- double lon = d->center.longitude();
-
- lat += degreesLatitude;
- lon += degreesLongitude;
-
- if (lon < -180.0)
- lon += 360.0;
- if (lon > 180.0)
- lon -= 360.0;
-
- if (lat > 90.0) {
- lat = 180.0 - lat;
- if (lon < 0.0)
- lon = 180.0;
- else
- lon -= 180;
- }
-
- if (lat < -90.0) {
- lat = 180.0 + lat;
- if (lon < 0.0)
- lon = 180.0;
- else
- lon -= 180;
- }
-
- d->center = QGeoCoordinate(lat, lon);
-}
-
-/*!
- Returns a copy of this bounding circle translated by \a degreesLatitude northwards and \a
- degreesLongitude eastwards.
-
- Negative values of \a degreesLatitude and \a degreesLongitude correspond to
- southward and westward translation respectively.
-
- \sa translate()
-*/
-QGeoBoundingCircle QGeoBoundingCircle::translated(double degreesLatitude, double degreesLongitude) const
-{
- QGeoBoundingCircle result(*this);
- result.translate(degreesLatitude, degreesLongitude);
- return result;
-}
-
-/*******************************************************************************
-*******************************************************************************/
-
-QGeoBoundingCirclePrivate::QGeoBoundingCirclePrivate()
-: QGeoBoundingAreaPrivate(QGeoBoundingArea::CircleType), radius(-1.0)
-{
-}
-
-QGeoBoundingCirclePrivate::QGeoBoundingCirclePrivate(const QGeoCoordinate &center, qreal radius)
-: QGeoBoundingAreaPrivate(QGeoBoundingArea::CircleType), center(center), radius(radius)
-{
-}
-
-QGeoBoundingCirclePrivate::QGeoBoundingCirclePrivate(const QGeoBoundingCirclePrivate &other)
-: QGeoBoundingAreaPrivate(QGeoBoundingArea::CircleType), center(other.center),
- radius(other.radius)
-{
-}
-
-QGeoBoundingCirclePrivate::~QGeoBoundingCirclePrivate() {}
-
-QGeoBoundingAreaPrivate *QGeoBoundingCirclePrivate::clone() const
-{
- return new QGeoBoundingCirclePrivate(*this);
-}
-
-bool QGeoBoundingCirclePrivate::operator==(const QGeoBoundingAreaPrivate &other) const
-{
- if (!QGeoBoundingAreaPrivate::operator==(other))
- return false;
-
- const QGeoBoundingCirclePrivate &otherCircle = static_cast<const QGeoBoundingCirclePrivate &>(other);
-
- return radius == otherCircle.radius && center == otherCircle.center;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/location/qgeocircle.cpp b/src/location/qgeocircle.cpp
new file mode 100644
index 00000000..5c459ab4
--- /dev/null
+++ b/src/location/qgeocircle.cpp
@@ -0,0 +1,311 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtLocation module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgeocircle.h"
+#include "qgeocircle_p.h"
+
+#include "qgeocoordinate.h"
+#include "qnumeric.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QGeoCircle
+ \inmodule QtLocation
+ \ingroup QtLocation-positioning
+ \since Qt Location 5.0
+
+ \brief The QGeoCircle class defines a circular geographic area.
+
+ The circle is defined in terms of a QGeoCoordinate which specifies the
+ center of the circle and a qreal which specifies the radius of the circle
+ in meters.
+
+ The circle is considered invalid if the center coordinate is invalid
+ or if the radius is less than zero.
+*/
+
+#ifdef Q_NO_USING_KEYWORD
+/*!
+ \fn bool QGeoCircle::operator==(const QGeoShape &other) const
+
+ Returns true if \a other is equal to this geo circle; otherwise returns false.
+*/
+
+/*!
+ \fn bool QGeoCircle::operator!=(const QGeoShape &other) const
+
+ Returns true if \a other is not equal to this geo circle; otherwise returns false.
+*/
+#endif
+
+inline QGeoCirclePrivate *QGeoCircle::d_func()
+{
+ return static_cast<QGeoCirclePrivate *>(d_ptr.data());
+}
+
+inline const QGeoCirclePrivate *QGeoCircle::d_func() const
+{
+ return static_cast<const QGeoCirclePrivate *>(d_ptr.constData());
+}
+
+/*!
+ Constructs a new, invalid geo circle.
+*/
+QGeoCircle::QGeoCircle()
+: QGeoShape(new QGeoCirclePrivate)
+{
+}
+
+/*!
+ Constructs a new geo circle centered at \a center and with a radius of \a radius meters.
+*/
+QGeoCircle::QGeoCircle(const QGeoCoordinate &center, qreal radius)
+{
+ d_ptr = new QGeoCirclePrivate(center, radius);
+}
+
+/*!
+ Constructs a new geo circle from the contents of \a other.
+*/
+QGeoCircle::QGeoCircle(const QGeoCircle &other)
+: QGeoShape(other)
+{
+}
+
+/*!
+ Constructs a new geo circle from the contents of \a other.
+*/
+QGeoCircle::QGeoCircle(const QGeoShape &other)
+: QGeoShape(other)
+{
+ if (type() != QGeoShape::CircleType)
+ d_ptr = new QGeoCirclePrivate;
+}
+
+/*!
+ Destroys this geo circle.
+*/
+QGeoCircle::~QGeoCircle() {}
+
+/*!
+ Assigns \a other to this geo circle and returns a reference to this geo circle.
+*/
+QGeoCircle &QGeoCircle::operator=(const QGeoCircle &other)
+{
+ QGeoShape::operator=(other);
+ return *this;
+}
+
+/*!
+ Returns whether this geo circle is equal to \a other.
+*/
+bool QGeoCircle::operator==(const QGeoCircle &other) const
+{
+ Q_D(const QGeoCircle);
+
+ return *d == *other.d_func();
+}
+
+/*!
+ Returns whether this geo circle is not equal to \a other.
+*/
+bool QGeoCircle::operator!=(const QGeoCircle &other) const
+{
+ Q_D(const QGeoCircle);
+
+ return !(*d == *other.d_func());
+}
+
+bool QGeoCirclePrivate::isValid() const
+{
+ return center.isValid() && !qIsNaN(radius) && radius >= -1e-7;
+}
+
+bool QGeoCirclePrivate::isEmpty() const
+{
+ return !isValid() || radius <= 1e-7;
+}
+
+/*!
+ Sets the center coordinate of this geo circle to \a center.
+*/
+void QGeoCircle::setCenter(const QGeoCoordinate &center)
+{
+ Q_D(QGeoCircle);
+
+ d->center = center;
+}
+
+/*!
+ Returns the center coordinate of this geo circle.
+*/
+QGeoCoordinate QGeoCircle::center() const
+{
+ Q_D(const QGeoCircle);
+
+ return d->center;
+}
+
+/*!
+ Sets the radius in meters of this geo circle to \a radius.
+*/
+void QGeoCircle::setRadius(qreal radius)
+{
+ Q_D(QGeoCircle);
+
+ d->radius = radius;
+}
+
+/*!
+ Returns the radius in meters of this geo circle.
+*/
+qreal QGeoCircle::radius() const
+{
+ Q_D(const QGeoCircle);
+
+ return d->radius;
+}
+
+bool QGeoCirclePrivate::contains(const QGeoCoordinate &coordinate) const
+{
+ if (!isValid() || !coordinate.isValid())
+ return false;
+
+ return center.distanceTo(coordinate) <= radius;
+}
+
+/*!
+ Translates this geo circle by \a degreesLatitude northwards and \a degreesLongitude eastwards.
+
+ Negative values of \a degreesLatitude and \a degreesLongitude correspond to
+ southward and westward translation respectively.
+*/
+void QGeoCircle::translate(double degreesLatitude, double degreesLongitude)
+{
+ // TODO handle dlat, dlon larger than 360 degrees
+
+ Q_D(QGeoCircle);
+
+ double lat = d->center.latitude();
+ double lon = d->center.longitude();
+
+ lat += degreesLatitude;
+ lon += degreesLongitude;
+
+ if (lon < -180.0)
+ lon += 360.0;
+ if (lon > 180.0)
+ lon -= 360.0;
+
+ if (lat > 90.0) {
+ lat = 180.0 - lat;
+ if (lon < 0.0)
+ lon = 180.0;
+ else
+ lon -= 180;
+ }
+
+ if (lat < -90.0) {
+ lat = 180.0 + lat;
+ if (lon < 0.0)
+ lon = 180.0;
+ else
+ lon -= 180;
+ }
+
+ d->center = QGeoCoordinate(lat, lon);
+}
+
+/*!
+ Returns a copy of this geo circle translated by \a degreesLatitude northwards and
+ \a degreesLongitude eastwards.
+
+ Negative values of \a degreesLatitude and \a degreesLongitude correspond to
+ southward and westward translation respectively.
+
+ \sa translate()
+*/
+QGeoCircle QGeoCircle::translated(double degreesLatitude, double degreesLongitude) const
+{
+ QGeoCircle result(*this);
+ result.translate(degreesLatitude, degreesLongitude);
+ return result;
+}
+
+/*******************************************************************************
+*******************************************************************************/
+
+QGeoCirclePrivate::QGeoCirclePrivate()
+: QGeoShapePrivate(QGeoShape::CircleType), radius(-1.0)
+{
+}
+
+QGeoCirclePrivate::QGeoCirclePrivate(const QGeoCoordinate &center, qreal radius)
+: QGeoShapePrivate(QGeoShape::CircleType), center(center), radius(radius)
+{
+}
+
+QGeoCirclePrivate::QGeoCirclePrivate(const QGeoCirclePrivate &other)
+: QGeoShapePrivate(QGeoShape::CircleType), center(other.center),
+ radius(other.radius)
+{
+}
+
+QGeoCirclePrivate::~QGeoCirclePrivate() {}
+
+QGeoShapePrivate *QGeoCirclePrivate::clone() const
+{
+ return new QGeoCirclePrivate(*this);
+}
+
+bool QGeoCirclePrivate::operator==(const QGeoShapePrivate &other) const
+{
+ if (!QGeoShapePrivate::operator==(other))
+ return false;
+
+ const QGeoCirclePrivate &otherCircle = static_cast<const QGeoCirclePrivate &>(other);
+
+ return radius == otherCircle.radius && center == otherCircle.center;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/location/qgeoboundingcircle.h b/src/location/qgeocircle.h
index 6fbe3ef4..a38acb1b 100644
--- a/src/location/qgeoboundingcircle.h
+++ b/src/location/qgeocircle.h
@@ -39,53 +39,49 @@
**
****************************************************************************/
-#ifndef QGEOBOUNDINGCIRCLE_H
-#define QGEOBOUNDINGCIRCLE_H
+#ifndef QGEOCIRCLE_H
+#define QGEOCIRCLE_H
-#include "qgeoboundingarea.h"
-
-#include <QSharedDataPointer>
+#include <QtLocation/QGeoShape>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
-
class QGeoCoordinate;
-class QGeoBoundingCirclePrivate;
+class QGeoCirclePrivate;
-class Q_LOCATION_EXPORT QGeoBoundingCircle : public QGeoBoundingArea
+class Q_LOCATION_EXPORT QGeoCircle : public QGeoShape
{
public:
- QGeoBoundingCircle();
- QGeoBoundingCircle(const QGeoCoordinate &center, qreal radius = -1.0);
- QGeoBoundingCircle(const QGeoBoundingCircle &other);
- QGeoBoundingCircle(const QGeoBoundingArea &other);
+ QGeoCircle();
+ QGeoCircle(const QGeoCoordinate &center, qreal radius = -1.0);
+ QGeoCircle(const QGeoCircle &other);
+ QGeoCircle(const QGeoShape &other);
- ~QGeoBoundingCircle();
+ ~QGeoCircle();
- QGeoBoundingCircle &operator = (const QGeoBoundingCircle &other);
+ QGeoCircle &operator=(const QGeoCircle &other);
#ifdef Q_NO_USING_KEYWORD
- bool operator==(const QGeoBoundingArea &other) const
+ bool operator==(const QGeoShape &other) const
{
- return QGeoBoundingArea::operator==(other);
+ return QGeoShape::operator==(other);
}
#else
- using QGeoBoundingArea::operator==;
+ using QGeoShape::operator==;
#endif
- bool operator==(const QGeoBoundingCircle &other) const;
+ bool operator==(const QGeoCircle &other) const;
#ifdef Q_NO_USING_KEYWORD
- bool operator!=(const QGeoBoundingArea &other) const
+ bool operator!=(const QGeoShape &other) const
{
- return QGeoBoundingArea::operator!=(other);
+ return QGeoShape::operator!=(other);
}
#else
- using QGeoBoundingArea::operator!=;
+ using QGeoShape::operator!=;
#endif
- bool operator!=(const QGeoBoundingCircle &other) const;
+ bool operator!=(const QGeoCircle &other) const;
void setCenter(const QGeoCoordinate &center);
QGeoCoordinate center() const;
@@ -94,16 +90,16 @@ public:
qreal radius() const;
void translate(double degreesLatitude, double degreesLongitude);
- QGeoBoundingCircle translated(double degreesLatitude, double degreesLongitude) const;
+ QGeoCircle translated(double degreesLatitude, double degreesLongitude) const;
private:
- inline QGeoBoundingCirclePrivate *d_func();
- inline const QGeoBoundingCirclePrivate *d_func() const;
+ inline QGeoCirclePrivate *d_func();
+ inline const QGeoCirclePrivate *d_func() const;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QGeoBoundingCircle)
+Q_DECLARE_METATYPE(QGeoCircle)
QT_END_HEADER
diff --git a/src/location/qgeoboundingcircle_p.h b/src/location/qgeocircle_p.h
index 3dcf2409..fd73d639 100644
--- a/src/location/qgeoboundingcircle_p.h
+++ b/src/location/qgeocircle_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOBOUNDINGCIRCLE_P_H
-#define QGEOBOUNDINGCIRCLE_P_H
+#ifndef QGEOCIRCLE_P_H
+#define QGEOCIRCLE_P_H
//
// W A R N I N G
@@ -53,26 +53,26 @@
// We mean it.
//
-#include "qgeoboundingarea_p.h"
+#include "qgeoshape_p.h"
#include "qgeocoordinate.h"
QT_BEGIN_NAMESPACE
-class QGeoBoundingCirclePrivate : public QGeoBoundingAreaPrivate
+class QGeoCirclePrivate : public QGeoShapePrivate
{
public:
- QGeoBoundingCirclePrivate();
- QGeoBoundingCirclePrivate(const QGeoCoordinate &center, qreal radius);
- QGeoBoundingCirclePrivate(const QGeoBoundingCirclePrivate &other);
- ~QGeoBoundingCirclePrivate();
+ QGeoCirclePrivate();
+ QGeoCirclePrivate(const QGeoCoordinate &center, qreal radius);
+ QGeoCirclePrivate(const QGeoCirclePrivate &other);
+ ~QGeoCirclePrivate();
bool isValid() const;
bool isEmpty() const;
bool contains(const QGeoCoordinate &coordinate) const;
- QGeoBoundingAreaPrivate *clone() const;
+ QGeoShapePrivate *clone() const;
- bool operator==(const QGeoBoundingAreaPrivate &other) const;
+ bool operator==(const QGeoShapePrivate &other) const;
QGeoCoordinate center;
qreal radius;
diff --git a/src/location/qgeolocation.cpp b/src/location/qgeolocation.cpp
index 634d72b1..9c13e89c 100644
--- a/src/location/qgeolocation.cpp
+++ b/src/location/qgeolocation.cpp
@@ -177,7 +177,7 @@ void QGeoLocation::setCoordinate(const QGeoCoordinate &coordinate)
Returns a bounding box which represents the recommended region
to display when viewing this location.
*/
-QGeoBoundingBox QGeoLocation::boundingBox() const
+QGeoRectangle QGeoLocation::boundingBox() const
{
return d->viewport;
}
@@ -185,7 +185,7 @@ QGeoBoundingBox QGeoLocation::boundingBox() const
/*!
Sets the \a boundingBox of the location.
*/
-void QGeoLocation::setBoundingBox(const QGeoBoundingBox &boundingBox)
+void QGeoLocation::setBoundingBox(const QGeoRectangle &boundingBox)
{
d->viewport = boundingBox;
}
diff --git a/src/location/qgeolocation.h b/src/location/qgeolocation.h
index 78224b5f..e668a05b 100644
--- a/src/location/qgeolocation.h
+++ b/src/location/qgeolocation.h
@@ -42,20 +42,17 @@
#ifndef QGEOLOCATION_H
#define QGEOLOCATION_H
-#include <QSharedDataPointer>
-#include <QString>
-#include <QVariant>
-#include <QList>
-#include "qgeoaddress.h"
-#include "qgeocoordinate.h"
-#include "qgeoboundingbox.h"
+#include <QtCore/QSharedDataPointer>
+#include <QtCore/QMetaType>
+#include <QtLocation/qlocationglobal.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
-
+class QGeoAddress;
+class QGeoCoordinate;
+class QGeoRectangle;
class QGeoLocationPrivate;
class Q_LOCATION_EXPORT QGeoLocation
@@ -77,8 +74,8 @@ public:
void setAddress(const QGeoAddress &address);
QGeoCoordinate coordinate() const;
void setCoordinate(const QGeoCoordinate &position);
- QGeoBoundingBox boundingBox() const;
- void setBoundingBox(const QGeoBoundingBox &box);
+ QGeoRectangle boundingBox() const;
+ void setBoundingBox(const QGeoRectangle &box);
bool isEmpty() const;
diff --git a/src/location/qgeolocation_p.h b/src/location/qgeolocation_p.h
index 7a2a002d..fce862ae 100644
--- a/src/location/qgeolocation_p.h
+++ b/src/location/qgeolocation_p.h
@@ -42,7 +42,10 @@
#ifndef QGEOLOCATION_P_H
#define QGEOLOCATION_P_H
-#include <QSharedData>
+#include <QtCore/QSharedData>
+#include <QtLocation/QGeoAddress>
+#include <QtLocation/QGeoCoordinate>
+#include <QtLocation/QGeoRectangle>
QT_BEGIN_NAMESPACE
@@ -60,7 +63,7 @@ public:
QGeoAddress address;
QGeoCoordinate coordinate;
- QGeoBoundingBox viewport;
+ QGeoRectangle viewport;
};
QT_END_NAMESPACE
diff --git a/src/location/qgeoboundingbox.cpp b/src/location/qgeorectangle.cpp
index b4066fe8..6e231fbb 100644
--- a/src/location/qgeoboundingbox.cpp
+++ b/src/location/qgeorectangle.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qgeoboundingbox.h"
-#include "qgeoboundingbox_p.h"
+#include "qgeorectangle.h"
+#include "qgeorectangle_p.h"
#include "qgeocoordinate.h"
#include "qnumeric.h"
@@ -48,161 +48,158 @@
QT_BEGIN_NAMESPACE
/*!
- \class QGeoBoundingBox
+ \class QGeoRectangle
\inmodule QtLocation
\ingroup QtLocation-positioning
\since Qt Location 5.0
- \brief The QGeoBoundingBox class defines a rectangular geographic area.
+ \brief The QGeoRectangle class defines a rectangular geographic area.
The rectangle is defined in terms of a QGeoCoordinate which specifies the
top left coordinate of the rectangle and a QGeoCoordinate which specifies
the bottom right coordinate of the rectangle.
- A bounding box is considered invalid if the top left or bottom right
+ A geo rectangle is considered invalid if the top left or bottom right
coordinates are invalid or if the top left coordinate is south of the
bottom right coordinate.
- Bounding boxes can never cross the poles.
+ Geo rectangles can never cross the poles.
- Several methods behave as though the bounding box is defined in terms of a
- center coordinate, the width of the bounding box in degrees and the height
- of the bounding box in degrees.
+ Several methods behave as though the geo rectangle is defined in terms of a
+ center coordinate, the width of the geo rectangle in degrees and the height
+ of the geo rectangle in degrees.
- If the height or center of a bounding box is adjusted such that it would
- cross one of the poles the height is modified such that the bounding box
+ If the height or center of a geo rectangle is adjusted such that it would
+ cross one of the poles the height is modified such that the geo rectangle
touches but does not cross the pole and that the center coordinate is still
- in the center of the bounding box.
+ in the center of the geo rectangle.
*/
#ifdef Q_NO_USING_KEYWORD
/*!
- \fn bool QGeoBoundingBox::operator==(const QGeoBoundingArea &other) const
+ \fn bool QGeoRectangle::operator==(const QGeoShape &other) const
- Returns true if \a other is equivalent to this bounding box; otherwise returns false.
+ Returns true if \a other is equivalent to this geo rectangle; otherwise returns false.
*/
/*!
- \fn bool QGeoBoundingBox::operator!=(const QGeoBoundingArea &other) const
+ \fn bool QGeoRectangle::operator!=(const QGeoShape &other) const
- Returns true if \a other is not equivalent to this bounding box; otherwise returns false.
+ Returns true if \a other is not equivalent to this geo rectangle; otherwise returns false.
*/
/*!
- \fn bool QGeoBoundingBox::contains(const QGeoCoordinate &coordinate) const
+ \fn bool QGeoRectangle::contains(const QGeoCoordinate &coordinate) const
- Returns true if \a coordinate is within this bounding box; otherwise returns false.
+ Returns true if \a coordinate is within this geo rectangle; otherwise returns false.
*/
#endif
-inline QGeoBoundingBoxPrivate *QGeoBoundingBox::d_func()
+inline QGeoRectanglePrivate *QGeoRectangle::d_func()
{
- return static_cast<QGeoBoundingBoxPrivate *>(d_ptr.data());
+ return static_cast<QGeoRectanglePrivate *>(d_ptr.data());
}
-inline const QGeoBoundingBoxPrivate *QGeoBoundingBox::d_func() const
+inline const QGeoRectanglePrivate *QGeoRectangle::d_func() const
{
- return static_cast<const QGeoBoundingBoxPrivate *>(d_ptr.constData());
+ return static_cast<const QGeoRectanglePrivate *>(d_ptr.constData());
}
/*!
- Constructs a new, invalid bounding box.
+ Constructs a new, invalid geo rectangle.
*/
-QGeoBoundingBox::QGeoBoundingBox()
-: QGeoBoundingArea(new QGeoBoundingBoxPrivate)
+QGeoRectangle::QGeoRectangle()
+: QGeoShape(new QGeoRectanglePrivate)
{
}
/*!
- Constructs a new bounding box centered at \a center with a
+ Constructs a new geo rectangle centered at \a center with a
width in degrees of \a degreesWidth and a height in degrees of \a degreesHeight.
- If \a degreesHeight would take the bounding box beyond one of the poles,
- the height of the bounding box will be truncated such that the bounding box
- only extends up to the pole. The center of the bounding box will be
+ If \a degreesHeight would take the geo rectangle beyond one of the poles,
+ the height of the geo rectangle will be truncated such that the geo rectangle
+ only extends up to the pole. The center of the geo rectangle will be
unchanged, and the height will be adjusted such that the center point is at
- the center of the truncated bounding box.
+ the center of the truncated geo rectangle.
*/
-QGeoBoundingBox::QGeoBoundingBox(const QGeoCoordinate &center, double degreesWidth, double degreesHeight)
+QGeoRectangle::QGeoRectangle(const QGeoCoordinate &center, double degreesWidth, double degreesHeight)
{
- d_ptr = new QGeoBoundingBoxPrivate(center, center);
+ d_ptr = new QGeoRectanglePrivate(center, center);
setWidth(degreesWidth);
setHeight(degreesHeight);
}
/*!
- Constructs a new bounding box with a top left coordinate \a
- topLeft and a bottom right coordinate \a bottomRight.
+ Constructs a new geo rectangle with a top left coordinate \a topLeft and a bottom right
+ coordinate \a bottomRight.
*/
-QGeoBoundingBox::QGeoBoundingBox(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight)
+QGeoRectangle::QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight)
{
- d_ptr = new QGeoBoundingBoxPrivate(topLeft, bottomRight);
+ d_ptr = new QGeoRectanglePrivate(topLeft, bottomRight);
}
/*!
- Constructs a bounding box from the contents of \a other.
+ Constructs a geo rectangle from the contents of \a other.
*/
-QGeoBoundingBox::QGeoBoundingBox(const QGeoBoundingBox &other)
-: QGeoBoundingArea(other)
+QGeoRectangle::QGeoRectangle(const QGeoRectangle &other)
+: QGeoShape(other)
{
}
/*!
- Constructs a bounding box from the contents of \a other.
+ Constructs a geo rectangle from the contents of \a other.
*/
-QGeoBoundingBox::QGeoBoundingBox(const QGeoBoundingArea &other)
-: QGeoBoundingArea(other)
+QGeoRectangle::QGeoRectangle(const QGeoShape &other)
+: QGeoShape(other)
{
- if (type() != QGeoBoundingArea::BoxType)
- d_ptr = new QGeoBoundingBoxPrivate;
+ if (type() != QGeoShape::RectangleType)
+ d_ptr = new QGeoRectanglePrivate;
}
/*!
- Destroys this bounding box.
+ Destroys this geo rectangle.
*/
-QGeoBoundingBox::~QGeoBoundingBox() {}
+QGeoRectangle::~QGeoRectangle()
+{
+}
/*!
- Assigns \a other to this bounding box and returns a reference to this
- bounding box.
+ Assigns \a other to this geo rectangle and returns a reference to this geo rectangle.
*/
-QGeoBoundingBox &QGeoBoundingBox::operator = (const QGeoBoundingBox & other)
+QGeoRectangle &QGeoRectangle::operator=(const QGeoRectangle &other)
{
- if (this == &other)
- return *this;
-
- QGeoBoundingArea::operator=(other);
- d_ptr = other.d_ptr;
+ QGeoShape::operator=(other);
return *this;
}
/*!
- Returns whether this bounding box is equal to \a other.
+ Returns whether this geo rectangle is equal to \a other.
*/
-bool QGeoBoundingBox::operator == (const QGeoBoundingBox &other) const
+bool QGeoRectangle::operator==(const QGeoRectangle &other) const
{
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
return *d == *other.d_func();
}
/*!
- Returns whether this bounding box is not equal to \a other.
+ Returns whether this geo rectangle is not equal to \a other.
*/
-bool QGeoBoundingBox::operator != (const QGeoBoundingBox &other) const
+bool QGeoRectangle::operator!=(const QGeoRectangle &other) const
{
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
return !(*d == *other.d_func());
}
-bool QGeoBoundingBoxPrivate::isValid() const
+bool QGeoRectanglePrivate::isValid() const
{
return topLeft.isValid() && bottomRight.isValid() &&
topLeft.latitude() >= bottomRight.latitude();
}
-bool QGeoBoundingBoxPrivate::isEmpty() const
+bool QGeoRectanglePrivate::isEmpty() const
{
if (!isValid())
return true;
@@ -212,108 +209,108 @@ bool QGeoBoundingBoxPrivate::isEmpty() const
}
/*!
- Sets the top left coordinate of this bounding box to \a topLeft.
+ Sets the top left coordinate of this geo rectangle to \a topLeft.
*/
-void QGeoBoundingBox::setTopLeft(const QGeoCoordinate &topLeft)
+void QGeoRectangle::setTopLeft(const QGeoCoordinate &topLeft)
{
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
d->topLeft = topLeft;
}
/*!
- Returns the top left coordinate of this bounding box.
+ Returns the top left coordinate of this geo rectangle.
*/
-QGeoCoordinate QGeoBoundingBox::topLeft() const
+QGeoCoordinate QGeoRectangle::topLeft() const
{
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
return d->topLeft;
}
/*!
- Sets the top right coordinate of this bounding box to \a topRight.
+ Sets the top right coordinate of this geo rectangle to \a topRight.
*/
-void QGeoBoundingBox::setTopRight(const QGeoCoordinate &topRight)
+void QGeoRectangle::setTopRight(const QGeoCoordinate &topRight)
{
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
d->topLeft.setLatitude(topRight.latitude());
d->bottomRight.setLongitude(topRight.longitude());
}
/*!
- Returns the top right coordinate of this bounding box.
+ Returns the top right coordinate of this geo rectangle.
*/
-QGeoCoordinate QGeoBoundingBox::topRight() const
+QGeoCoordinate QGeoRectangle::topRight() const
{
// TODO remove?
if (!isValid())
return QGeoCoordinate();
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
return QGeoCoordinate(d->topLeft.latitude(), d->bottomRight.longitude());
}
/*!
- Sets the bottom left coordinate of this bounding box to \a bottomLeft.
+ Sets the bottom left coordinate of this geo rectangle to \a bottomLeft.
*/
-void QGeoBoundingBox::setBottomLeft(const QGeoCoordinate &bottomLeft)
+void QGeoRectangle::setBottomLeft(const QGeoCoordinate &bottomLeft)
{
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
d->bottomRight.setLatitude(bottomLeft.latitude());
d->topLeft.setLongitude(bottomLeft.longitude());
}
/*!
- Returns the bottom left coordinate of this bounding box.
+ Returns the bottom left coordinate of this geo rectangle.
*/
-QGeoCoordinate QGeoBoundingBox::bottomLeft() const
+QGeoCoordinate QGeoRectangle::bottomLeft() const
{
// TODO remove?
if (!isValid())
return QGeoCoordinate();
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
return QGeoCoordinate(d->bottomRight.latitude(), d->topLeft.longitude());
}
/*!
- Sets the bottom right coordinate of this bounding box to \a bottomRight.
+ Sets the bottom right coordinate of this geo rectangle to \a bottomRight.
*/
-void QGeoBoundingBox::setBottomRight(const QGeoCoordinate &bottomRight)
+void QGeoRectangle::setBottomRight(const QGeoCoordinate &bottomRight)
{
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
d->bottomRight = bottomRight;
}
/*!
- Returns the bottom right coordinate of this bounding box.
+ Returns the bottom right coordinate of this geo rectangle.
*/
-QGeoCoordinate QGeoBoundingBox::bottomRight() const
+QGeoCoordinate QGeoRectangle::bottomRight() const
{
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
return d->bottomRight;
}
/*!
- Sets the center of this bounding box to \a center.
+ Sets the center of this geo rectangle to \a center.
- If this causes the bounding box to cross on of the poles the height of the
- bounding box will be truncated such that the bounding box only extends up
- to the pole. The center of the bounding box will be unchanged, and the
+ If this causes the geo rectangle to cross on of the poles the height of the
+ geo rectangle will be truncated such that the geo rectangle only extends up
+ to the pole. The center of the geo rectangle will be unchanged, and the
height will be adjusted such that the center point is at the center of the
- truncated bounding box.
+ truncated geo rectangle.
*/
-void QGeoBoundingBox::setCenter(const QGeoCoordinate &center)
+void QGeoRectangle::setCenter(const QGeoCoordinate &center)
{
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
if (!isValid()) {
d->topLeft = center;
@@ -368,14 +365,14 @@ void QGeoBoundingBox::setCenter(const QGeoCoordinate &center)
}
/*!
- Returns the center of this bounding box.
+ Returns the center of this geo rectangle.
*/
-QGeoCoordinate QGeoBoundingBox::center() const
+QGeoCoordinate QGeoRectangle::center() const
{
if (!isValid())
return QGeoCoordinate();
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
double cLat = (d->topLeft.latitude() + d->bottomRight.latitude()) / 2.0;
@@ -393,18 +390,18 @@ QGeoCoordinate QGeoBoundingBox::center() const
}
/*!
- Sets the width of this bounding box in degrees to \a degreesWidth.
+ Sets the width of this geo rectangle in degrees to \a degreesWidth.
- If \a degreesWidth is less than 0.0 or if this bounding box is invalid this
+ If \a degreesWidth is less than 0.0 or if this geo rectangle is invalid this
function does nothing. To set up the values of an invalid
- QGeoBoundingBox based on the center, width and height you should use
- setCenter() first in order to make the QGeoBoundingBox valid.
+ geo rectangle based on the center, width and height you should use
+ setCenter() first in order to make the geo rectangle valid.
If \a degreesWidth is greater than 360.0 then 360.0 is used as the width,
- the leftmost longitude of the bounding box is set to -180.0 degrees and the
- rightmost longitude of the bounding box is set to 180.0 degrees.
+ the leftmost longitude of the geo rectangle is set to -180.0 degrees and the
+ rightmost longitude of the geo rectangle is set to 180.0 degrees.
*/
-void QGeoBoundingBox::setWidth(double degreesWidth)
+void QGeoRectangle::setWidth(double degreesWidth)
{
if (!isValid())
return;
@@ -412,7 +409,7 @@ void QGeoBoundingBox::setWidth(double degreesWidth)
if (degreesWidth < 0.0)
return;
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
if (degreesWidth >= 360.0) {
d->topLeft.setLongitude(-180.0);
@@ -444,16 +441,16 @@ void QGeoBoundingBox::setWidth(double degreesWidth)
}
/*!
- Returns the width of this bounding box in degrees.
+ Returns the width of this geo rectangle in degrees.
- The return value is undefined if this bounding box is invalid.
+ The return value is undefined if this geo rectangle is invalid.
*/
-double QGeoBoundingBox::width() const
+double QGeoRectangle::width() const
{
if (!isValid())
return qQNaN();
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
double result = d->bottomRight.longitude() - d->topLeft.longitude();
if (result < 0.0)
@@ -465,23 +462,23 @@ double QGeoBoundingBox::width() const
}
/*!
- Sets the height of this bounding box in degrees to \a degreesHeight.
+ Sets the height of this geo rectangle in degrees to \a degreesHeight.
- If \a degreesHeight is less than 0.0 or if this bounding box is invalid
+ If \a degreesHeight is less than 0.0 or if this geo rectangle is invalid
this function does nothing. To set up the values of an invalid
- QGeoBoundingBox based on the center, width and height you should use
- setCenter() first in order to make the QGeoBoundingBox valid.
+ geo rectangle based on the center, width and height you should use
+ setCenter() first in order to make the geo rectangle valid.
- If the change in height would cause the bounding box to cross a pole
- the height is adjusted such that the bounding box only touches the pole.
+ If the change in height would cause the geo rectangle to cross a pole
+ the height is adjusted such that the geo rectangle only touches the pole.
This change is done such that the center coordinate is still at the
- center of the bounding box, which may result in a bounding box with
+ center of the geo rectangle, which may result in a geo rectangle with
a smaller height than might otherwise be expected.
If \a degreesHeight is greater than 180.0 then 180.0 is used as the height.
*/
-void QGeoBoundingBox::setHeight(double degreesHeight)
+void QGeoRectangle::setHeight(double degreesHeight)
{
if (!isValid())
return;
@@ -493,7 +490,7 @@ void QGeoBoundingBox::setHeight(double degreesHeight)
degreesHeight = 180.0;
}
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
double tlLon = d->topLeft.longitude();
double brLon = d->bottomRight.longitude();
@@ -528,16 +525,16 @@ void QGeoBoundingBox::setHeight(double degreesHeight)
}
/*!
- Returns the height of this bounding box in degrees.
+ Returns the height of this geo rectangle in degrees.
- The return value is undefined if this bounding box is invalid.
+ The return value is undefined if this geo rectangle is invalid.
*/
-double QGeoBoundingBox::height() const
+double QGeoRectangle::height() const
{
if (!isValid())
return qQNaN();
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
double result = d->topLeft.latitude() - d->bottomRight.latitude();
if (result < 0.0)
@@ -545,7 +542,7 @@ double QGeoBoundingBox::height() const
return result;
}
-bool QGeoBoundingBoxPrivate::contains(const QGeoCoordinate &coordinate) const
+bool QGeoRectanglePrivate::contains(const QGeoCoordinate &coordinate) const
{
if (!isValid() || !coordinate.isValid())
return false;
@@ -581,40 +578,39 @@ bool QGeoBoundingBoxPrivate::contains(const QGeoCoordinate &coordinate) const
}
/*!
- Returns whether the bounding box \a boundingBox is contained within this
- bounding box.
+ Returns whether the geo rectangle \a rectangle is contained within this
+ geo rectangle.
*/
-bool QGeoBoundingBox::contains(const QGeoBoundingBox &boundingBox) const
+bool QGeoRectangle::contains(const QGeoRectangle &rectangle) const
{
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
- return (d->contains(boundingBox.topLeft())
- && d->contains(boundingBox.topRight())
- && d->contains(boundingBox.bottomLeft())
- && d->contains(boundingBox.bottomRight()));
+ return (d->contains(rectangle.topLeft())
+ && d->contains(rectangle.topRight())
+ && d->contains(rectangle.bottomLeft())
+ && d->contains(rectangle.bottomRight()));
}
/*!
- Returns whether the bounding box \a boundingBox intersects this bounding
- box.
+ Returns whether the geo rectangle \a rectangle intersects this geo rectangle.
- If the top or bottom edges of both bounding boxes are at one of the poles
- the bounding boxes are considered to be intersecting, since the longitude
+ If the top or bottom edges of both geo rectangles are at one of the poles
+ the geo rectangles are considered to be intersecting, since the longitude
is irrelevant when the edges are at the pole.
*/
-bool QGeoBoundingBox::intersects(const QGeoBoundingBox &boundingBox) const
+bool QGeoRectangle::intersects(const QGeoRectangle &rectangle) const
{
- Q_D(const QGeoBoundingBox);
+ Q_D(const QGeoRectangle);
double left1 = d->topLeft.longitude();
double right1 = d->bottomRight.longitude();
double top1 = d->topLeft.latitude();
double bottom1 = d->bottomRight.latitude();
- double left2 = boundingBox.d_func()->topLeft.longitude();
- double right2 = boundingBox.d_func()->bottomRight.longitude();
- double top2 = boundingBox.d_func()->topLeft.latitude();
- double bottom2 = boundingBox.d_func()->bottomRight.latitude();
+ double left2 = rectangle.d_func()->topLeft.longitude();
+ double right2 = rectangle.d_func()->bottomRight.longitude();
+ double top2 = rectangle.d_func()->topLeft.latitude();
+ double bottom2 = rectangle.d_func()->bottomRight.latitude();
if (top1 < bottom2)
return false;
@@ -649,21 +645,21 @@ bool QGeoBoundingBox::intersects(const QGeoBoundingBox &boundingBox) const
}
/*!
- Translates this bounding box by \a degreesLatitude northwards and \a
+ Translates this geo rectangle by \a degreesLatitude northwards and \a
degreesLongitude eastwards.
Negative values of \a degreesLatitude and \a degreesLongitude correspond to
southward and westward translation respectively.
- If the translation would have caused the bounding box to cross a pole the
- bounding box will be translated until the top or bottom edge of bounding
- box touches the pole but not further.
+ If the translation would have caused the geo rectangle to cross a pole the
+ geo rectangle will be translated until the top or bottom edge of the geo rectangle
+ touches the pole but not further.
*/
-void QGeoBoundingBox::translate(double degreesLatitude, double degreesLongitude)
+void QGeoRectangle::translate(double degreesLatitude, double degreesLongitude)
{
// TODO handle dlat, dlon larger than 360 degrees
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
double tlLat = d->topLeft.latitude();
double tlLon = d->topLeft.longitude();
@@ -707,7 +703,7 @@ void QGeoBoundingBox::translate(double degreesLatitude, double degreesLongitude)
}
/*!
- Returns a copy of this bounding box translated by \a degreesLatitude northwards and \a
+ Returns a copy of this geo rectangle translated by \a degreesLatitude northwards and \a
degreesLongitude eastwards.
Negative values of \a degreesLatitude and \a degreesLongitude correspond to
@@ -715,35 +711,35 @@ void QGeoBoundingBox::translate(double degreesLatitude, double degreesLongitude)
\sa translate()
*/
-QGeoBoundingBox QGeoBoundingBox::translated(double degreesLatitude, double degreesLongitude) const
+QGeoRectangle QGeoRectangle::translated(double degreesLatitude, double degreesLongitude) const
{
- QGeoBoundingBox result(*this);
+ QGeoRectangle result(*this);
result.translate(degreesLatitude, degreesLongitude);
return result;
}
/*!
- Returns the smallest bounding box which contains both this bounding box and \a boundingBox.
+ Returns the smallest geo rectangle which contains both this geo rectangle and \a rectangle.
- If the centers of the two bounding boxes are separated by exactly 180.0 degrees then the
+ If the centers of the two geo rectangles are separated by exactly 180.0 degrees then the
width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the
rightmost longitude set to 180.0 degrees. This is done to ensure that the result is
independent of the order of the operands.
*/
-QGeoBoundingBox QGeoBoundingBox::united(const QGeoBoundingBox &boundingBox) const
+QGeoRectangle QGeoRectangle::united(const QGeoRectangle &rectangle) const
{
- QGeoBoundingBox result(*this);
- result |= boundingBox;
+ QGeoRectangle result(*this);
+ result |= rectangle;
return result;
}
/*!
- \fn QGeoBoundingBox QGeoBoundingBox::operator | (const QGeoBoundingBox &boundingBox) const
+ \fn QGeoRectangle QGeoRectangle::operator|(const QGeoRectangle &rectangle) const
- Returns the smallest bounding box which contains both this bounding box and \a boundingBox.
+ Returns the smallest geo rectangle which contains both this geo rectangle and \a rectangle.
- If the centers of the two bounding boxes are separated by exactly 180.0 degrees then the
+ If the centers of the two geo rectangles are separated by exactly 180.0 degrees then the
width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the
rightmost longitude set to 180.0 degrees. This is done to ensure that the result is
independent of the order of the operands.
@@ -751,29 +747,29 @@ QGeoBoundingBox QGeoBoundingBox::united(const QGeoBoundingBox &boundingBox) cons
*/
/*!
- Returns the smallest bounding box which contains both this bounding box and \a boundingBox.
+ Returns the smallest geo rectangle which contains both this geo rectangle and \a rectangle.
- If the centers of the two bounding boxes are separated by exactly 180.0 degrees then the
+ If the centers of the two geo rectangles are separated by exactly 180.0 degrees then the
width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the
rightmost longitude set to 180.0 degrees. This is done to ensure that the result is
independent of the order of the operands.
*/
-QGeoBoundingBox &QGeoBoundingBox::operator |= (const QGeoBoundingBox & boundingBox)
+QGeoRectangle &QGeoRectangle::operator|=(const QGeoRectangle &rectangle)
{
// If non-intersecting goes for most narrow box
- Q_D(QGeoBoundingBox);
+ Q_D(QGeoRectangle);
double left1 = d->topLeft.longitude();
double right1 = d->bottomRight.longitude();
double top1 = d->topLeft.latitude();
double bottom1 = d->bottomRight.latitude();
- double left2 = boundingBox.d_func()->topLeft.longitude();
- double right2 = boundingBox.d_func()->bottomRight.longitude();
- double top2 = boundingBox.d_func()->topLeft.latitude();
- double bottom2 = boundingBox.d_func()->bottomRight.latitude();
+ double left2 = rectangle.d_func()->topLeft.longitude();
+ double right2 = rectangle.d_func()->bottomRight.longitude();
+ double top2 = rectangle.d_func()->topLeft.latitude();
+ double bottom2 = rectangle.d_func()->bottomRight.latitude();
double top = qMax(top1, top2);
double bottom = qMin(bottom1, bottom2);
@@ -865,36 +861,36 @@ QGeoBoundingBox &QGeoBoundingBox::operator |= (const QGeoBoundingBox & boundingB
/*******************************************************************************
*******************************************************************************/
-QGeoBoundingBoxPrivate::QGeoBoundingBoxPrivate()
-: QGeoBoundingAreaPrivate(QGeoBoundingArea::BoxType)
+QGeoRectanglePrivate::QGeoRectanglePrivate()
+: QGeoShapePrivate(QGeoShape::RectangleType)
{
}
-QGeoBoundingBoxPrivate::QGeoBoundingBoxPrivate(const QGeoCoordinate &topLeft,
+QGeoRectanglePrivate::QGeoRectanglePrivate(const QGeoCoordinate &topLeft,
const QGeoCoordinate &bottomRight)
-: QGeoBoundingAreaPrivate(QGeoBoundingArea::BoxType), topLeft(topLeft), bottomRight(bottomRight)
+: QGeoShapePrivate(QGeoShape::RectangleType), topLeft(topLeft), bottomRight(bottomRight)
{
}
-QGeoBoundingBoxPrivate::QGeoBoundingBoxPrivate(const QGeoBoundingBoxPrivate &other)
-: QGeoBoundingAreaPrivate(QGeoBoundingArea::BoxType), topLeft(other.topLeft),
+QGeoRectanglePrivate::QGeoRectanglePrivate(const QGeoRectanglePrivate &other)
+: QGeoShapePrivate(QGeoShape::RectangleType), topLeft(other.topLeft),
bottomRight(other.bottomRight)
{
}
-QGeoBoundingBoxPrivate::~QGeoBoundingBoxPrivate() {}
+QGeoRectanglePrivate::~QGeoRectanglePrivate() {}
-QGeoBoundingAreaPrivate *QGeoBoundingBoxPrivate::clone() const
+QGeoShapePrivate *QGeoRectanglePrivate::clone() const
{
- return new QGeoBoundingBoxPrivate(*this);
+ return new QGeoRectanglePrivate(*this);
}
-bool QGeoBoundingBoxPrivate::operator==(const QGeoBoundingAreaPrivate &other) const
+bool QGeoRectanglePrivate::operator==(const QGeoShapePrivate &other) const
{
- if (!QGeoBoundingAreaPrivate::operator==(other))
+ if (!QGeoShapePrivate::operator==(other))
return false;
- const QGeoBoundingBoxPrivate &otherBox = static_cast<const QGeoBoundingBoxPrivate &>(other);
+ const QGeoRectanglePrivate &otherBox = static_cast<const QGeoRectanglePrivate &>(other);
return topLeft == otherBox.topLeft && bottomRight == otherBox.bottomRight;
}
diff --git a/src/location/qgeoboundingbox.h b/src/location/qgeorectangle.h
index 46941c53..f031ab0b 100644
--- a/src/location/qgeoboundingbox.h
+++ b/src/location/qgeorectangle.h
@@ -39,50 +39,50 @@
**
****************************************************************************/
-#ifndef QGEOBOUNDINGBOX_H
-#define QGEOBOUNDINGBOX_H
+#ifndef QGEORECTANGLE_H
+#define QGEORECTANGLE_H
-#include <QtLocation/QGeoBoundingArea>
+#include <QtLocation/QGeoShape>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QGeoCoordinate;
-class QGeoBoundingBoxPrivate;
+class QGeoRectanglePrivate;
-class Q_LOCATION_EXPORT QGeoBoundingBox : public QGeoBoundingArea
+class Q_LOCATION_EXPORT QGeoRectangle : public QGeoShape
{
public:
- QGeoBoundingBox();
- QGeoBoundingBox(const QGeoCoordinate &center, double degreesWidth, double degreesHeight);
- QGeoBoundingBox(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
- QGeoBoundingBox(const QGeoBoundingBox &other);
- QGeoBoundingBox(const QGeoBoundingArea &other);
+ QGeoRectangle();
+ QGeoRectangle(const QGeoCoordinate &center, double degreesWidth, double degreesHeight);
+ QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
+ QGeoRectangle(const QGeoRectangle &other);
+ QGeoRectangle(const QGeoShape &other);
- ~QGeoBoundingBox();
+ ~QGeoRectangle();
- QGeoBoundingBox &operator = (const QGeoBoundingBox &other);
+ QGeoRectangle &operator=(const QGeoRectangle &other);
#ifdef Q_NO_USING_KEYWORD
- bool operator==(const QGeoBoundingArea &other) const
+ bool operator==(const QGeoShape &other) const
{
- return QGeoBoundingArea::operator==(other);
+ return QGeoShape::operator==(other);
}
#else
- using QGeoBoundingArea::operator==;
+ using QGeoShape::operator==;
#endif
- bool operator==(const QGeoBoundingBox &other) const;
+ bool operator==(const QGeoRectangle &other) const;
#ifdef Q_NO_USING_KEYWORD
- bool operator!=(const QGeoBoundingArea &other) const
+ bool operator!=(const QGeoShape &other) const
{
- return QGeoBoundingArea::operator!=(other);
+ return QGeoShape::operator!=(other);
}
#else
- using QGeoBoundingArea::operator!=;
+ using QGeoShape::operator!=;
#endif
- bool operator!=(const QGeoBoundingBox &other) const;
+ bool operator!=(const QGeoRectangle &other) const;
void setTopLeft(const QGeoCoordinate &topLeft);
QGeoCoordinate topLeft() const;
@@ -108,34 +108,34 @@ public:
#ifdef Q_NO_USING_KEYWORD
bool contains(const QGeoCoordinate &coordinate) const
{
- return QGeoBoundingArea::contains(coordinate);
+ return QGeoShape::contains(coordinate);
}
#else
- using QGeoBoundingArea::contains;
+ using QGeoShape::contains;
#endif
- bool contains(const QGeoBoundingBox &boundingBox) const;
- bool intersects(const QGeoBoundingBox &boundingBox) const;
+ bool contains(const QGeoRectangle &rectangle) const;
+ bool intersects(const QGeoRectangle &rectangle) const;
void translate(double degreesLatitude, double degreesLongitude);
- QGeoBoundingBox translated(double degreesLatitude, double degreesLongitude) const;
+ QGeoRectangle translated(double degreesLatitude, double degreesLongitude) const;
- QGeoBoundingBox united(const QGeoBoundingBox &boundingBox) const;
- QGeoBoundingBox operator | (const QGeoBoundingBox &boundingBox) const;
- QGeoBoundingBox &operator |= (const QGeoBoundingBox &boundingBox);
+ QGeoRectangle united(const QGeoRectangle &rectangle) const;
+ QGeoRectangle operator|(const QGeoRectangle &rectangle) const;
+ QGeoRectangle &operator|=(const QGeoRectangle &rectangle);
private:
- inline QGeoBoundingBoxPrivate *d_func();
- inline const QGeoBoundingBoxPrivate *d_func() const;
+ inline QGeoRectanglePrivate *d_func();
+ inline const QGeoRectanglePrivate *d_func() const;
};
-inline QGeoBoundingBox QGeoBoundingBox::operator | (const QGeoBoundingBox &boundingBox) const
+inline QGeoRectangle QGeoRectangle::operator|(const QGeoRectangle &rectangle) const
{
- return united(boundingBox);
+ return united(rectangle);
}
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QGeoBoundingBox)
+Q_DECLARE_METATYPE(QGeoRectangle)
QT_END_HEADER
diff --git a/src/location/qgeoboundingbox_p.h b/src/location/qgeorectangle_p.h
index 2c956ba1..9499eaed 100644
--- a/src/location/qgeoboundingbox_p.h
+++ b/src/location/qgeorectangle_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOBOUNDINGBOX_P_H
-#define QGEOBOUNDINGBOX_P_H
+#ifndef QGEORECTANGLE_P_H
+#define QGEORECTANGLE_P_H
//
// W A R N I N G
@@ -53,26 +53,26 @@
// We mean it.
//
-#include "qgeoboundingarea_p.h"
+#include "qgeoshape_p.h"
#include "qgeocoordinate.h"
QT_BEGIN_NAMESPACE
-class QGeoBoundingBoxPrivate : public QGeoBoundingAreaPrivate
+class QGeoRectanglePrivate : public QGeoShapePrivate
{
public:
- QGeoBoundingBoxPrivate();
- QGeoBoundingBoxPrivate(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
- QGeoBoundingBoxPrivate(const QGeoBoundingBoxPrivate &other);
- ~QGeoBoundingBoxPrivate();
+ QGeoRectanglePrivate();
+ QGeoRectanglePrivate(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
+ QGeoRectanglePrivate(const QGeoRectanglePrivate &other);
+ ~QGeoRectanglePrivate();
bool isValid() const;
bool isEmpty() const;
bool contains(const QGeoCoordinate &coordinate) const;
- QGeoBoundingAreaPrivate *clone() const;
+ QGeoShapePrivate *clone() const;
- bool operator==(const QGeoBoundingAreaPrivate &other) const;
+ bool operator==(const QGeoShapePrivate &other) const;
QGeoCoordinate topLeft;
QGeoCoordinate bottomRight;
diff --git a/src/location/qgeoboundingarea.cpp b/src/location/qgeoshape.cpp
index ffc90992..2c47fdde 100644
--- a/src/location/qgeoboundingarea.cpp
+++ b/src/location/qgeoshape.cpp
@@ -39,32 +39,32 @@
**
****************************************************************************/
-#include "qgeoboundingarea.h"
-#include "qgeoboundingarea_p.h"
+#include "qgeoshape.h"
+#include "qgeoshape_p.h"
QT_BEGIN_NAMESPACE
-QGeoBoundingAreaPrivate::QGeoBoundingAreaPrivate(QGeoBoundingArea::AreaType type)
+QGeoShapePrivate::QGeoShapePrivate(QGeoShape::ShapeType type)
: type(type)
{
}
-QGeoBoundingAreaPrivate::~QGeoBoundingAreaPrivate()
+QGeoShapePrivate::~QGeoShapePrivate()
{
}
-bool QGeoBoundingAreaPrivate::operator==(const QGeoBoundingAreaPrivate &other) const
+bool QGeoShapePrivate::operator==(const QGeoShapePrivate &other) const
{
return type == other.type;
}
/*!
- \class QGeoBoundingArea
+ \class QGeoShape
\inmodule QtLocation
\ingroup QtLocation-positioning
\since Qt Location 5.0
- \brief The QGeoBoundingArea class defines a geographic area.
+ \brief The QGeoShape class defines a geographic area.
This class is the base class for classes which specify a geographic
area.
@@ -75,36 +75,36 @@ bool QGeoBoundingAreaPrivate::operator==(const QGeoBoundingAreaPrivate &other) c
*/
/*!
- \enum QGeoBoundingArea::AreaType
+ \enum QGeoShape::ShapeType
- Describes the type of a bounding area.
+ Describes the type of the shape.
- \value UnknownType A bounding area of unknown type.
- \value BoxType A box shaped bounding area.
- \value CircleType A circular bounding area.
+ \value UnknownType A shape of unknown type.
+ \value RectangleType A rectangular shape.
+ \value CircleType A circular shape.
*/
-inline QGeoBoundingAreaPrivate *QGeoBoundingArea::d_func()
+inline QGeoShapePrivate *QGeoShape::d_func()
{
- return static_cast<QGeoBoundingAreaPrivate *>(d_ptr.data());
+ return static_cast<QGeoShapePrivate *>(d_ptr.data());
}
-inline const QGeoBoundingAreaPrivate *QGeoBoundingArea::d_func() const
+inline const QGeoShapePrivate *QGeoShape::d_func() const
{
- return static_cast<const QGeoBoundingAreaPrivate *>(d_ptr.constData());
+ return static_cast<const QGeoShapePrivate *>(d_ptr.constData());
}
/*!
- Constructs a new invalid bounding area of \l UnknownType.
+ Constructs a new invalid geo shape of \l UnknownType.
*/
-QGeoBoundingArea::QGeoBoundingArea()
+QGeoShape::QGeoShape()
{
}
/*!
- Constructs a new bounding area which is a copy of \a other.
+ Constructs a new geo shape which is a copy of \a other.
*/
-QGeoBoundingArea::QGeoBoundingArea(const QGeoBoundingArea &other)
+QGeoShape::QGeoShape(const QGeoShape &other)
: d_ptr(other.d_ptr)
{
}
@@ -112,24 +112,24 @@ QGeoBoundingArea::QGeoBoundingArea(const QGeoBoundingArea &other)
/*!
\internal
*/
-QGeoBoundingArea::QGeoBoundingArea(QGeoBoundingAreaPrivate *d)
+QGeoShape::QGeoShape(QGeoShapePrivate *d)
: d_ptr(d)
{
}
/*!
- Destroys this bounding area.
+ Destroys this geo shape.
*/
-QGeoBoundingArea::~QGeoBoundingArea()
+QGeoShape::~QGeoShape()
{
}
/*!
- Returns the type of this area.
+ Returns the type of this geo shape.
*/
-QGeoBoundingArea::AreaType QGeoBoundingArea::type() const
+QGeoShape::ShapeType QGeoShape::type() const
{
- Q_D(const QGeoBoundingArea);
+ Q_D(const QGeoShape);
if (d)
return d->type;
@@ -138,15 +138,15 @@ QGeoBoundingArea::AreaType QGeoBoundingArea::type() const
}
/*!
- Returns whether this bounding area is valid.
+ Returns whether this geo shape is valid.
- An area is considered to be invalid if some of the data that is required to
- unambiguously describe the area has not been set or has been set to an
+ An geo shape is considered to be invalid if some of the data that is required to
+ unambiguously describe the geo shape has not been set or has been set to an
unsuitable value.
*/
-bool QGeoBoundingArea::isValid() const
+bool QGeoShape::isValid() const
{
- Q_D(const QGeoBoundingArea);
+ Q_D(const QGeoShape);
if (d)
return d->isValid();
@@ -155,13 +155,13 @@ bool QGeoBoundingArea::isValid() const
}
/*!
- Returns whether this bounding area is empty.
+ Returns whether this geo shape is empty.
- An empty area is a region which has a geometrical area of 0.
+ An empty geo shape is a region which has a geometrical area of 0.
*/
-bool QGeoBoundingArea::isEmpty() const
+bool QGeoShape::isEmpty() const
{
- Q_D(const QGeoBoundingArea);
+ Q_D(const QGeoShape);
if (d)
return d->isEmpty();
@@ -170,11 +170,11 @@ bool QGeoBoundingArea::isEmpty() const
}
/*!
- Returns whether the coordinate \a coordinate is contained within this area.
+ Returns whether the coordinate \a coordinate is contained within this geo shape.
*/
-bool QGeoBoundingArea::contains(const QGeoCoordinate &coordinate) const
+bool QGeoShape::contains(const QGeoCoordinate &coordinate) const
{
- Q_D(const QGeoBoundingArea);
+ Q_D(const QGeoShape);
if (d)
return d->contains(coordinate);
@@ -184,12 +184,12 @@ bool QGeoBoundingArea::contains(const QGeoCoordinate &coordinate) const
/*!
- Returns true if the \a other bounding area is equivalent to this bounding area, otherwise
- returns false
+ Returns true if the \a other geo shape is equivalent to this geo shape, otherwise returns
+ false.
*/
-bool QGeoBoundingArea::operator==(const QGeoBoundingArea &other) const
+bool QGeoShape::operator==(const QGeoShape &other) const
{
- Q_D(const QGeoBoundingArea);
+ Q_D(const QGeoShape);
if (d == other.d_func())
return true;
@@ -201,18 +201,18 @@ bool QGeoBoundingArea::operator==(const QGeoBoundingArea &other) const
}
/*!
- Returns true if the \a other bounding area is not equivalent to this bounding area, otherwise
- returns false.
+ Returns true if the \a other geo shape is not equivalent to this geo shape, otherwise returns
+ false.
*/
-bool QGeoBoundingArea::operator!=(const QGeoBoundingArea &other) const
+bool QGeoShape::operator!=(const QGeoShape &other) const
{
return !(*this == other);
}
/*!
- Assigns \a other to this bounding area and returns a reference to this bounding area.
+ Assigns \a other to this geo shape and returns a reference to this geo shape.
*/
-QGeoBoundingArea &QGeoBoundingArea::operator=(const QGeoBoundingArea &other)
+QGeoShape &QGeoShape::operator=(const QGeoShape &other)
{
if (this == &other)
return *this;
diff --git a/src/location/qgeoboundingarea.h b/src/location/qgeoshape.h
index e1b8c8f2..28a87ae3 100644
--- a/src/location/qgeoboundingarea.h
+++ b/src/location/qgeoshape.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOBOUNDINGAREA_H
-#define QGEOBOUNDINGAREA_H
+#ifndef QGEOSHAPE_H
+#define QGEOSHAPE_H
#include <QtCore/QSharedDataPointer>
#include <QtLocation/QGeoCoordinate>
@@ -49,46 +49,47 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QGeoBoundingAreaPrivate;
+class QGeoShapePrivate;
-class Q_LOCATION_EXPORT QGeoBoundingArea
+class Q_LOCATION_EXPORT QGeoShape
{
public:
- QGeoBoundingArea();
- QGeoBoundingArea(const QGeoBoundingArea &other);
- ~QGeoBoundingArea();
+ QGeoShape();
+ QGeoShape(const QGeoShape &other);
+ ~QGeoShape();
- enum AreaType {
+ enum ShapeType {
UnknownType,
- BoxType,
+ RectangleType,
CircleType
};
- AreaType type() const;
+ ShapeType type() const;
bool isValid() const;
bool isEmpty() const;
bool contains(const QGeoCoordinate &coordinate) const;
- bool operator==(const QGeoBoundingArea &other) const;
- bool operator!=(const QGeoBoundingArea &other) const;
+ bool operator==(const QGeoShape &other) const;
+ bool operator!=(const QGeoShape &other) const;
- QGeoBoundingArea &operator=(const QGeoBoundingArea &other);
+ QGeoShape &operator=(const QGeoShape &other);
protected:
- QGeoBoundingArea(QGeoBoundingAreaPrivate *d);
+ QGeoShape(QGeoShapePrivate *d);
- QSharedDataPointer<QGeoBoundingAreaPrivate> d_ptr;
+ QSharedDataPointer<QGeoShapePrivate> d_ptr;
private:
- inline QGeoBoundingAreaPrivate *d_func();
- inline const QGeoBoundingAreaPrivate *d_func() const;
+ inline QGeoShapePrivate *d_func();
+ inline const QGeoShapePrivate *d_func() const;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QGeoBoundingArea)
+Q_DECLARE_METATYPE(QGeoShape)
QT_END_HEADER
-#endif // QGEOBOUNDINGAREA_H
+#endif
+
diff --git a/src/location/qgeoboundingarea_p.h b/src/location/qgeoshape_p.h
index 12387d94..805a7cfe 100644
--- a/src/location/qgeoboundingarea_p.h
+++ b/src/location/qgeoshape_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOBOUNDINGAREA_P_H
-#define QGEOBOUNDINGAREA_P_H
+#ifndef QGEOSHAPE_P_H
+#define QGEOSHAPE_P_H
//
// W A R N I N G
@@ -55,35 +55,36 @@
#include <QtCore/QSharedData>
-#include "qgeoboundingarea.h"
+#include "qgeoshape.h"
QT_BEGIN_NAMESPACE
-class QGeoBoundingAreaPrivate : public QSharedData
+class QGeoShapePrivate : public QSharedData
{
public:
- explicit QGeoBoundingAreaPrivate(QGeoBoundingArea::AreaType type);
- virtual ~QGeoBoundingAreaPrivate();
+ explicit QGeoShapePrivate(QGeoShape::ShapeType type);
+ virtual ~QGeoShapePrivate();
virtual bool isValid() const = 0;
virtual bool isEmpty() const = 0;
virtual bool contains(const QGeoCoordinate &coordinate) const = 0;
- virtual QGeoBoundingAreaPrivate *clone() const = 0;
+ virtual QGeoShapePrivate *clone() const = 0;
- virtual bool operator==(const QGeoBoundingAreaPrivate &other) const;
+ virtual bool operator==(const QGeoShapePrivate &other) const;
- QGeoBoundingArea::AreaType type;
+ QGeoShape::ShapeType type;
};
// don't use the copy constructor when detaching from a QSharedDataPointer, use virtual clone()
// call instead.
template <>
-Q_INLINE_TEMPLATE QGeoBoundingAreaPrivate *QSharedDataPointer<QGeoBoundingAreaPrivate>::clone()
+Q_INLINE_TEMPLATE QGeoShapePrivate *QSharedDataPointer<QGeoShapePrivate>::clone()
{
return d->clone();
}
QT_END_NAMESPACE
-#endif // QGEOBOUNDINGAREA_P_H
+#endif
+