2 * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3 * This software, including documentation, is protected by copyright controlled by
4 * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5 * storing, adapting or translating, any or all of this material requires the prior
6 * written consent of HERE Global B.V. You may use this
7 * Software in accordance with the terms and conditions defined in the
8 * HERE Location Platform Services Terms and Conditions, available at
9 * http://developer.here.com/terms-conditions-base
11 * As an additional permission to the above, you may distribute Software,
12 * in object code format as part of an Application, according to, and subject to, terms and
13 * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14 * You may distribute such object code format Application under terms of your choice,
15 * provided that the header and source files of the Software have not been modified.
18 #ifndef GEOBOUNDINGBOX_H
19 #define GEOBOUNDINGBOX_H
23 #include "common/HereMaps_global.h"
24 #include "common/GeoBoundingArea.h"
26 HERE_MAPS_BEGIN_NAMESPACE
33 * This typedef defines a vector of instances of <code>GeoBoundingBox</code> as
36 typedef std::vector<GeoBoundingBox> GeoBoundingBoxList;
39 * This class encapsulates a bounding box defined in terms of the geographic
40 * coordinates of its top-left and bottom-right corners.
42 class EXPORT_API GeoBoundingBox : public GeoBoundingArea
46 * This method is the default constructor.
51 * This method is a copy constructor.
53 * @param rRhs A constant reference to an object whose contents are to be
54 * used to populate the new instance of this class.
56 GeoBoundingBox(const GeoBoundingBox& rRhs);
59 * This method is a constructor that creates a new instance, using the
60 * coordinates of the top-left and bottom=right corners provided by the
63 * @param rTopLeft A constant reference to an object providing the
64 * geographic coordinates of the top-left corner of the given
67 * @param rBottomRight A constant reference to an object providing the
68 * geographic coordinates of the bottom-right corner of the given
71 GeoBoundingBox(const GeoCoordinates& rTopLeft, const GeoCoordinates& rBottomRight);
74 * This method constructs a rectangle from the coordinates of its boundaries.
76 * If <code>west</code> is larger than <code>east</code>, then the new
77 * rectangle lies on the opposite side of the globe, i.e. +180 meridian.
79 * @param west A value indicating the minimum longitude.
80 * @param east A value indicating the maximum longitude.
81 * @param south A value indicating the minimum latitude.
82 * @param north A value indicating the the maximum latitude.
84 GeoBoundingBox( double west, double east, double south, double north );
87 * This method is the destructor.
92 * This is the assignment operator.
94 * @param rRhs A constant reference to an object whose contents
95 * are to be copied to the given instance of the class.
97 * @return A reference to the given instance of the class after the
100 GeoBoundingBox& operator=(const GeoBoundingBox& rRhs);
103 * This method sets the coordinates of the top-left corner of the given
104 * instance of <code>GeoBoundingBox</code>.
106 * @param A constant reference to an object containing the new geographic
107 * coordinates of the top-left corner of the bounding box.
109 void SetTopLeft(const GeoCoordinates& rCoord);
112 * This method retrieves the coordinates of the top-left corner of the given
113 * instance of <code>GeoBoundingBox</code>.
115 * @return A constant reference to an object containing the geographic
116 * coordinates of the top-left corner of the bounding box.
118 const GeoCoordinates& GetTopLeft() const;
121 * This method sets the coordinates of the bottom-right corner of the given
122 * instance of <code>GeoBoundingBox</code>.
124 * @param A constant reference to an object containing the new geographic
125 * coordinates of the bottom-right corner of the bounding box.
127 void SetBottomRight(const GeoCoordinates& rCoord);
130 * This method retrieves the coordinates of the bottom-right corner of the
131 * given instance of <code>GeoBoundingBox</code>.
133 * @return A constant reference to an object containing the geographic
134 * coordinates of the bottom-right corner of the bounding box.
136 const GeoCoordinates& GetBottomRight() const;
139 * This method calculates a bounding box that represents the union of the
140 * given <code>GeoBoundingBox</code> and the instance provided by the
143 * @param A constant reference to an object for which to calculate a union
144 * with the given instance of <code>GeoBoundingBox</code>.
146 * @return An object representing the union of two instances of
147 * <code>GeoBoundingBox</code>.
149 GeoBoundingBox Union(const GeoBoundingBox& rOther);
152 * This method retrieves a value indicating the area type represented by the
155 * @return A value indicating the area type.
157 AreaType GetType() const;
160 * This method checks if the given bounding box contains the location
161 * provided by the caller.
163 * @param rCoordinate An object containing the geographic coordinates of the
166 * @return <code>true</code> if the location lies within the given bounding
167 * box, otherwise <code>false</code>.
169 bool Contains(const GeoCoordinates& rCoordinate) const;
172 * This method checks if the coordinates of the given instance of
173 * <code>GeoBoundingBox</code> are valid.
175 * @return Value <code>true</code> if the coordinates of the top-left and
176 * bottom-right corners are valid, otherwise <code>false</code>.
178 bool IsValid() const;
181 class GeoBoundingBoxImpl;
182 GeoBoundingBoxImpl* m_pImpl;
185 HERE_MAPS_END_NAMESPACE