changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / common / GeoBoundingBox.h
1 /*
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
10  *
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.
16  */
17
18 #ifndef GEOBOUNDINGBOX_H
19 #define GEOBOUNDINGBOX_H
20
21 #include <vector>
22
23 #include "common/HereMaps_global.h"
24 #include "common/GeoBoundingArea.h"
25
26 HERE_MAPS_BEGIN_NAMESPACE
27
28 class GeoCoordinates;
29
30 class GeoBoundingBox;
31
32 /**
33  * This typedef defines a vector of instances of <code>GeoBoundingBox</code> as
34  * a type. 
35  */
36 typedef std::vector<GeoBoundingBox> GeoBoundingBoxList;
37
38 /**
39  * This class encapsulates a bounding box defined in terms of the geographic
40  * coordinates of its top-left and bottom-right corners. 
41  */
42 class EXPORT_API GeoBoundingBox : public GeoBoundingArea
43 {
44 public:
45     /**
46      * This method is the default constructor. 
47      */
48     GeoBoundingBox();
49
50     /**
51      * This method is a copy constructor. 
52      * 
53      * @param rRhs A constant reference to an object whose contents are to be
54      *        used to populate the new instance of this class. 
55      */
56     GeoBoundingBox(const GeoBoundingBox& rRhs);
57
58     /**
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
61      * caller.
62      * 
63      * @param rTopLeft A constant reference to an object providing the
64      *        geographic coordinates of the top-left corner of the given
65      *        bounding box.
66      * 
67      * @param rBottomRight A constant reference to an object providing the
68      *        geographic coordinates of the bottom-right corner of the given
69      *        bounding box.
70      */
71     GeoBoundingBox(const GeoCoordinates& rTopLeft, const GeoCoordinates& rBottomRight);
72
73     /**
74      * This method constructs a rectangle from the coordinates of its boundaries.
75      *
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.
78      *
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.
83      */
84     GeoBoundingBox( double west, double east, double south, double north );
85
86     /**
87      * This method is the destructor. 
88      */
89     ~GeoBoundingBox();
90
91     /**
92      * This is the assignment operator.
93      * 
94      * @param rRhs A constant reference to an object whose contents
95      *        are to be copied to the given instance of the class.
96      * 
97      * @return A reference to the given instance of the class after the
98      *        assignment. 
99      */
100     GeoBoundingBox& operator=(const GeoBoundingBox& rRhs);
101
102     /**
103      * This method sets the coordinates of the top-left corner of the given
104      * instance of <code>GeoBoundingBox</code>.
105      * 
106      * @param A constant reference to an object containing the new geographic
107      *        coordinates of the top-left corner of the bounding box.
108      */
109     void SetTopLeft(const GeoCoordinates& rCoord);
110
111     /**
112      * This method retrieves the coordinates of the top-left corner of the given
113      * instance of <code>GeoBoundingBox</code>.
114      * 
115      * @return A constant reference to an object containing the geographic
116      *        coordinates of the top-left corner of the bounding box.
117      */
118     const GeoCoordinates& GetTopLeft() const;
119
120     /**
121      * This method sets the coordinates of the bottom-right corner of the given
122      * instance of <code>GeoBoundingBox</code>.
123      * 
124      * @param A constant reference to an object containing the new geographic
125      *        coordinates of the bottom-right corner of the bounding box.
126      */
127     void SetBottomRight(const GeoCoordinates& rCoord);
128
129     /**
130      * This method retrieves the coordinates of the bottom-right corner of the
131      * given instance of <code>GeoBoundingBox</code>.
132      * 
133      * @return A constant reference to an object containing the geographic
134      *        coordinates of the bottom-right corner of the bounding box.
135      */
136     const GeoCoordinates& GetBottomRight() const;
137
138     /**
139      * This method calculates a bounding box that represents the union of the
140      * given <code>GeoBoundingBox</code> and the instance provided by the
141      * caller.
142      * 
143      * @param A constant reference to an object for which to calculate a union
144      *        with the given instance of <code>GeoBoundingBox</code>.
145      *
146      * @return An object representing the union of two instances of
147      *        <code>GeoBoundingBox</code>.
148      */
149     GeoBoundingBox Union(const GeoBoundingBox& rOther);
150
151     /**
152      * This method retrieves a value indicating the area type represented by the
153      * given object.
154      * 
155      * @return A value indicating the area type. 
156      */
157     AreaType GetType() const;
158
159     /**
160      * This method checks if the given bounding box contains the location
161      * provided by the caller.
162      * 
163      * @param rCoordinate An object containing the geographic coordinates of the
164      *        location to check. 
165      * 
166      * @return <code>true</code> if the location lies within the given bounding
167      *        box, otherwise <code>false</code>. 
168      */
169     bool Contains(const GeoCoordinates& rCoordinate) const;
170
171     /**
172      * This method checks if the coordinates of the given instance of
173      * <code>GeoBoundingBox</code> are valid.
174      *
175      * @return Value <code>true</code> if the coordinates of the top-left and
176      *        bottom-right corners are valid, otherwise <code>false</code>.
177      */
178     bool IsValid() const;
179
180 private:
181     class GeoBoundingBoxImpl;
182     GeoBoundingBoxImpl* m_pImpl;
183 };
184
185 HERE_MAPS_END_NAMESPACE
186
187 #endif