summaryrefslogtreecommitdiff
path: root/src
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
parent4b10442e2e83bf7440837e469af344579d1ad9d5 (diff)
downloadqtlocation-6b68304f59de5fa3f6c861186d98b0c7fe54a4ba.tar.gz
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')
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativeplace.cpp3
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp8
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp6
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h10
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp11
-rw-r--r--src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp6
-rw-r--r--src/imports/location/location.cpp16
-rw-r--r--src/imports/location/location.pro12
-rw-r--r--src/imports/location/plugins.qmltypes82
-rw-r--r--src/imports/location/qdeclarativegeocircle.cpp (renamed from src/imports/location/qdeclarativegeoboundingcircle.cpp)58
-rw-r--r--src/imports/location/qdeclarativegeocircle.h (renamed from src/imports/location/qdeclarativegeoboundingcircle_p.h)30
-rw-r--r--src/imports/location/qdeclarativegeocodemodel.cpp20
-rw-r--r--src/imports/location/qdeclarativegeocodemodel_p.h8
-rw-r--r--src/imports/location/qdeclarativegeolocation.cpp23
-rw-r--r--src/imports/location/qdeclarativegeolocation_p.h10
-rw-r--r--src/imports/location/qdeclarativegeorectangle.cpp (renamed from src/imports/location/qdeclarativegeoboundingbox.cpp)134
-rw-r--r--src/imports/location/qdeclarativegeorectangle.h (renamed from src/imports/location/qdeclarativegeoboundingbox_p.h)31
-rw-r--r--src/imports/location/qdeclarativegeoroute.cpp6
-rw-r--r--src/imports/location/qdeclarativegeoroute_p.h8
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel.cpp26
-rw-r--r--src/imports/location/qdeclarativegeoroutemodel_p.h20
-rw-r--r--src/imports/location/qdeclarativegeoshape.cpp (renamed from src/imports/location/qdeclarativegeoboundingarea.cpp)12
-rw-r--r--src/imports/location/qdeclarativegeoshape.h (renamed from src/imports/location/qdeclarativegeoboundingarea_p.h)19
-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
-rw-r--r--src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp2
-rw-r--r--src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp2
-rw-r--r--src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp6
-rw-r--r--src/plugins/geoservices/nokia/qgeocodereply_nokia.h2
-rw-r--r--src/plugins/geoservices/nokia/qgeocodexmlparser.cpp9
-rw-r--r--src/plugins/geoservices/nokia/qgeocodexmlparser.h4
-rw-r--r--src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp8
-rw-r--r--src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h8
-rw-r--r--src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp8
-rw-r--r--src/plugins/geoservices/nokia/qgeoroutexmlparser.h4
-rw-r--r--src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp10
-rw-r--r--src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp6
-rw-r--r--src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h4
-rw-r--r--src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp14
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/jsondb.cpp6
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/matchreply.cpp2
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp2
-rw-r--r--src/plugins/geoservices/nokia_places_jsondb/searchreply.cpp22
74 files changed, 1074 insertions, 1095 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
index 6197d62c..19feb709 100644
--- a/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativeplace.cpp
@@ -441,7 +441,8 @@ QPlace QDeclarativePlace::place()
/*!
\qmlproperty QtLocation5::Location Place::location
- This property holds the location of the place which can be used to retrieve the coordinate, address and the BoundingBox.
+ This property holds the location of the place which can be used to retrieve the coordinate,
+ address and the bounding box.
*/
void QDeclarativePlace::setLocation(QDeclarativeGeoLocation *location)
{
diff --git a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp
index 68897fe9..9330e97e 100644
--- a/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativerecommendationmodel.cpp
@@ -157,18 +157,18 @@ QT_USE_NAMESPACE
*/
/*!
- \qmlproperty BoundingArea PlaceRecommendationModel::searchArea
+ \qmlproperty GeoShape PlaceRecommendationModel::searchArea
This property holds the search area. Search results returned by the model will be within the
search area.
- If this property is set to a \l BoundingCircle its \l {BoundingCircle::radius}{radius} property
+ If this property is set to a \l GeoCircle its \l {GeoCircle::radius}{radius} property
may be left unset, in which case the \l Plugin will choose an appropriate radius for the
search.
Support for specifying a search area can vary according according to the \l plugin backend
- implementation. For example, some may support a search center only while others may only support
- bounding boxes.
+ implementation. For example, some may support a search center only while others may only
+ support geo rectangles.
*/
/*!
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
index daa378bd..036ba0dd 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.cpp
@@ -84,7 +84,7 @@ void QDeclarativeSearchModelBase::setPlugin(QDeclarativeGeoServiceProvider *plug
/*!
\internal
*/
-QDeclarativeGeoBoundingArea *QDeclarativeSearchModelBase::searchArea() const
+QDeclarativeGeoShape *QDeclarativeSearchModelBase::searchArea() const
{
return m_searchArea;
}
@@ -92,7 +92,7 @@ QDeclarativeGeoBoundingArea *QDeclarativeSearchModelBase::searchArea() const
/*!
\internal
*/
-void QDeclarativeSearchModelBase::setSearchArea(QDeclarativeGeoBoundingArea *searchArea)
+void QDeclarativeSearchModelBase::setSearchArea(QDeclarativeGeoShape *searchArea)
{
if (m_searchArea == searchArea)
return;
@@ -248,7 +248,7 @@ void QDeclarativeSearchModelBase::clearData()
void QDeclarativeSearchModelBase::updateSearchRequest()
{
if (m_searchArea)
- m_request.setSearchArea(m_searchArea->area());
+ m_request.setSearchArea(m_searchArea->shape());
}
/*!
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h
index 7b47ae90..a9da6aa1 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchmodelbase.h
@@ -56,14 +56,14 @@ class QPlaceManager;
class QPlaceSearchRequest;
class QPlaceSearchReply;
class QDeclarativePlace;
-class QDeclarativeGeoBoundingArea;
+class QDeclarativeGeoShape;
class QDeclarativeSearchModelBase : public QAbstractListModel, public QQmlParserStatus
{
Q_OBJECT
Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
- Q_PROPERTY(QDeclarativeGeoBoundingArea *searchArea READ searchArea WRITE setSearchArea NOTIFY searchAreaChanged)
+ Q_PROPERTY(QDeclarativeGeoShape *searchArea READ searchArea WRITE setSearchArea NOTIFY searchAreaChanged)
Q_PROPERTY(int offset READ offset WRITE setOffset NOTIFY offsetChanged)
Q_PROPERTY(int limit READ limit WRITE setLimit NOTIFY limitChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
@@ -86,8 +86,8 @@ public:
QDeclarativeGeoServiceProvider *plugin() const;
void setPlugin(QDeclarativeGeoServiceProvider *plugin);
- QDeclarativeGeoBoundingArea *searchArea() const;
- void setSearchArea(QDeclarativeGeoBoundingArea *searchArea);
+ QDeclarativeGeoShape *searchArea() const;
+ void setSearchArea(QDeclarativeGeoShape *searchArea);
int offset() const;
void setOffset(int offset);
@@ -136,7 +136,7 @@ protected:
QPlaceReply *m_reply;
private:
- QDeclarativeGeoBoundingArea *m_searchArea;
+ QDeclarativeGeoShape *m_searchArea;
bool m_complete;
Status m_status;
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
index 8f437ed9..6eaa4f44 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchresultmodel.cpp
@@ -197,17 +197,18 @@ QT_USE_NAMESPACE
*/
/*!
- \qmlproperty BoundingArea PlaceSearchModel::searchArea
+ \qmlproperty GeoShape PlaceSearchModel::searchArea
This property holds the search area. The search result returned by the model will be within
the search area.
- If this property is set to a \l BoundingCircle its \l {BoundingCircle::radius}{radius} property
+ If this property is set to a \l GeoCircle its \l {GeoCircle::radius}{radius} property
may be left unset, in which case the \l Plugin will choose an appropriate radius for the
search.
- Support for specifying a search area can vary according to the \l plugin backend implementation.
- For example, some may support a search center only while others may only support bounding boxes.
+ Support for specifying a search area can vary according to the \l plugin backend
+ implementation. For example, some may support a search center only while others may only
+ support geo rectangles.
*/
/*!
@@ -262,7 +263,7 @@ QT_USE_NAMESPACE
\c PlaceSearchModel.Error and the model cleared.
\code
- BoundingCircle {
+ GeoCircle {
id: searchLocation
center: Coordinate {
latitude: 10
diff --git a/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
index 08a7decb..15bf07a5 100644
--- a/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
+++ b/src/imports/location/declarativeplaces/qdeclarativesearchsuggestionmodel.cpp
@@ -105,12 +105,12 @@ QT_USE_NAMESPACE
*/
/*!
- \qmlproperty BoundingArea PlaceSearchSuggestionModel::searchArea
+ \qmlproperty GeoShape PlaceSearchSuggestionModel::searchArea
This property holds the search area. Search suggestion results returned by the model will be
relevant to the given search area.
- If this property is set to a \l BoundingCircle its \l {BoundingCircle::radius}{radius} property
+ If this property is set to a \l GeoCircle its \l {GeoCircle::radius}{radius} property
may be left unset, in which case the \l Plugin will choose an appropriate radius for the
search.
*/
@@ -168,7 +168,7 @@ QT_USE_NAMESPACE
This example shows use of the model
\code
- BoundingCircle {
+ GeoCircle {
id: searchLocation
center: Coordinate {
latitude: 10
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp
index 9b6e0b67..24bcb188 100644
--- a/src/imports/location/location.cpp
+++ b/src/imports/location/location.cpp
@@ -42,9 +42,9 @@
#include "qdeclarativepositionsource_p.h"
#include "qdeclarativeposition_p.h"
-#include "qdeclarativegeoboundingarea_p.h"
-#include "qdeclarativegeoboundingbox_p.h"
-#include "qdeclarativegeoboundingcircle_p.h"
+#include "qdeclarativegeoshape.h"
+#include "qdeclarativegeorectangle.h"
+#include "qdeclarativegeocircle.h"
#include "qdeclarativegeoaddress_p.h"
#include "qdeclarativecoordinate_p.h"
@@ -113,9 +113,9 @@ public:
qmlRegisterType<QDeclarativePosition>(uri, 5, 0, "Position");
qmlRegisterType<QDeclarativePositionSource>(uri, 5, 0, "PositionSource");
qmlRegisterType<QDeclarativeCoordinate>(uri, 5, 0, "Coordinate");
- qmlRegisterUncreatableType<QDeclarativeGeoBoundingArea>(uri, 5, 0, "BoundingArea", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Positioning)BoundingArea"));
- qmlRegisterType<QDeclarativeGeoBoundingBox>(uri, 5, 0, "BoundingBox");
- qmlRegisterType<QDeclarativeGeoBoundingCircle>(uri, 5, 0, "BoundingCircle");
+ qmlRegisterUncreatableType<QDeclarativeGeoShape>(uri, 5, 0, "GeoShape", QCoreApplication::translate(CONTEXT_NAME, NOT_INSTANTIABLE_BY_DEVELOPER).arg("(Positioning)GeoShape"));
+ qmlRegisterType<QDeclarativeGeoRectangle>(uri, 5, 0, "GeoRectangle");
+ qmlRegisterType<QDeclarativeGeoCircle>(uri, 5, 0, "GeoCircle");
qmlRegisterType<QDeclarativeGeoAddress>(uri, 5, 0, "Address");
qmlRegisterType<QDeclarativeGeoServiceProvider>(uri, 5, 0, "Plugin");
@@ -166,8 +166,8 @@ public:
qRegisterMetaType<QGeoCoordinate>("QGeoCoordinate");
qRegisterMetaType<QGeoAddress>("QGeoAddress");
- qRegisterMetaType<QGeoBoundingBox>("QGeoBoundingBox");
- qRegisterMetaType<QGeoBoundingCircle>("QGeoBoundingCircle");
+ qRegisterMetaType<QGeoRectangle>("QGeoRectangle");
+ qRegisterMetaType<QGeoCircle>("QGeoCircle");
qRegisterMetaType<QGeoLocation>("QGeoLocation");
qRegisterMetaType<QPlaceCategory>("QPlaceCategory");
qRegisterMetaType<QPlace>("QPlace");
diff --git a/src/imports/location/location.pro b/src/imports/location/location.pro
index 068980c0..a2b43169 100644
--- a/src/imports/location/location.pro
+++ b/src/imports/location/location.pro
@@ -36,14 +36,14 @@ HEADERS += qdeclarativeposition_p.h \
qdeclarativegeomapmousearea_p.h \
qdeclarativegeoserviceprovider_p.h \
qdeclarativegeoaddress_p.h \
- qdeclarativegeoboundingarea_p.h \
- qdeclarativegeoboundingbox_p.h \
+ qdeclarativegeoshape.h \
+ qdeclarativegeorectangle.h \
+ qdeclarativegeocircle.h \
qdeclarativegeocodemodel_p.h \
qdeclarativegeoroutemodel_p.h \
qdeclarativegeoroute_p.h \
qdeclarativegeoroutesegment_p.h \
qdeclarativegeomaneuver_p.h \
- qdeclarativegeoboundingcircle_p.h \
qdeclarativegeomap_p.h \
qdeclarativegeomapflickable_p.h \
qdeclarativegeomappincharea_p.h \
@@ -71,14 +71,14 @@ SOURCES += qdeclarativeposition.cpp \
qdeclarativegeomapmousearea.cpp \
qdeclarativegeoserviceprovider.cpp \
qdeclarativegeoaddress.cpp \
- qdeclarativegeoboundingarea.cpp \
- qdeclarativegeoboundingbox.cpp \
+ qdeclarativegeoshape.cpp \
+ qdeclarativegeorectangle.cpp \
+ qdeclarativegeocircle.cpp \
qdeclarativegeocodemodel.cpp \
qdeclarativegeoroutemodel.cpp \
qdeclarativegeoroute.cpp \
qdeclarativegeoroutesegment.cpp \
qdeclarativegeomaneuver.cpp \
- qdeclarativegeoboundingcircle.cpp \
qdeclarativegeomap.cpp \
qdeclarativegeomapflickable.cpp \
qdeclarativegeomappincharea.cpp \
diff --git a/src/imports/location/plugins.qmltypes b/src/imports/location/plugins.qmltypes
index 75f2fbc6..f8c512db 100644
--- a/src/imports/location/plugins.qmltypes
+++ b/src/imports/location/plugins.qmltypes
@@ -12,7 +12,7 @@ Module {
type: "void"
Parameter { name: "topLeft"; type: "QModelIndex" }
Parameter { name: "bottomRight"; type: "QModelIndex" }
- Parameter { name: "roles"; type: "QSet<int>" }
+ Parameter { name: "roles"; type: "QVector<int>" }
}
Signal {
name: "dataChanged"
@@ -299,40 +299,10 @@ Module {
Signal { name: "isTextGeneratedChanged"; type: "void" }
}
Component {
- name: "QDeclarativeGeoBoundingArea"
- prototype: "QObject"
- exports: ["BoundingArea 5.0"]
- }
- Component {
- name: "QDeclarativeGeoBoundingBox"
- prototype: "QDeclarativeGeoBoundingArea"
- exports: ["BoundingBox 5.0"]
- Property { name: "box"; type: "QGeoBoundingBox" }
- Property { name: "bottomLeft"; type: "QDeclarativeCoordinate"; isPointer: true }
- Property { name: "bottomRight"; type: "QDeclarativeCoordinate"; isPointer: true }
- Property { name: "topLeft"; type: "QDeclarativeCoordinate"; isPointer: true }
- Property { name: "topRight"; type: "QDeclarativeCoordinate"; isPointer: true }
- Property { name: "center"; type: "QDeclarativeCoordinate"; isPointer: true }
- Property { name: "height"; type: "double" }
- Property { name: "width"; type: "double" }
- Signal { name: "bottomLeftChanged"; type: "void" }
- Signal { name: "bottomRightChanged"; type: "void" }
- Signal { name: "topLeftChanged"; type: "void" }
- Signal { name: "topRightChanged"; type: "void" }
- Signal { name: "centerChanged"; type: "void" }
- Signal { name: "heightChanged"; type: "void" }
- Signal { name: "widthChanged"; type: "void" }
- Method {
- name: "contains"
- type: "bool"
- Parameter { name: "coordinate"; type: "QDeclarativeCoordinate"; isPointer: true }
- }
- }
- Component {
- name: "QDeclarativeGeoBoundingCircle"
- prototype: "QDeclarativeGeoBoundingArea"
- exports: ["BoundingCircle 5.0"]
- Property { name: "circle"; type: "QGeoBoundingCircle" }
+ name: "QDeclarativeGeoCircle"
+ prototype: "QDeclarativeGeoShape"
+ exports: ["GeoCircle 5.0"]
+ Property { name: "circle"; type: "QGeoCircle" }
Property { name: "center"; type: "QDeclarativeCoordinate"; isPointer: true }
Property { name: "radius"; type: "double" }
Signal { name: "centerChanged"; type: "void" }
@@ -350,7 +320,7 @@ Module {
Property { name: "location"; type: "QGeoLocation" }
Property { name: "address"; type: "QDeclarativeGeoAddress"; isPointer: true }
Property { name: "coordinate"; type: "QDeclarativeCoordinate"; isPointer: true }
- Property { name: "boundingBox"; type: "QDeclarativeGeoBoundingBox"; isPointer: true }
+ Property { name: "boundingBox"; type: "QDeclarativeGeoRectangle"; isPointer: true }
Signal { name: "addressChanged"; type: "void" }
Signal { name: "coordinateChanged"; type: "void" }
Signal { name: "boundingBoxChanged"; type: "void" }
@@ -693,10 +663,35 @@ Module {
Property { name: "mobile"; type: "bool"; isReadonly: true }
}
Component {
+ name: "QDeclarativeGeoRectangle"
+ prototype: "QDeclarativeGeoShape"
+ exports: ["GeoRectangle 5.0"]
+ Property { name: "rectangle"; type: "QGeoRectangle" }
+ Property { name: "bottomLeft"; type: "QDeclarativeCoordinate"; isPointer: true }
+ Property { name: "bottomRight"; type: "QDeclarativeCoordinate"; isPointer: true }
+ Property { name: "topLeft"; type: "QDeclarativeCoordinate"; isPointer: true }
+ Property { name: "topRight"; type: "QDeclarativeCoordinate"; isPointer: true }
+ Property { name: "center"; type: "QDeclarativeCoordinate"; isPointer: true }
+ Property { name: "height"; type: "double" }
+ Property { name: "width"; type: "double" }
+ Signal { name: "bottomLeftChanged"; type: "void" }
+ Signal { name: "bottomRightChanged"; type: "void" }
+ Signal { name: "topLeftChanged"; type: "void" }
+ Signal { name: "topRightChanged"; type: "void" }
+ Signal { name: "centerChanged"; type: "void" }
+ Signal { name: "heightChanged"; type: "void" }
+ Signal { name: "widthChanged"; type: "void" }
+ Method {
+ name: "contains"
+ type: "bool"
+ Parameter { name: "coordinate"; type: "QDeclarativeCoordinate"; isPointer: true }
+ }
+ }
+ Component {
name: "QDeclarativeGeoRoute"
prototype: "QObject"
exports: ["Route 5.0"]
- Property { name: "bounds"; type: "QDeclarativeGeoBoundingBox"; isReadonly: true; isPointer: true }
+ Property { name: "bounds"; type: "QDeclarativeGeoRectangle"; isReadonly: true; isPointer: true }
Property { name: "travelTime"; type: "int"; isReadonly: true }
Property { name: "distance"; type: "double"; isReadonly: true }
Property { name: "path"; type: "QDeclarativeCoordinate"; isList: true; isReadonly: true }
@@ -852,7 +847,7 @@ Module {
Property { name: "waypoints"; type: "QDeclarativeCoordinate"; isList: true; isReadonly: true }
Property {
name: "excludedAreas"
- type: "QDeclarativeGeoBoundingBox"
+ type: "QDeclarativeGeoRectangle"
isList: true
isReadonly: true
}
@@ -880,12 +875,12 @@ Module {
Method {
name: "addExcludedArea"
type: "void"
- Parameter { name: "area"; type: "QDeclarativeGeoBoundingBox"; isPointer: true }
+ Parameter { name: "area"; type: "QDeclarativeGeoRectangle"; isPointer: true }
}
Method {
name: "removeExcludedArea"
type: "void"
- Parameter { name: "area"; type: "QDeclarativeGeoBoundingBox"; isPointer: true }
+ Parameter { name: "area"; type: "QDeclarativeGeoRectangle"; isPointer: true }
}
Method { name: "clearExcludedAreas"; type: "void" }
Method {
@@ -1132,6 +1127,11 @@ Module {
}
}
Component {
+ name: "QDeclarativeGeoShape"
+ prototype: "QObject"
+ exports: ["GeoShape 5.0"]
+ }
+ Component {
name: "QDeclarativeGeocodeModel"
prototype: "QAbstractListModel"
exports: ["GeocodeModel 5.0"]
@@ -1591,7 +1591,7 @@ Module {
}
}
Property { name: "plugin"; type: "QDeclarativeGeoServiceProvider"; isPointer: true }
- Property { name: "searchArea"; type: "QDeclarativeGeoBoundingArea"; isPointer: true }
+ Property { name: "searchArea"; type: "QDeclarativeGeoShape"; isPointer: true }
Property { name: "offset"; type: "int" }
Property { name: "limit"; type: "int" }
Property { name: "status"; type: "Status"; isReadonly: true }
diff --git a/src/imports/location/qdeclarativegeoboundingcircle.cpp b/src/imports/location/qdeclarativegeocircle.cpp
index 41a5b6f9..692ab26d 100644
--- a/src/imports/location/qdeclarativegeoboundingcircle.cpp
+++ b/src/imports/location/qdeclarativegeocircle.cpp
@@ -40,17 +40,17 @@
***************************************************************************/
#include <qnumeric.h>
-#include "qdeclarativegeoboundingcircle_p.h"
+#include "qdeclarativegeocircle.h"
QT_BEGIN_NAMESPACE
/*!
- \qmlclass BoundingCircle QDeclarativeGeoBoundingCircle
+ \qmlclass GeoCircle QDeclarativeGeoCircle
\inqmlmodule QtLocation 5
\ingroup qml-QtLocation5-positioning
\since Qt Location 5.0
- \brief The BoundingCircle element represents a circular geographic area.
+ \brief The GeoCircle element represents a circular geographic area.
The circle is defined in terms of a \l{QDeclarativeCoordinate}{Coordinate}
which specifies the center of the circle and a qreal which specifies the
@@ -61,10 +61,10 @@ QT_BEGIN_NAMESPACE
\section2 Example Usage
- The following code snippet shows the declaration of a BoundingCircle element.
+ The following code snippet shows the declaration of a GeoCircle element.
\code
- BoundingCircle {
+ GeoCircle {
radius: 25.0
center: Coordinate {
latitude: 23.34
@@ -76,35 +76,35 @@ QT_BEGIN_NAMESPACE
This could then be used, for example, as a region to scan for landmarks,
or refining searches.
- \sa QGeoBoundingCircle
+ \sa QGeoCircle
*/
-QDeclarativeGeoBoundingCircle::QDeclarativeGeoBoundingCircle(QObject *parent)
-: QDeclarativeGeoBoundingArea(parent), m_center(0), m_radius(-1.0)
+QDeclarativeGeoCircle::QDeclarativeGeoCircle(QObject *parent)
+: QDeclarativeGeoShape(parent), m_center(0), m_radius(-1.0)
{
}
-QDeclarativeGeoBoundingCircle::QDeclarativeGeoBoundingCircle(const QGeoBoundingCircle &circle,
+QDeclarativeGeoCircle::QDeclarativeGeoCircle(const QGeoCircle &circle,
QObject *parent)
-: QDeclarativeGeoBoundingArea(parent), m_center(0), m_circle(circle), m_radius(qQNaN())
+: QDeclarativeGeoShape(parent), m_center(0), m_circle(circle), m_radius(qQNaN())
{
synchronizeDeclarative(circle, false);
}
/*!
- \qmlproperty QGeoBoundingCircle BoundingCircle::circle
+ \qmlproperty QGeoCircle GeoCircle::circle
For details on how to use this property to interface between C++ and QML see
"\l {location-cpp-qml.html#boundingcircle} {Interfaces between C++ and QML Code}".
*/
-void QDeclarativeGeoBoundingCircle::setCircle(const QGeoBoundingCircle &circle)
+void QDeclarativeGeoCircle::setCircle(const QGeoCircle &circle)
{
- QGeoBoundingCircle oldCircle = m_circle;
+ QGeoCircle oldCircle = m_circle;
m_circle = circle;
synchronizeDeclarative(oldCircle, false);
}
-QGeoBoundingCircle QDeclarativeGeoBoundingCircle::circle() const
+QGeoCircle QDeclarativeGeoCircle::circle() const
{
return m_circle;
}
@@ -112,17 +112,17 @@ QGeoBoundingCircle QDeclarativeGeoBoundingCircle::circle() const
/*!
\internal
*/
-QGeoBoundingArea QDeclarativeGeoBoundingCircle::area() const
+QGeoShape QDeclarativeGeoCircle::shape() const
{
return circle();
}
/*!
- \qmlmethod bool QDeclarativeGeoBoundingCircle::contains(Coordinate coordinate)
+ \qmlmethod bool QDeclarativeGeoCircle::contains(Coordinate coordinate)
Returns the true if \a coordinate is within the bounding circle; otherwise returns false.
*/
-bool QDeclarativeGeoBoundingCircle::contains(QDeclarativeCoordinate *coordinate)
+bool QDeclarativeGeoCircle::contains(QDeclarativeCoordinate *coordinate)
{
if (!coordinate)
return false;
@@ -131,14 +131,14 @@ bool QDeclarativeGeoBoundingCircle::contains(QDeclarativeCoordinate *coordinate)
}
/*!
- \qmlproperty Coordinate BoundingCircle::center
+ \qmlproperty Coordinate GeoCircle::center
This property holds the coordinate of the center of the bounding circle.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
*/
-QDeclarativeCoordinate *QDeclarativeGeoBoundingCircle::center()
+QDeclarativeCoordinate *QDeclarativeGeoCircle::center()
{
if (!m_center) {
m_center = new QDeclarativeCoordinate(m_circle.center(), this);
@@ -149,7 +149,7 @@ QDeclarativeCoordinate *QDeclarativeGeoBoundingCircle::center()
return m_center;
}
-void QDeclarativeGeoBoundingCircle::setCenter(QDeclarativeCoordinate *coordinate)
+void QDeclarativeGeoCircle::setCenter(QDeclarativeCoordinate *coordinate)
{
if (m_center == coordinate)
return;
@@ -169,7 +169,7 @@ void QDeclarativeGeoBoundingCircle::setCenter(QDeclarativeCoordinate *coordinate
this, SLOT(coordinateChanged()));
}
- QGeoBoundingCircle oldCircle = m_circle;
+ QGeoCircle oldCircle = m_circle;
m_circle.setCenter(coordinate ? coordinate->coordinate() : QGeoCoordinate());
synchronizeDeclarative(oldCircle, true);
@@ -177,20 +177,20 @@ void QDeclarativeGeoBoundingCircle::setCenter(QDeclarativeCoordinate *coordinate
}
/*!
- \qmlproperty qreal BoundingCircle::radius
+ \qmlproperty qreal GeoCircle::radius
This property holds the radius of the bounding circle in meters.
The default value for the radius is -1 indicating an invalid bounding circle area.
*/
-qreal QDeclarativeGeoBoundingCircle::radius() const
+qreal QDeclarativeGeoCircle::radius() const
{
return m_radius;
}
-void QDeclarativeGeoBoundingCircle::setRadius(qreal radius)
+void QDeclarativeGeoCircle::setRadius(qreal radius)
{
- QGeoBoundingCircle oldCircle = m_circle;
+ QGeoCircle oldCircle = m_circle;
m_circle.setRadius(radius);
synchronizeDeclarative(oldCircle, false);
}
@@ -198,13 +198,13 @@ void QDeclarativeGeoBoundingCircle::setRadius(qreal radius)
/*!
\internal
*/
-void QDeclarativeGeoBoundingCircle::coordinateChanged()
+void QDeclarativeGeoCircle::coordinateChanged()
{
QDeclarativeCoordinate *c = qobject_cast<QDeclarativeCoordinate *>(sender());
if (!c)
return;
- QGeoBoundingCircle oldCircle = m_circle;
+ QGeoCircle oldCircle = m_circle;
if (c == m_center) {
m_circle.setCenter(c->coordinate());
@@ -215,7 +215,7 @@ void QDeclarativeGeoBoundingCircle::coordinateChanged()
/*!
\internal
*/
-void QDeclarativeGeoBoundingCircle::synchronizeDeclarative(const QGeoBoundingCircle &old, bool skipCenter)
+void QDeclarativeGeoCircle::synchronizeDeclarative(const QGeoCircle &old, bool skipCenter)
{
if (!skipCenter && m_center && old.center() != m_circle.center())
m_center->setCoordinate(m_circle.center());
@@ -227,6 +227,6 @@ void QDeclarativeGeoBoundingCircle::synchronizeDeclarative(const QGeoBoundingCir
}
}
-#include "moc_qdeclarativegeoboundingcircle_p.cpp"
+#include "moc_qdeclarativegeocircle.cpp"
QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoboundingcircle_p.h b/src/imports/location/qdeclarativegeocircle.h
index 6f62b54c..4f099a07 100644
--- a/src/imports/location/qdeclarativegeoboundingcircle_p.h
+++ b/src/imports/location/qdeclarativegeocircle.h
@@ -39,33 +39,31 @@
**
***************************************************************************/
-#ifndef QDECLARATIVEGEOBOUNDINGCIRCLE_P_H
-#define QDECLARATIVEGEOBOUNDINGCIRCLE_P_H
+#ifndef QDECLARATIVEGEOCIRCLE_H
+#define QDECLARATIVEGEOCIRCLE_H
-#include "qdeclarativegeoboundingarea_p.h"
+#include "qdeclarativegeoshape.h"
#include "qdeclarativecoordinate_p.h"
-#include <qgeoboundingcircle.h>
-#include <QtCore>
-#include <QPointer>
#include <QtQml/qqml.h>
+#include <QtLocation/QGeoCircle>
QT_BEGIN_NAMESPACE
-class QDeclarativeGeoBoundingCircle : public QDeclarativeGeoBoundingArea
+class QDeclarativeGeoCircle : public QDeclarativeGeoShape
{
Q_OBJECT
- Q_PROPERTY(QGeoBoundingCircle circle READ circle WRITE setCircle)
+ Q_PROPERTY(QGeoCircle circle READ circle WRITE setCircle)
Q_PROPERTY(QDeclarativeCoordinate *center READ center WRITE setCenter NOTIFY centerChanged)
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
public:
- explicit QDeclarativeGeoBoundingCircle(QObject *parent = 0);
- explicit QDeclarativeGeoBoundingCircle(const QGeoBoundingCircle &circle, QObject *parent = 0);
- void setCircle(const QGeoBoundingCircle &circle);
- QGeoBoundingCircle circle() const;
- QGeoBoundingArea area() const;
+ explicit QDeclarativeGeoCircle(QObject *parent = 0);
+ explicit QDeclarativeGeoCircle(const QGeoCircle &circle, QObject *parent = 0);
+ void setCircle(const QGeoCircle &circle);
+ QGeoCircle circle() const;
+ QGeoShape shape() const;
Q_INVOKABLE bool contains(QDeclarativeCoordinate *coordinate);
QDeclarativeCoordinate *center();
@@ -81,16 +79,16 @@ private Q_SLOTS:
void coordinateChanged();
private:
- void synchronizeDeclarative(const QGeoBoundingCircle &old, bool skipCenter);
+ void synchronizeDeclarative(const QGeoCircle &old, bool skipCenter);
private:
QDeclarativeCoordinate *m_center;
- QGeoBoundingCircle m_circle;
+ QGeoCircle m_circle;
qreal m_radius;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeGeoBoundingCircle)
+QML_DECLARE_TYPE(QDeclarativeGeoCircle)
#endif
diff --git a/src/imports/location/qdeclarativegeocodemodel.cpp b/src/imports/location/qdeclarativegeocodemodel.cpp
index aeedee89..79e8b676 100644
--- a/src/imports/location/qdeclarativegeocodemodel.cpp
+++ b/src/imports/location/qdeclarativegeocodemodel.cpp
@@ -144,14 +144,14 @@ void QDeclarativeGeocodeModel::componentComplete()
/*!
\internal
*/
-QGeoBoundingArea QDeclarativeGeocodeModel::boundingArea()
+QGeoShape QDeclarativeGeocodeModel::boundingArea()
{
- if (qobject_cast<QDeclarativeGeoBoundingBox *>(boundingArea_) && boundingBox_.isValid()) {
+ if (qobject_cast<QDeclarativeGeoRectangle *>(boundingArea_) && boundingBox_.isValid()) {
return boundingBox_;
- } else if (qobject_cast<QDeclarativeGeoBoundingCircle *>(boundingArea_) && boundingCircle_.isValid()) {
+ } else if (qobject_cast<QDeclarativeGeoCircle *>(boundingArea_) && boundingCircle_.isValid()) {
return boundingCircle_;
}
- return QGeoBoundingArea();
+ return QGeoShape();
}
/*!
@@ -338,10 +338,10 @@ void QDeclarativeGeocodeModel::setBounds(QObject *bounds)
{
if (boundingArea_ == bounds)
return;
- if (qobject_cast<QDeclarativeGeoBoundingBox *>(bounds)) {
- boundingBox_ = qobject_cast<QDeclarativeGeoBoundingBox *>(bounds)->box();
- } else if (qobject_cast<QDeclarativeGeoBoundingCircle *>(bounds)) {
- boundingCircle_ = qobject_cast<QDeclarativeGeoBoundingCircle *>(bounds)->circle();
+ if (qobject_cast<QDeclarativeGeoRectangle *>(bounds)) {
+ boundingBox_ = qobject_cast<QDeclarativeGeoRectangle *>(bounds)->rectangle();
+ } else if (qobject_cast<QDeclarativeGeoCircle *>(bounds)) {
+ boundingCircle_ = qobject_cast<QDeclarativeGeoCircle *>(bounds)->circle();
} else {
qmlInfo(this) << QCoreApplication::translate(CONTEXT_NAME, UNSUPPORTED_BOUND_TYPE);
return;
@@ -351,13 +351,13 @@ void QDeclarativeGeocodeModel::setBounds(QObject *bounds)
}
/*!
- \qmlproperty bounding area QtLocation5::GeocodeModel::bounds
+ \qmlproperty GeoShape QtLocation5::GeocodeModel::bounds
This property holds the bounding area used to limit the results to those
within the area. his is particularly useful if query is only partially filled out,
as the service will attempt to (reverse) geocode all matches for the specified data.
- Accepted element types are \l BoundingBox and \l BoundingCircle.
+ Accepted element types are \l GeoRectangle and \l GeoCircle.
*/
diff --git a/src/imports/location/qdeclarativegeocodemodel_p.h b/src/imports/location/qdeclarativegeocodemodel_p.h
index 0dbbdf4e..6f023116 100644
--- a/src/imports/location/qdeclarativegeocodemodel_p.h
+++ b/src/imports/location/qdeclarativegeocodemodel_p.h
@@ -44,7 +44,7 @@
#include "qdeclarativegeoserviceprovider_p.h"
-#include "qdeclarativegeoboundingcircle_p.h"
+#include "qdeclarativegeocircle.h"
#include <qgeocodereply.h>
#include <QtQml/qqml.h>
@@ -171,14 +171,14 @@ protected:
private:
void setLocations(const QList<QGeoLocation> &locations);
- QGeoBoundingArea boundingArea();
+ QGeoShape boundingArea();
void abortRequest();
QGeocodeReply *reply_;
QDeclarativeGeoServiceProvider *plugin_;
QPointer<QObject> boundingArea_;
- QGeoBoundingBox boundingBox_;
- QGeoBoundingCircle boundingCircle_;
+ QGeoRectangle boundingBox_;
+ QGeoCircle boundingCircle_;
QList<QDeclarativeGeoLocation *> declarativeLocations_;
diff --git a/src/imports/location/qdeclarativegeolocation.cpp b/src/imports/location/qdeclarativegeolocation.cpp
index f0e170c2..95c8860f 100644
--- a/src/imports/location/qdeclarativegeolocation.cpp
+++ b/src/imports/location/qdeclarativegeolocation.cpp
@@ -52,12 +52,12 @@ QT_USE_NAMESPACE
\brief The Location element holds location data.
Location elements represent a geographic "location", in a human sense. This
- consists of a specific Coordinate, as well as an Address and a
- BoundingBox. The BoundingBox delineates the limits of what geographic area
+ consists of a specific \l {coordinate}, an \l {address} and a \l {boundingBox}{bounding box}
+ The GeoRectangle delineates the limits of what geographic area
is considered "part of" the location. For example, a Location representing
- a house would have the Coordinate set to the center of the house's block
- of land, the Address to its street address, and the BoundingBox would show
- roughly the limits of the block itself.
+ a house would have the \l {coordinate} set to the center of the house's block
+ of land, the \l {address} to its street address, and the l {boundingBox}{bounding box} would
+ show roughly the limits of the block itself.
The Location element is most commonly seen as the contents of a search
model such as the GeocodeModel. When a GeocodeModel returns the list of
@@ -84,7 +84,6 @@ QT_USE_NAMESPACE
address: houseAddress
}
\endcode
-
*/
QDeclarativeGeoLocation::QDeclarativeGeoLocation(QObject *parent)
@@ -127,9 +126,9 @@ void QDeclarativeGeoLocation::setLocation(const QGeoLocation &src)
}
if (m_boundingBox && m_boundingBox->parent() == this) {
- m_boundingBox->setBox(src.boundingBox());
+ m_boundingBox->setRectangle(src.boundingBox());
} else if (!m_boundingBox || m_boundingBox->parent() != this) {
- m_boundingBox = new QDeclarativeGeoBoundingBox(src.boundingBox(), this);
+ m_boundingBox = new QDeclarativeGeoRectangle(src.boundingBox(), this);
emit boundingBoxChanged();
}
}
@@ -139,7 +138,7 @@ QGeoLocation QDeclarativeGeoLocation::location()
QGeoLocation retValue;
retValue.setAddress(m_address ? m_address->address() : QGeoAddress());
retValue.setCoordinate(m_coordinate ? m_coordinate->coordinate() : QGeoCoordinate());
- retValue.setBoundingBox(m_boundingBox ? m_boundingBox->box() : QGeoBoundingBox());
+ retValue.setBoundingBox(m_boundingBox ? m_boundingBox->rectangle() : QGeoRectangle());
return retValue;
}
@@ -191,14 +190,14 @@ QDeclarativeCoordinate *QDeclarativeGeoLocation::coordinate()
}
/*!
- \qmlproperty BoundingBox QtLocation5::Location::boundingBox
+ \qmlproperty GeoRectangle QtLocation5::Location::boundingBox
This property holds bounding box of area on map occupied by location.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
*/
-void QDeclarativeGeoLocation::setBoundingBox(QDeclarativeGeoBoundingBox *boundingBox)
+void QDeclarativeGeoLocation::setBoundingBox(QDeclarativeGeoRectangle *boundingBox)
{
if (m_boundingBox == boundingBox)
return;
@@ -210,7 +209,7 @@ void QDeclarativeGeoLocation::setBoundingBox(QDeclarativeGeoBoundingBox *boundin
emit boundingBoxChanged();
}
-QDeclarativeGeoBoundingBox *QDeclarativeGeoLocation::boundingBox()
+QDeclarativeGeoRectangle *QDeclarativeGeoLocation::boundingBox()
{
return m_boundingBox;
}
diff --git a/src/imports/location/qdeclarativegeolocation_p.h b/src/imports/location/qdeclarativegeolocation_p.h
index 3e2ba7a4..adcaf817 100644
--- a/src/imports/location/qdeclarativegeolocation_p.h
+++ b/src/imports/location/qdeclarativegeolocation_p.h
@@ -46,7 +46,7 @@
#include <QtQml/QQmlListProperty>
#include <QtLocation/QGeoLocation>
#include "qdeclarativecoordinate_p.h"
-#include "qdeclarativegeoboundingbox_p.h"
+#include "qdeclarativegeorectangle.h"
#include "qdeclarativegeoaddress_p.h"
QT_BEGIN_NAMESPACE
@@ -58,7 +58,7 @@ class QDeclarativeGeoLocation : public QObject
Q_PROPERTY(QGeoLocation location READ location WRITE setLocation)
Q_PROPERTY(QDeclarativeGeoAddress *address READ address WRITE setAddress NOTIFY addressChanged)
Q_PROPERTY(QDeclarativeCoordinate *coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged)
- Q_PROPERTY(QDeclarativeGeoBoundingBox *boundingBox READ boundingBox WRITE setBoundingBox NOTIFY boundingBoxChanged)
+ Q_PROPERTY(QDeclarativeGeoRectangle *boundingBox READ boundingBox WRITE setBoundingBox NOTIFY boundingBoxChanged)
public:
explicit QDeclarativeGeoLocation(QObject *parent = 0);
@@ -73,8 +73,8 @@ public:
QDeclarativeCoordinate *coordinate();
void setCoordinate(QDeclarativeCoordinate *coordinate);
- QDeclarativeGeoBoundingBox *boundingBox();
- void setBoundingBox(QDeclarativeGeoBoundingBox *boundingBox);
+ QDeclarativeGeoRectangle *boundingBox();
+ void setBoundingBox(QDeclarativeGeoRectangle *boundingBox);
Q_SIGNALS:
void addressChanged();
@@ -84,7 +84,7 @@ Q_SIGNALS:
private:
QDeclarativeGeoAddress *m_address;
QDeclarativeCoordinate *m_coordinate;
- QDeclarativeGeoBoundingBox *m_boundingBox;
+ QDeclarativeGeoRectangle *m_boundingBox;
};
QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoboundingbox.cpp b/src/imports/location/qdeclarativegeorectangle.cpp
index 569c6d47..bf4a01b6 100644
--- a/src/imports/location/qdeclarativegeoboundingbox.cpp
+++ b/src/imports/location/qdeclarativegeorectangle.cpp
@@ -40,24 +40,24 @@
***************************************************************************/
#include <qnumeric.h>
-#include "qdeclarativegeoboundingbox_p.h"
+#include "qdeclarativegeorectangle.h"
QT_BEGIN_NAMESPACE
/*!
- \qmlclass BoundingBox QDeclarativeGeoBoundingBox
+ \qmlclass GeoRectangle QDeclarativeGeoRectangle
\inqmlmodule QtLocation 5
\ingroup qml-QtLocation5-positioning
\since Qt Location 5.0
- \brief The BoundingBox element represents a rectangular geographic area.
+ \brief The GeoRectangle element represents a rectangular geographic area.
- A BoundingBox is described by a \l{QDeclarativeCoordinate}{Coordinate} which
- represents the top-left of the BoundingBox and a second
+ A GeoRectangle is described by a \l{QDeclarativeCoordinate}{Coordinate} which
+ represents the top-left of the GeoRectangle and a second
\l{QDeclarativeCoordinate}{Coordinate} which represents the bottom-right of
- BoundingBox.
+ GeoRectangle.
- A BoundingBox is considered invalid if the top-left or bottom-right
+ A GeoRectangle 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.
@@ -70,10 +70,10 @@ QT_BEGIN_NAMESPACE
\section2 Example Usage
- The following code snippet shows the declaration of a BoundingBox element.
+ The following code snippet shows the declaration of a GeoRectangle element.
\code
- BoundingBox {
+ GeoRectangle {
topLeft: Coordinate {
latitude: 23.34
longitude: 44.4
@@ -88,51 +88,51 @@ QT_BEGIN_NAMESPACE
This could then be used, for example, as a region to scan for landmarks,
or refining searches.
- \sa QGeoBoundingBox.
+ \sa QGeoRectangle.
*/
-QDeclarativeGeoBoundingBox::QDeclarativeGeoBoundingBox(QObject *parent)
-: QDeclarativeGeoBoundingArea(parent), m_bottomLeft(0), m_bottomRight(0),
+QDeclarativeGeoRectangle::QDeclarativeGeoRectangle(QObject *parent)
+: QDeclarativeGeoShape(parent), m_bottomLeft(0), m_bottomRight(0),
m_topLeft(0), m_topRight(0), m_center(0), m_width(qQNaN()), m_height(qQNaN())
{
}
-QDeclarativeGeoBoundingBox::QDeclarativeGeoBoundingBox(const QGeoBoundingBox &box, QObject *parent)
-: QDeclarativeGeoBoundingArea(parent), m_bottomLeft(0), m_bottomRight(0), m_topLeft(0),
+QDeclarativeGeoRectangle::QDeclarativeGeoRectangle(const QGeoRectangle &box, QObject *parent)
+: QDeclarativeGeoShape(parent), m_bottomLeft(0), m_bottomRight(0), m_topLeft(0),
m_topRight(0), m_center(0), m_box(box), m_width(qQNaN()), m_height(qQNaN())
{
synchronizeDeclarative(box, SkipNone);
}
/*!
- \qmlproperty QGeoBoundingBox BoundingBox::box
+ \qmlproperty QGeoRectangle GeoRectangle::box
For details on how to use this property to interface between C++ and QML see
- "\l {location-cpp-qml.html#boundingbox} {Interfaces between C++ and QML Code}".
+ "\l {location-cpp-qml.html#georectangle} {Interfaces between C++ and QML Code}".
*/
-void QDeclarativeGeoBoundingBox::setBox(const QGeoBoundingBox &box)
+void QDeclarativeGeoRectangle::setRectangle(const QGeoRectangle &box)
{
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
m_box = box;
synchronizeDeclarative(oldBox, SkipNone);
}
-QGeoBoundingBox QDeclarativeGeoBoundingBox::box()
+QGeoRectangle QDeclarativeGeoRectangle::rectangle() const
{
return m_box;
}
-QGeoBoundingArea QDeclarativeGeoBoundingBox::area() const
+QGeoShape QDeclarativeGeoRectangle::shape() const
{
return m_box;
}
/*!
- \qmlmethod bool QDeclarativeGeoBoundingBox::contains(Coordinate coordinate)
+ \qmlmethod bool QDeclarativeGeoRectangle::contains(Coordinate coordinate)
Returns the true if \a coordinate is within the bounding box; otherwise returns false.
*/
-bool QDeclarativeGeoBoundingBox::contains(QDeclarativeCoordinate *coordinate)
+bool QDeclarativeGeoRectangle::contains(QDeclarativeCoordinate *coordinate)
{
if (!coordinate)
return false;
@@ -140,7 +140,7 @@ bool QDeclarativeGeoBoundingBox::contains(QDeclarativeCoordinate *coordinate)
return m_box.contains(coordinate->coordinate());
}
-QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::bottomLeft()
+QDeclarativeCoordinate *QDeclarativeGeoRectangle::bottomLeft()
{
if (!m_bottomLeft) {
m_bottomLeft = new QDeclarativeCoordinate(m_box.bottomLeft(), this);
@@ -152,17 +152,17 @@ QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::bottomLeft()
}
/*!
- \qmlproperty Coordinate BoundingBox::bottomLeft
+ \qmlproperty Coordinate GeoRectangle::bottomLeft
This property holds the bottom left coordinate of this bounding box.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setBottomLeft(QDeclarativeCoordinate *coordinate)
+void QDeclarativeGeoRectangle::setBottomLeft(QDeclarativeCoordinate *coordinate)
{
if (m_bottomLeft == coordinate)
return;
@@ -182,14 +182,14 @@ void QDeclarativeGeoBoundingBox::setBottomLeft(QDeclarativeCoordinate *coordinat
this, SLOT(coordinateChanged()));
}
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
m_box.setBottomLeft(coordinate ? coordinate->coordinate() : QGeoCoordinate());
synchronizeDeclarative(oldBox, SkipBottomLeft);
emit bottomLeftChanged();
}
-QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::bottomRight()
+QDeclarativeCoordinate *QDeclarativeGeoRectangle::bottomRight()
{
if (!m_bottomRight) {
m_bottomRight = new QDeclarativeCoordinate(m_box.bottomRight(), this);
@@ -201,17 +201,17 @@ QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::bottomRight()
}
/*!
- \qmlproperty Coordinate BoundingBox::bottomRight
+ \qmlproperty Coordinate GeoRectangle::bottomRight
- This property holds the bottom right coordinate of this bounding box.
+ This property holds the bottom right coordinate of this geo rectangle.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setBottomRight(QDeclarativeCoordinate *coordinate)
+void QDeclarativeGeoRectangle::setBottomRight(QDeclarativeCoordinate *coordinate)
{
if (m_bottomRight == coordinate)
return;
@@ -231,14 +231,14 @@ void QDeclarativeGeoBoundingBox::setBottomRight(QDeclarativeCoordinate *coordina
this, SLOT(coordinateChanged()));
}
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
m_box.setBottomRight(coordinate ? coordinate->coordinate() : QGeoCoordinate());
synchronizeDeclarative(oldBox, SkipBottomRight);
emit bottomRightChanged();
}
-QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::topLeft()
+QDeclarativeCoordinate *QDeclarativeGeoRectangle::topLeft()
{
if (!m_topLeft) {
m_topLeft = new QDeclarativeCoordinate(m_box.topLeft(), this);
@@ -250,17 +250,17 @@ QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::topLeft()
}
/*!
- \qmlproperty Coordinate BoundingBox::topLeft
+ \qmlproperty Coordinate GeoRectangle::topLeft
- This property holds the top left coordinate of this bounding box.
+ This property holds the top left coordinate of this geo rectangle.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setTopLeft(QDeclarativeCoordinate *coordinate)
+void QDeclarativeGeoRectangle::setTopLeft(QDeclarativeCoordinate *coordinate)
{
if (m_topLeft == coordinate)
return;
@@ -280,14 +280,14 @@ void QDeclarativeGeoBoundingBox::setTopLeft(QDeclarativeCoordinate *coordinate)
this, SLOT(coordinateChanged()));
}
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
m_box.setTopLeft(coordinate ? coordinate->coordinate() : QGeoCoordinate());
synchronizeDeclarative(oldBox, SkipTopLeft);
emit topLeftChanged();
}
-QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::topRight()
+QDeclarativeCoordinate *QDeclarativeGeoRectangle::topRight()
{
if (!m_topRight) {
m_topRight = new QDeclarativeCoordinate(m_box.topRight(), this);
@@ -299,17 +299,17 @@ QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::topRight()
}
/*!
- \qmlproperty Coordinate BoundingBox::topRight
+ \qmlproperty Coordinate GeoRectangle::topRight
- This property holds the top right coordinate of this bounding box.
+ This property holds the top right coordinate of this geo rectangle.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setTopRight(QDeclarativeCoordinate *coordinate)
+void QDeclarativeGeoRectangle::setTopRight(QDeclarativeCoordinate *coordinate)
{
if (m_topRight == coordinate)
return;
@@ -329,14 +329,14 @@ void QDeclarativeGeoBoundingBox::setTopRight(QDeclarativeCoordinate *coordinate)
this, SLOT(coordinateChanged()));
}
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
m_box.setTopRight(coordinate ? coordinate->coordinate() : QGeoCoordinate());
synchronizeDeclarative(oldBox, SkipTopRight);
emit topRightChanged();
}
-QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::center()
+QDeclarativeCoordinate *QDeclarativeGeoRectangle::center()
{
if (!m_center) {
m_center = new QDeclarativeCoordinate(m_box.center(), this);
@@ -348,18 +348,18 @@ QDeclarativeCoordinate *QDeclarativeGeoBoundingBox::center()
}
/*!
- \qmlproperty Coordinate BoundingBox::center
+ \qmlproperty Coordinate GeoRectangle::center
- This property holds the center coordinate of this bounding box.
+ This property holds the center coordinate of this geo rectangle.
Note: this property's changed() signal is currently emitted only if the
whole element changes, not if only the contents of the element change.
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setCenter(QDeclarativeCoordinate *coordinate)
+void QDeclarativeGeoRectangle::setCenter(QDeclarativeCoordinate *coordinate)
{
if (m_center == coordinate)
return;
@@ -379,65 +379,65 @@ void QDeclarativeGeoBoundingBox::setCenter(QDeclarativeCoordinate *coordinate)
this, SLOT(coordinateChanged()));
}
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
m_box.setCenter(coordinate ? coordinate->coordinate() : QGeoCoordinate());
synchronizeDeclarative(oldBox, SkipCenter);
emit centerChanged();
}
-double QDeclarativeGeoBoundingBox::height()
+double QDeclarativeGeoRectangle::height()
{
return m_height;
}
/*!
- \qmlproperty double BoundingBox::height
+ \qmlproperty double GeoRectangle::height
- This property holds the height of this bounding box (in degrees).
+ This property holds the height of this geo rectangle (in degrees).
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setHeight(double height)
+void QDeclarativeGeoRectangle::setHeight(double height)
{
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
if (!m_box.isValid())
m_box.setCenter(QGeoCoordinate(0.0, 0.0));
m_box.setHeight(height);
synchronizeDeclarative(oldBox, SkipNone);
}
-double QDeclarativeGeoBoundingBox::width()
+double QDeclarativeGeoRectangle::width()
{
return m_width;
}
/*!
- \qmlproperty double BoundingBox::width
+ \qmlproperty double GeoRectangle::width
- This property holds the width of this bounding box (in degrees).
+ This property holds the width of this geo rectangle (in degrees).
- \sa {QGeoBoundingBox}
+ \sa {QGeoRectangle}
*/
-void QDeclarativeGeoBoundingBox::setWidth(double width)
+void QDeclarativeGeoRectangle::setWidth(double width)
{
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
if (!m_box.isValid())
m_box.setCenter(QGeoCoordinate(0.0, 0.0));
m_box.setWidth(width);
synchronizeDeclarative(oldBox, SkipNone);
}
-void QDeclarativeGeoBoundingBox::coordinateChanged()
+void QDeclarativeGeoRectangle::coordinateChanged()
{
QDeclarativeCoordinate *c = qobject_cast<QDeclarativeCoordinate *>(sender());
if (!c)
return;
- QGeoBoundingBox oldBox = m_box;
+ QGeoRectangle oldBox = m_box;
if (c == m_bottomLeft) {
m_box.setBottomLeft(c->coordinate());
@@ -457,7 +457,7 @@ void QDeclarativeGeoBoundingBox::coordinateChanged()
}
}
-void QDeclarativeGeoBoundingBox::synchronizeDeclarative(const QGeoBoundingBox &old, SkipProp skip)
+void QDeclarativeGeoRectangle::synchronizeDeclarative(const QGeoRectangle &old, SkipProp skip)
{
if (skip != SkipBottomLeft && m_bottomLeft && old.bottomLeft() != m_box.bottomLeft())
m_bottomLeft->setCoordinate(m_box.bottomLeft());
@@ -485,6 +485,6 @@ void QDeclarativeGeoBoundingBox::synchronizeDeclarative(const QGeoBoundingBox &o
}
}
-#include "moc_qdeclarativegeoboundingbox_p.cpp"
+#include "moc_qdeclarativegeorectangle.cpp"
QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoboundingbox_p.h b/src/imports/location/qdeclarativegeorectangle.h
index d00ab25e..8b3ccbe8 100644
--- a/src/imports/location/qdeclarativegeoboundingbox_p.h
+++ b/src/imports/location/qdeclarativegeorectangle.h
@@ -39,23 +39,22 @@
**
***************************************************************************/
-#ifndef QDECLARATIVEGEOBOUNDINGBOX_P_H
-#define QDECLARATIVEGEOBOUNDINGBOX_P_H
+#ifndef QDECLARATIVEGEORECTANGLE_H
+#define QDECLARATIVEGEORECTANGLE_H
-#include "qdeclarativegeoboundingarea_p.h"
+#include "qdeclarativegeoshape.h"
#include "qdeclarativecoordinate_p.h"
-#include <qgeoboundingbox.h>
-#include <QtCore>
#include <QtQml/qqml.h>
+#include <QtLocation/QGeoRectangle>
QT_BEGIN_NAMESPACE
-class QDeclarativeGeoBoundingBox : public QDeclarativeGeoBoundingArea
+class QDeclarativeGeoRectangle : public QDeclarativeGeoShape
{
Q_OBJECT
- Q_PROPERTY(QGeoBoundingBox box READ box WRITE setBox)
+ Q_PROPERTY(QGeoRectangle rectangle READ rectangle WRITE setRectangle)
Q_PROPERTY(QDeclarativeCoordinate *bottomLeft READ bottomLeft WRITE setBottomLeft NOTIFY bottomLeftChanged)
Q_PROPERTY(QDeclarativeCoordinate *bottomRight READ bottomRight WRITE setBottomRight NOTIFY bottomRightChanged)
Q_PROPERTY(QDeclarativeCoordinate *topLeft READ topLeft WRITE setTopLeft NOTIFY topLeftChanged)
@@ -65,11 +64,11 @@ class QDeclarativeGeoBoundingBox : public QDeclarativeGeoBoundingArea
Q_PROPERTY(double width READ width WRITE setWidth NOTIFY widthChanged)
public:
- explicit QDeclarativeGeoBoundingBox(QObject *parent = 0);
- explicit QDeclarativeGeoBoundingBox(const QGeoBoundingBox &box, QObject *parent = 0);
- void setBox(const QGeoBoundingBox &box);
- QGeoBoundingBox box();
- QGeoBoundingArea area() const;
+ explicit QDeclarativeGeoRectangle(QObject *parent = 0);
+ explicit QDeclarativeGeoRectangle(const QGeoRectangle &rectangle, QObject *parent = 0);
+ void setRectangle(const QGeoRectangle &rectangle);
+ QGeoRectangle rectangle() const;
+ QGeoShape shape() const;
Q_INVOKABLE bool contains(QDeclarativeCoordinate *coordinate);
QDeclarativeCoordinate *bottomLeft();
@@ -108,7 +107,7 @@ private:
SkipTopRight,
SkipCenter
};
- void synchronizeDeclarative(const QGeoBoundingBox &old, SkipProp skip);
+ void synchronizeDeclarative(const QGeoRectangle &old, SkipProp skip);
private:
QDeclarativeCoordinate *m_bottomLeft;
@@ -116,13 +115,13 @@ private:
QDeclarativeCoordinate *m_topLeft;
QDeclarativeCoordinate *m_topRight;
QDeclarativeCoordinate *m_center;
- QGeoBoundingBox m_box;
+ QGeoRectangle m_box;
double m_width;
double m_height;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QDeclarativeGeoBoundingBox)
+QML_DECLARE_TYPE(QDeclarativeGeoRectangle)
-#endif // QDECLARATIVEGEOBOUNDINGBOX_P_H
+#endif
diff --git a/src/imports/location/qdeclarativegeoroute.cpp b/src/imports/location/qdeclarativegeoroute.cpp
index bb740409..286de227 100644
--- a/src/imports/location/qdeclarativegeoroute.cpp
+++ b/src/imports/location/qdeclarativegeoroute.cpp
@@ -88,7 +88,7 @@ QDeclarativeGeoRoute::~QDeclarativeGeoRoute() {}
void QDeclarativeGeoRoute::init()
{
- bounds_ = new QDeclarativeGeoBoundingBox(route_.bounds(), this);
+ bounds_ = new QDeclarativeGeoRectangle(route_.bounds(), this);
for (int i = 0; i < route_.path().size(); ++i)
path_.append(new QDeclarativeCoordinate(route_.path().at(i), this));
@@ -119,13 +119,13 @@ QList<QGeoCoordinate> QDeclarativeGeoRoute::routePath()
}
/*!
- \qmlproperty BoundingBox QtLocation5::Route::bounds
+ \qmlproperty GeoRectangle QtLocation5::Route::bounds
Read-only property which holds a bounding box which encompasses the entire route.
*/
-QDeclarativeGeoBoundingBox *QDeclarativeGeoRoute::bounds() const
+QDeclarativeGeoRectangle *QDeclarativeGeoRoute::bounds() const
{
return bounds_;
}
diff --git a/src/imports/location/qdeclarativegeoroute_p.h b/src/imports/location/qdeclarativegeoroute_p.h
index 16fddb3f..251767d1 100644
--- a/src/imports/location/qdeclarativegeoroute_p.h
+++ b/src/imports/location/qdeclarativegeoroute_p.h
@@ -42,7 +42,7 @@
#ifndef QDECLARATIVEGEOROUTE_H
#define QDECLARATIVEGEOROUTE_H
-#include "qdeclarativegeoboundingbox_p.h"
+#include "qdeclarativegeorectangle.h"
#include "qdeclarativecoordinate_p.h"
#include "qdeclarativegeoroutesegment_p.h"
@@ -56,7 +56,7 @@ class QDeclarativeGeoRoute : public QObject
{
Q_OBJECT
- Q_PROPERTY(QDeclarativeGeoBoundingBox *bounds READ bounds CONSTANT)
+ Q_PROPERTY(QDeclarativeGeoRectangle *bounds READ bounds CONSTANT)
Q_PROPERTY(int travelTime READ travelTime CONSTANT)
Q_PROPERTY(qreal distance READ distance CONSTANT)
Q_PROPERTY(QQmlListProperty<QDeclarativeCoordinate> path READ path CONSTANT)
@@ -67,7 +67,7 @@ public:
QDeclarativeGeoRoute(const QGeoRoute &route, QObject *parent = 0);
~QDeclarativeGeoRoute();
- QDeclarativeGeoBoundingBox *bounds() const;
+ QDeclarativeGeoRectangle *bounds() const;
int travelTime() const;
qreal distance() const;
QQmlListProperty<QDeclarativeCoordinate> path();
@@ -94,7 +94,7 @@ private:
QList<QGeoCoordinate> routePath();
QGeoRoute route_;
- QDeclarativeGeoBoundingBox *bounds_;
+ QDeclarativeGeoRectangle *bounds_;
QList<QDeclarativeCoordinate *> path_;
QList<QDeclarativeGeoRouteSegment *> segments_;
friend class QDeclarativeRouteMapItem;
diff --git a/src/imports/location/qdeclarativegeoroutemodel.cpp b/src/imports/location/qdeclarativegeoroutemodel.cpp
index 7b89cc7c..ed9ec50c 100644
--- a/src/imports/location/qdeclarativegeoroutemodel.cpp
+++ b/src/imports/location/qdeclarativegeoroutemodel.cpp
@@ -768,7 +768,7 @@ void QDeclarativeGeoRouteQuery::waypoints_clear(QQmlListProperty<QDeclarativeCoo
}
/*!
- \qmlproperty QQmlListProperty<BoundingBox> RouteQuery::excludedAreas
+ \qmlproperty QQmlListProperty<GeoRectangle> RouteQuery::excludedAreas
Areas that the route must not cross.
@@ -778,9 +778,9 @@ void QDeclarativeGeoRouteQuery::waypoints_clear(QQmlListProperty<QDeclarativeCoo
\sa addExcludedArea, removeExcludedArea, clearExcludedAreas
*/
-QQmlListProperty<QDeclarativeGeoBoundingBox> QDeclarativeGeoRouteQuery::excludedAreas()
+QQmlListProperty<QDeclarativeGeoRectangle> QDeclarativeGeoRouteQuery::excludedAreas()
{
- return QQmlListProperty<QDeclarativeGeoBoundingBox>(this, 0, exclusions_append,
+ return QQmlListProperty<QDeclarativeGeoRectangle>(this, 0, exclusions_append,
exclusions_count, exclusions_at,
exclusions_clear);
}
@@ -788,7 +788,7 @@ QQmlListProperty<QDeclarativeGeoBoundingBox> QDeclarativeGeoRouteQuery::excluded
/*!
\internal
*/
-void QDeclarativeGeoRouteQuery::exclusions_append(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop, QDeclarativeGeoBoundingBox *area)
+void QDeclarativeGeoRouteQuery::exclusions_append(QQmlListProperty<QDeclarativeGeoRectangle> *prop, QDeclarativeGeoRectangle *area)
{
QDeclarativeGeoRouteQuery *model = static_cast<QDeclarativeGeoRouteQuery *>(prop->object);
model->addExcludedArea(area);
@@ -797,7 +797,7 @@ void QDeclarativeGeoRouteQuery::exclusions_append(QQmlListProperty<QDeclarativeG
/*!
\internal
*/
-int QDeclarativeGeoRouteQuery::exclusions_count(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop)
+int QDeclarativeGeoRouteQuery::exclusions_count(QQmlListProperty<QDeclarativeGeoRectangle> *prop)
{
QDeclarativeGeoRouteQuery *model = static_cast<QDeclarativeGeoRouteQuery *>(prop->object);
return model->exclusions_.count();
@@ -806,7 +806,7 @@ int QDeclarativeGeoRouteQuery::exclusions_count(QQmlListProperty<QDeclarativeGeo
/*!
\internal
*/
-QDeclarativeGeoBoundingBox *QDeclarativeGeoRouteQuery::exclusions_at(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop, int index)
+QDeclarativeGeoRectangle *QDeclarativeGeoRouteQuery::exclusions_at(QQmlListProperty<QDeclarativeGeoRectangle> *prop, int index)
{
QDeclarativeGeoRouteQuery *model = static_cast<QDeclarativeGeoRouteQuery *>(prop->object);
Q_ASSERT(index < model->exclusions_.count());
@@ -816,14 +816,14 @@ QDeclarativeGeoBoundingBox *QDeclarativeGeoRouteQuery::exclusions_at(QQmlListPro
/*!
\internal
*/
-void QDeclarativeGeoRouteQuery::exclusions_clear(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop)
+void QDeclarativeGeoRouteQuery::exclusions_clear(QQmlListProperty<QDeclarativeGeoRectangle> *prop)
{
QDeclarativeGeoRouteQuery *model = static_cast<QDeclarativeGeoRouteQuery *>(prop->object);
model->clearExcludedAreas();
}
/*!
- \qmlmethod QtLocation5::RouteQuery::addExcludedArea(BoundingBox)
+ \qmlmethod QtLocation5::RouteQuery::addExcludedArea(GeoRectangle)
Adds the given area to excluded areas (areas that the route must not cross).
Same area can only be added once.
@@ -832,7 +832,7 @@ void QDeclarativeGeoRouteQuery::exclusions_clear(QQmlListProperty<QDeclarativeGe
*/
-void QDeclarativeGeoRouteQuery::addExcludedArea(QDeclarativeGeoBoundingBox *area)
+void QDeclarativeGeoRouteQuery::addExcludedArea(QDeclarativeGeoRectangle *area)
{
if (!area)
return;
@@ -853,14 +853,14 @@ void QDeclarativeGeoRouteQuery::addExcludedArea(QDeclarativeGeoBoundingBox *area
}
/*!
- \qmlmethod QtLocation5::RouteQuery::removeExcludedArea(BoundingBox)
+ \qmlmethod QtLocation5::RouteQuery::removeExcludedArea(GeoRectangle)
Removes the given area to excluded areas (areas that the route must not cross).
\sa addExcludedArea, clearExcludedAreas
*/
-void QDeclarativeGeoRouteQuery::removeExcludedArea(QDeclarativeGeoBoundingBox *area)
+void QDeclarativeGeoRouteQuery::removeExcludedArea(QDeclarativeGeoRectangle *area)
{
if (!area)
return;
@@ -1243,9 +1243,9 @@ QGeoRouteRequest &QDeclarativeGeoRouteQuery::routeRequest()
QList<QGeoCoordinate> waypoints;
for (int i = 0; i < waypoints_.count(); ++i)
waypoints.append(waypoints_.at(i)->coordinate());
- QList<QGeoBoundingBox> exclusions;
+ QList<QGeoRectangle> exclusions;
for (int i = 0; i < exclusions_.count(); ++i)
- exclusions.append(exclusions_.at(i)->box());
+ exclusions.append(exclusions_.at(i)->rectangle());
request_.setWaypoints(waypoints);
request_.setExcludeAreas(exclusions);
diff --git a/src/imports/location/qdeclarativegeoroutemodel_p.h b/src/imports/location/qdeclarativegeoroutemodel_p.h
index b8710049..ce70c243 100644
--- a/src/imports/location/qdeclarativegeoroutemodel_p.h
+++ b/src/imports/location/qdeclarativegeoroutemodel_p.h
@@ -45,7 +45,7 @@
#include "qdeclarativegeoserviceprovider_p.h"
#include "qdeclarativecoordinate_p.h"
-#include "qdeclarativegeoboundingbox_p.h"
+#include "qdeclarativegeorectangle.h"
#include <qgeorouterequest.h>
#include <qgeoroutereply.h>
@@ -189,7 +189,7 @@ class QDeclarativeGeoRouteQuery : public QObject, public QQmlParserStatus
Q_PROPERTY(SegmentDetail segmentDetail READ segmentDetail WRITE setSegmentDetail NOTIFY segmentDetailChanged)
Q_PROPERTY(ManeuverDetail maneuverDetail READ maneuverDetail WRITE setManeuverDetail NOTIFY maneuverDetailChanged)
Q_PROPERTY(QQmlListProperty<QDeclarativeCoordinate> waypoints READ waypoints NOTIFY waypointsChanged)
- Q_PROPERTY(QQmlListProperty<QDeclarativeGeoBoundingBox> excludedAreas READ excludedAreas NOTIFY excludedAreasChanged)
+ Q_PROPERTY(QQmlListProperty<QDeclarativeGeoRectangle> excludedAreas READ excludedAreas NOTIFY excludedAreasChanged)
Q_PROPERTY(QList<int> featureTypes READ featureTypes NOTIFY featureTypesChanged)
Q_INTERFACES(QQmlParserStatus)
@@ -263,14 +263,14 @@ public:
// READ functions for list properties
QQmlListProperty<QDeclarativeCoordinate> waypoints();
- QQmlListProperty<QDeclarativeGeoBoundingBox> excludedAreas();
+ QQmlListProperty<QDeclarativeGeoRectangle> excludedAreas();
Q_INVOKABLE void addWaypoint(QDeclarativeCoordinate *waypoint);
Q_INVOKABLE void removeWaypoint(QDeclarativeCoordinate *waypoint);
Q_INVOKABLE void clearWaypoints();
- Q_INVOKABLE void addExcludedArea(QDeclarativeGeoBoundingBox *area);
- Q_INVOKABLE void removeExcludedArea(QDeclarativeGeoBoundingBox *area);
+ Q_INVOKABLE void addExcludedArea(QDeclarativeGeoRectangle *area);
+ Q_INVOKABLE void removeExcludedArea(QDeclarativeGeoRectangle *area);
Q_INVOKABLE void clearExcludedAreas();
Q_INVOKABLE void setFeatureWeight(FeatureType featureType, FeatureWeight featureWeight);
@@ -317,13 +317,13 @@ private:
static QDeclarativeCoordinate *waypoints_at(QQmlListProperty<QDeclarativeCoordinate> *prop, int index);
static void waypoints_clear(QQmlListProperty<QDeclarativeCoordinate> *prop);
- static void exclusions_append(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop, QDeclarativeGeoBoundingBox *area);
- static int exclusions_count(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop);
- static QDeclarativeGeoBoundingBox *exclusions_at(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop, int index);
- static void exclusions_clear(QQmlListProperty<QDeclarativeGeoBoundingBox> *prop);
+ static void exclusions_append(QQmlListProperty<QDeclarativeGeoRectangle> *prop, QDeclarativeGeoRectangle *area);
+ static int exclusions_count(QQmlListProperty<QDeclarativeGeoRectangle> *prop);
+ static QDeclarativeGeoRectangle *exclusions_at(QQmlListProperty<QDeclarativeGeoRectangle> *prop, int index);
+ static void exclusions_clear(QQmlListProperty<QDeclarativeGeoRectangle> *prop);
QList<QDeclarativeCoordinate *> waypoints_;
- QList<QDeclarativeGeoBoundingBox *> exclusions_;
+ QList<QDeclarativeGeoRectangle *> exclusions_;
QGeoRouteRequest request_;
bool complete_;
diff --git a/src/imports/location/qdeclarativegeoboundingarea.cpp b/src/imports/location/qdeclarativegeoshape.cpp
index 851a04ce..ef787987 100644
--- a/src/imports/location/qdeclarativegeoboundingarea.cpp
+++ b/src/imports/location/qdeclarativegeoshape.cpp
@@ -39,22 +39,22 @@
**
****************************************************************************/
-#include "qdeclarativegeoboundingarea_p.h"
+#include "qdeclarativegeoshape.h"
QT_BEGIN_NAMESPACE
/*!
- \qmlclass BoundingArea QDeclarativeGeoBoundingArea
+ \qmlclass GeoShape QDeclarativeGeoShape
\inqmlmodule QtLocation 5
\ingroup qml-QtLocation5-positioning
\since Qt Location 5.0
- \brief The BoundingArea element represents an abstract geographic area.
+ \brief The GeoShape type represents an abstract geographic area.
- The BoundingArea element is not intended to be instantiated by the developer. Use BoundingBox
- or BoundingCircle instead.
+ The GeoShape element is not intended to be instantiated by the developer. Use GeoRectangle
+ or GeoCircle instead.
- \sa BoundingBox, BoundingCircle
+ \sa GeoRectangle, GeoCircle
*/
QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeoboundingarea_p.h b/src/imports/location/qdeclarativegeoshape.h
index 2ea9bdd6..c0224be0 100644
--- a/src/imports/location/qdeclarativegeoboundingarea_p.h
+++ b/src/imports/location/qdeclarativegeoshape.h
@@ -39,27 +39,26 @@
**
***************************************************************************/
-#ifndef QDECLARATIVEGEOBOUNDINGAREA_P_H
-#define QDECLARATIVEGEOBOUNDINGAREA_P_H
+#ifndef QDECLARATIVEGEOSHAPE_H
+#define QDECLARATIVEGEOSHAPE_H
-#include <qgeoboundingarea.h>
-
-#include <QtCore>
-#include <QPointer>
+#include <QtCore/QObject>
#include <QtQml/qqml.h>
+#include <QtLocation/QGeoShape>
QT_BEGIN_NAMESPACE
-class QDeclarativeGeoBoundingArea : public QObject
+class QDeclarativeGeoShape : public QObject
{
Q_OBJECT
public:
- explicit QDeclarativeGeoBoundingArea(QObject *parent) :QObject(parent){}
- virtual QGeoBoundingArea area() const = 0;
+ explicit QDeclarativeGeoShape(QObject *parent) :QObject(parent){}
+ virtual QGeoShape shape() const = 0;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeGeoBoundingArea));
+
+QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeGeoShape))
#endif
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
+
diff --git a/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp b/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp
index 74c39dcd..404d4cb6 100644
--- a/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp
+++ b/src/plugins/geoservices/nokia/placesv2/qplacedetailsreplyimpl.cpp
@@ -208,7 +208,7 @@ void QPlaceDetailsReplyImpl::replyFinished()
if (locationObject.contains(QLatin1String("bbox"))) {
QJsonArray bbox = locationObject.value(QLatin1String("bbox")).toArray();
- QGeoBoundingBox box(QGeoCoordinate(bbox.at(3).toDouble(), bbox.at(0).toDouble()),
+ QGeoRectangle box(QGeoCoordinate(bbox.at(3).toDouble(), bbox.at(0).toDouble()),
QGeoCoordinate(bbox.at(1).toDouble(), bbox.at(2).toDouble()));
location.setBoundingBox(box);
}
diff --git a/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp b/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp
index 17244d73..db97dffb 100644
--- a/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp
+++ b/src/plugins/geoservices/nokia/placesv2/qplacesearchreplyimpl.cpp
@@ -132,7 +132,7 @@ void QPlaceSearchReplyImpl::replyFinished()
if (item.contains(QLatin1String("bbox"))) {
QJsonArray bbox = item.value(QLatin1String("bbox")).toArray();
- QGeoBoundingBox box(QGeoCoordinate(bbox.at(3).toDouble(), bbox.at(0).toDouble()),
+ QGeoRectangle box(QGeoCoordinate(bbox.at(3).toDouble(), bbox.at(0).toDouble()),
QGeoCoordinate(bbox.at(1).toDouble(), bbox.at(2).toDouble()));
location.setBoundingBox(box);
}
diff --git a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
index 26d9e23c..d16fef4c 100644
--- a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
@@ -49,10 +49,12 @@
#include "qgeocodereply_nokia.h"
#include "qgeocodexmlparser.h"
+#include <QtLocation/QGeoShape>
+
QT_BEGIN_NAMESPACE
QGeocodeReplyNokia::QGeocodeReplyNokia(QNetworkReply *reply, int limit, int offset,
- const QGeoBoundingArea &viewport, QObject *parent)
+ const QGeoShape &viewport, QObject *parent)
: QGeocodeReply(parent),
m_reply(reply)
{
@@ -103,7 +105,7 @@ void QGeocodeReplyNokia::networkFinished()
QGeoCodeXmlParser parser;
if (parser.parse(m_reply)) {
QList<QGeoLocation> locations = parser.results();
- QGeoBoundingArea bounds = viewport();
+ QGeoShape bounds = viewport();
if (bounds.isValid()) {
for (int i = locations.size() - 1; i >= 0; --i) {
if (!bounds.contains(locations[i].coordinate()))
diff --git a/src/plugins/geoservices/nokia/qgeocodereply_nokia.h b/src/plugins/geoservices/nokia/qgeocodereply_nokia.h
index 41cd83b1..844151a2 100644
--- a/src/plugins/geoservices/nokia/qgeocodereply_nokia.h
+++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.h
@@ -58,7 +58,7 @@ class QGeocodeReplyNokia : public QGeocodeReply
{
Q_OBJECT
public:
- QGeocodeReplyNokia(QNetworkReply *reply, int limit, int offset, const QGeoBoundingArea &viewport, QObject *parent = 0);
+ QGeocodeReplyNokia(QNetworkReply *reply, int limit, int offset, const QGeoShape &viewport, QObject *parent = 0);
~QGeocodeReplyNokia();
void abort();
diff --git a/src/plugins/geoservices/nokia/qgeocodexmlparser.cpp b/src/plugins/geoservices/nokia/qgeocodexmlparser.cpp
index c3de21ec..8a63b468 100644
--- a/src/plugins/geoservices/nokia/qgeocodexmlparser.cpp
+++ b/src/plugins/geoservices/nokia/qgeocodexmlparser.cpp
@@ -52,6 +52,9 @@
#include <QIODevice>
#include <qgeolocation.h>
+#include <QtLocation/QGeoAddress>
+#include <QtLocation/QGeoCoordinate>
+#include <QtLocation/QGeoRectangle>
QT_BEGIN_NAMESPACE
@@ -303,7 +306,7 @@ bool QGeoCodeXmlParser::parseLocation(QGeoLocation *location)
return false;
}
- QGeoBoundingBox bounds;
+ QGeoRectangle bounds;
if (!parseBoundingBox(&bounds))
return false;
@@ -441,7 +444,7 @@ bool QGeoCodeXmlParser::parseAddress(QGeoAddress *address)
return false;
}
-bool QGeoCodeXmlParser::parseBoundingBox(QGeoBoundingBox *bounds)
+bool QGeoCodeXmlParser::parseBoundingBox(QGeoRectangle *bounds)
{
/*
<xsd:complexType name="GeoBox">
@@ -489,7 +492,7 @@ bool QGeoCodeXmlParser::parseBoundingBox(QGeoBoundingBox *bounds)
return false;
}
- *bounds = QGeoBoundingBox(nw, se);
+ *bounds = QGeoRectangle(nw, se);
return true;
}
diff --git a/src/plugins/geoservices/nokia/qgeocodexmlparser.h b/src/plugins/geoservices/nokia/qgeocodexmlparser.h
index 20ef848b..0ec9eb28 100644
--- a/src/plugins/geoservices/nokia/qgeocodexmlparser.h
+++ b/src/plugins/geoservices/nokia/qgeocodexmlparser.h
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
class QIODevice;
class QGeoLocation;
class QGeoAddress;
-class QGeoBoundingBox;
+class QGeoRectangle;
class QGeoCoordinate;
class QXmlStreamReader;
@@ -78,7 +78,7 @@ private:
bool parsePlace(QGeoLocation *location);
bool parseLocation(QGeoLocation *location);
bool parseAddress(QGeoAddress *address);
- bool parseBoundingBox(QGeoBoundingBox *bounds);
+ bool parseBoundingBox(QGeoRectangle *bounds);
bool parseCoordinate(QGeoCoordinate *coordinate, const QString &elementName);
QScopedPointer<QXmlStreamReader> m_reader;
diff --git a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp
index 7f783692..e6a66623 100644
--- a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp
@@ -107,7 +107,7 @@ QString QGeocodingManagerEngineNokia::getAuthenticationString() const
QGeocodeReply *QGeocodingManagerEngineNokia::geocode(const QGeoAddress &address,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
QString requestString = "http://";
requestString += m_uriProvider->getCurrentHost();
@@ -176,7 +176,7 @@ QGeocodeReply *QGeocodingManagerEngineNokia::geocode(const QGeoAddress &address,
}
QGeocodeReply *QGeocodingManagerEngineNokia::reverseGeocode(const QGeoCoordinate &coordinate,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
QString requestString = "http://";
requestString += m_uriProvider->getCurrentHost();
@@ -198,7 +198,7 @@ QGeocodeReply *QGeocodingManagerEngineNokia::reverseGeocode(const QGeoCoordinate
QGeocodeReply *QGeocodingManagerEngineNokia::geocode(const QString &address,
int limit,
int offset,
- const QGeoBoundingArea &bounds)
+ const QGeoShape &bounds)
{
QString requestString = "http://";
requestString += m_uriProvider->getCurrentHost();
@@ -226,7 +226,7 @@ QGeocodeReply *QGeocodingManagerEngineNokia::geocode(const QString &address,
}
QGeocodeReply *QGeocodingManagerEngineNokia::geocode(QString requestString,
- const QGeoBoundingArea &bounds,
+ const QGeoShape &bounds,
int limit,
int offset)
{
diff --git a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h
index 0b6d34d4..abe29785 100644
--- a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h
+++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h
@@ -72,14 +72,14 @@ public:
~QGeocodingManagerEngineNokia();
QGeocodeReply *geocode(const QGeoAddress &address,
- const QGeoBoundingArea &bounds);
+ const QGeoShape &bounds);
QGeocodeReply *reverseGeocode(const QGeoCoordinate &coordinate,
- const QGeoBoundingArea &bounds);
+ const QGeoShape &bounds);
QGeocodeReply *geocode(const QString &searchString,
int limit,
int offset,
- const QGeoBoundingArea &bounds);
+ const QGeoShape &bounds);
private Q_SLOTS:
void placesFinished();
@@ -87,7 +87,7 @@ private Q_SLOTS:
private:
static QString trimDouble(double degree, int decimalDigits = 10);
- QGeocodeReply *geocode(QString requestString, const QGeoBoundingArea &bounds, int limit = -1, int offset = 0);
+ QGeocodeReply *geocode(QString requestString, const QGeoShape &bounds, int limit = -1, int offset = 0);
QString languageToMarc(QLocale::Language language);
QString getAuthenticationString() const;
diff --git a/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp b/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp
index 73315441..afa1244f 100644
--- a/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp
+++ b/src/plugins/geoservices/nokia/qgeoroutexmlparser.cpp
@@ -54,7 +54,7 @@
#include <QString>
#include <qgeoroute.h>
-#include <qgeoboundingbox.h>
+#include <QtLocation/QGeoRectangle>
QT_BEGIN_NAMESPACE
@@ -173,7 +173,7 @@ bool QGeoRouteXmlParser::parseRoute(QGeoRoute *route)
return false;
route->setPath(path);
} else if (m_reader->name() == "BoundingBox") {
- QGeoBoundingBox bounds;
+ QGeoRectangle bounds;
if (!parseBoundingBox(bounds))
return false;
route->setBounds(bounds);
@@ -556,7 +556,7 @@ bool QGeoRouteXmlParser::parseGeoPoints(const QString &strPoints, QList<QGeoCoor
return true;
}
-bool QGeoRouteXmlParser::parseBoundingBox(QGeoBoundingBox &bounds)
+bool QGeoRouteXmlParser::parseBoundingBox(QGeoRectangle &bounds)
{
Q_ASSERT(m_reader->isStartElement() && m_reader->name() == "BoundingBox");
@@ -586,7 +586,7 @@ bool QGeoRouteXmlParser::parseBoundingBox(QGeoBoundingBox &bounds)
return false;
if (tl.isValid() && br.isValid()) {
- bounds = QGeoBoundingBox(tl, br);
+ bounds = QGeoRectangle(tl, br);
return true;
}
diff --git a/src/plugins/geoservices/nokia/qgeoroutexmlparser.h b/src/plugins/geoservices/nokia/qgeoroutexmlparser.h
index 98241609..d33ffafe 100644
--- a/src/plugins/geoservices/nokia/qgeoroutexmlparser.h
+++ b/src/plugins/geoservices/nokia/qgeoroutexmlparser.h
@@ -62,7 +62,7 @@ class QIODevice;
class QXmlStreamReader;
class QGeoRoute;
class QGeoCoordinate;
-class QGeoBoundingBox;
+class QGeoRectangle;
class QGeoManeuverContainer
{
@@ -115,7 +115,7 @@ private:
bool parseLink();
bool postProcessRoute(QGeoRoute *route);
- bool parseBoundingBox(QGeoBoundingBox &bounds);
+ bool parseBoundingBox(QGeoRectangle &bounds);
bool parseDynamicSpeedInfo(QGeoDynamicSpeedInfoContainer &speedInfo);
QGeoRouteRequest m_request;
diff --git a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
index b9a352c1..18ecef97 100644
--- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp
@@ -55,7 +55,7 @@
#include <QStringList>
#include <QUrl>
#include <QLocale>
-#include <qgeoboundingbox.h>
+#include <QtLocation/QGeoRectangle>
QT_BEGIN_NAMESPACE
@@ -371,10 +371,10 @@ QString QGeoRoutingManagerEngineNokia::routeRequestString(const QGeoRouteRequest
{
QString requestString;
- const QList<QGeoBoundingBox> excludeAreas = request.excludeAreas();
- QList<QGeoBoundingBox>::const_iterator beg = excludeAreas.begin();
- QList<QGeoBoundingBox>::const_iterator end = excludeAreas.begin();
- for (QList<QGeoBoundingBox>::const_iterator it = beg; it != end; ++it) {
+ const QList<QGeoRectangle> excludeAreas = request.excludeAreas();
+ QList<QGeoRectangle>::const_iterator beg = excludeAreas.begin();
+ QList<QGeoRectangle>::const_iterator end = excludeAreas.begin();
+ for (QList<QGeoRectangle>::const_iterator it = beg; it != end; ++it) {
requestString += QLatin1String("&avoidareas=");
requestString += trimDouble(it->topLeft().latitude());
requestString += QLatin1String(",");
diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
index f17be015..e7f63efa 100644
--- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
@@ -181,7 +181,7 @@ void QGeoTiledMappingManagerEngineNokia::loadCopyrightsDescriptorsFromJson(const
qreal left = box[1].toDouble();
qreal bottom = box[2].toDouble();
qreal right = box[3].toDouble();
- QGeoBoundingBox boundingBox(QGeoCoordinate(top > bottom? top : bottom,
+ QGeoRectangle boundingBox(QGeoCoordinate(top > bottom? top : bottom,
left),
QGeoCoordinate(top > bottom? bottom : top,
right));
@@ -198,7 +198,7 @@ QString QGeoTiledMappingManagerEngineNokia::evaluateCopyrightsText(const QGeoMap
const QSet<QGeoTileSpec> &tiles)
{
typedef QSet<QGeoTileSpec>::const_iterator tile_iter;
- QGeoBoundingBox viewport;
+ QGeoRectangle viewport;
double viewX0, viewY0, viewX1, viewY1;
tile_iter tile = tiles.constBegin();
@@ -247,7 +247,7 @@ QString QGeoTiledMappingManagerEngineNokia::evaluateCopyrightsText(const QGeoMap
if (descriptorList[descIndex].minLevel <= zoomLevel && zoomLevel <= descriptorList[descIndex].maxLevel) {
descriptor = &descriptorList[descIndex];
for (boxIndex = 0; boxIndex < descriptor->boxes.count(); boxIndex++) {
- QGeoBoundingBox box = descriptor->boxes[boxIndex];
+ QGeoRectangle box = descriptor->boxes[boxIndex];
QGeoCoordinate topRight = box.topRight();
QGeoCoordinate bottomLeft = box.bottomLeft();
diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h
index 693b9266..553d6dae 100644
--- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h
+++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h
@@ -50,7 +50,7 @@
#define QGEOTILEDMAPPINGMANAGERENGINE_NOKIA_H
#include "qgeotiledmappingmanagerengine_p.h"
-#include "qgeoboundingbox.h"
+#include <QtLocation/QGeoRectangle>
#include "qgeomaptype_p.h"
#include <QGeoServiceProvider>
@@ -94,7 +94,7 @@ private:
qreal maxLevel;
qreal minLevel;
- QList<QGeoBoundingBox> boxes;
+ QList<QGeoRectangle> boxes;
QString alt;
QString label;
};
diff --git a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
index 02205e63..0ecf0cb0 100644
--- a/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
+++ b/src/plugins/geoservices/nokia/qplacemanagerengine_nokiav2.cpp
@@ -71,7 +71,7 @@
#include <QtNetwork/QNetworkProxyFactory>
#include <QtLocation/QPlaceContentRequest>
-#include <QtLocation/QGeoBoundingCircle>
+#include <QtLocation/QGeoCircle>
QT_BEGIN_NAMESPACE
@@ -346,18 +346,18 @@ QPlaceContentReply *QPlaceManagerEngineNokiaV2::getPlaceContent(const QString &p
return reply;
}
-static void addAtForBoundingArea(const QGeoBoundingArea &area,
+static void addAtForBoundingArea(const QGeoShape &area,
QUrlQuery *queryItems)
{
QGeoCoordinate center;
switch (area.type()) {
- case QGeoBoundingArea::BoxType:
- center = QGeoBoundingBox(area).center();
+ case QGeoShape::RectangleType:
+ center = QGeoRectangle(area).center();
break;
- case QGeoBoundingArea::CircleType:
- center = QGeoBoundingCircle(area).center();
+ case QGeoShape::CircleType:
+ center = QGeoCircle(area).center();
break;
- case QGeoBoundingArea::UnknownType:
+ case QGeoShape::UnknownType:
break;
}
diff --git a/src/plugins/geoservices/nokia_places_jsondb/jsondb.cpp b/src/plugins/geoservices/nokia_places_jsondb/jsondb.cpp
index 05dd0744..69ee138d 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/jsondb.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/jsondb.cpp
@@ -41,7 +41,6 @@
#include "icon.h"
#include "jsondb.h"
-#include "qgeoboundingcircle.h"
#include "qplacemanagerengine_jsondb.h"
#include <QtCore/QDebug>
@@ -53,6 +52,7 @@
#include <QtJsonDb/QJsonDbWriteRequest>
#include <QtLocation/QPlaceSearchRequest>
#include <QtLocation/QPlaceCategory>
+#include <QtLocation/QGeoCircle>
const QLatin1String JsonDb::Uuid("_uuid");
const QLatin1String JsonDb::Type("_type");
@@ -847,9 +847,9 @@ void JsonDb::searchForPlaces(const QPlaceSearchRequest &request, QObject *parent
queryString += QString::fromLatin1("]");
}
- if (request.searchArea().type() == QGeoBoundingArea::BoxType) {
+ if (request.searchArea().type() == QGeoShape::RectangleType) {
const double epsilon = 0.0001;
- QGeoBoundingBox box(request.searchArea());
+ QGeoRectangle box(request.searchArea());
double tly = box.topLeft().latitude();
double bry = box.bottomRight().latitude();
double tlx = box.topLeft().longitude();
diff --git a/src/plugins/geoservices/nokia_places_jsondb/matchreply.cpp b/src/plugins/geoservices/nokia_places_jsondb/matchreply.cpp
index 331ae5c3..e90e5c38 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/matchreply.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/matchreply.cpp
@@ -46,7 +46,7 @@
#include <QtCore/QJsonArray>
#include <QtCore/QDebug>
#include <QtJsonDb/QJsonDbReadRequest>
-#include <QtLocation/QGeoBoundingCircle>
+#include <QtLocation/QGeoCircle>
MatchReply::MatchReply(QPlaceManagerEngineJsonDb *engine)
: QPlaceMatchReply(engine), m_engine(engine)
diff --git a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
index 92f8d046..eb28eca4 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/qplacemanagerengine_jsondb.cpp
@@ -262,7 +262,7 @@ QPlace QPlaceManagerEngineJsonDb::compatiblePlace(const QPlace &original) const
QGeoCoordinate coord = original.location().coordinate();
coord.setAltitude(qQNaN());
location.setCoordinate(coord);
- location.setBoundingBox(QGeoBoundingBox());
+ location.setBoundingBox(QGeoRectangle());
place.setLocation(location);
QList<QPlaceContactDetail> details;
diff --git a/src/plugins/geoservices/nokia_places_jsondb/searchreply.cpp b/src/plugins/geoservices/nokia_places_jsondb/searchreply.cpp
index 6c2ae59a..4a6ceab7 100644
--- a/src/plugins/geoservices/nokia_places_jsondb/searchreply.cpp
+++ b/src/plugins/geoservices/nokia_places_jsondb/searchreply.cpp
@@ -43,7 +43,7 @@
#include <QtCore/qnumeric.h>
#include <QtCore/QDebug>
-#include <QtLocation/QGeoBoundingCircle>
+#include <QtLocation/QGeoCircle>
#include <QtJsonDb/QJsonDbReadRequest>
#include <QtLocation/QPlaceResult>
@@ -73,15 +73,15 @@ void SearchReply::setRequest(const QPlaceSearchRequest &request)
void SearchReply::start()
{
- if (request().searchArea().type() == QGeoBoundingArea::BoxType) {
- QGeoBoundingBox box(request().searchArea());
+ if (request().searchArea().type() == QGeoShape::RectangleType) {
+ QGeoRectangle box(request().searchArea());
if (!box.isValid()) {
triggerDone(QPlaceReply::BadArgumentError,
QString::fromLatin1("Bounding box search area is invalid"));
return;
}
- } else if (request().searchArea().type() == QGeoBoundingArea::CircleType) {
- QGeoBoundingCircle circle(request().searchArea());
+ } else if (request().searchArea().type() == QGeoShape::CircleType) {
+ QGeoCircle circle(request().searchArea());
if (!circle.center().isValid() || qIsNaN(circle.center().latitude()) || qIsNaN(circle.center().longitude())) {
triggerDone(QPlaceReply::BadArgumentError,
QString::fromLatin1("The center of the search area is an invalid coordinate"));
@@ -122,13 +122,13 @@ void SearchReply::searchFinished()
QList<QPlaceResult> results;
QPlaceResult result;
- const QGeoBoundingArea &area = request().searchArea();
- const QGeoBoundingArea::AreaType &type = area.type();
- const QGeoCoordinate &center = type == QGeoBoundingArea::CircleType ? static_cast<QGeoBoundingCircle>(area).center() :
- type == QGeoBoundingArea::BoxType ? static_cast<QGeoBoundingBox>(area).center() :
+ const QGeoShape &area = request().searchArea();
+ const QGeoShape::ShapeType &type = area.type();
+ const QGeoCoordinate &center = type == QGeoShape::CircleType ? static_cast<QGeoCircle>(area).center() :
+ type == QGeoShape::RectangleType ? static_cast<QGeoRectangle>(area).center() :
QGeoCoordinate();
- const bool noDistanceFilter = type == QGeoBoundingArea::CircleType
- && static_cast<QGeoBoundingCircle>(area).radius() < 0.0;
+ const bool noDistanceFilter = type == QGeoShape::CircleType
+ && static_cast<QGeoCircle>(area).radius() < 0.0;
// First filter the results
foreach (const QPlace &place, places) {