AfriGIS Map SDK (BB10)  v 1.0.0
Provides easy integration of AfriGIS Maps into BB10 platform.
AGMapDataStruct.hpp
1 /*
2  * Location.hpp
3  *
4  * Created on: Jan 9, 2013
5  * Author: USER
6  */
7 
8 #ifndef AG_MAP_DATA_STRUCT
9 #define AG_MAP_DATA_STRUCT
10 
11 #include <QString>
12 
13 enum AGTrackMeType { AGTrackMeTypeAccuracy, AGTrackMeTypeDirection, AGTrackMeTypeBoth };
14 
15 enum AGSignalType
16 {
17  AGSignalUserLocated,
18  AGSignalUserLocatingFailed,
19  AGSignalTrackingStarted,
20  AGSignalTrackingStopped,
21  AGSignalMapViewTouchedDown
22 };
23 
24 /*
25  * CLLocationDegrees
26  *
27  * Discussion:
28  * Type used to represent a latitude or longitude coordinate in degrees under the WGS 84 reference
29  * frame. The degree can be positive (North and East) or negative (South and West).
30  */
31 typedef double AGLocationDegrees;
32 
33 typedef double AGPixelCoordinate;
34 
35 typedef double AGOffsetCoordinate;
36 
37 /*
38  * CLLocationAccuracy
39  *
40  * Discussion:
41  * Type used to represent a location accuracy level in meters. The lower the value in meters, the
42  * more physically precise the location is. A negative accuracy value indicates an invalid location.
43  */
44 typedef double AGLocationAccuracy;
45 
46 /*
47  * CLLocationSpeed
48  *
49  * Discussion:
50  * Type used to represent the speed in meters per second.
51  */
52 typedef double AGLocationSpeed;
53 
54 /*
55  * CLLocationDirection
56  *
57  * Discussion:
58  * Type used to represent the direction in degrees from 0 to 359.9. A negative value indicates an
59  * invalid direction.
60  */
61 typedef double AGLocationDirection;
62 typedef double AGLocationDistance;
63 
64 /*
65  * CLLocationCoordinate2D
66  *
67  * Discussion:
68  * A structure that contains a geographical coordinate.
69  *
70  * Fields:
71  * latitude:
72  * The latitude in degrees.
73  * longitude:
74  * The longitude in degrees.
75  */
76 
77 
78 
83 typedef struct {
84  AGLocationDegrees latitude;
85  AGLocationDegrees longitude;
87 
88 
93 typedef struct {
94  AGPixelCoordinate localPixelX;
95  AGPixelCoordinate localPixelY;
97 
103  AGOffsetCoordinate offsetX;
104  AGOffsetCoordinate offsetY;
105 
106  AGOffsetInPixel(): offsetX(0.0), offsetY(0.0) {}
107 };
108 
109 
114 typedef struct
115 {
116  float x;
117  float y;
118  float z;
119 } AGVertex;
120 
126  AGLocationCoordinate2D *screenLowerLeftLatLon;
127  AGLocationCoordinate2D *screenLowerRightLatLon;
128  AGLocationCoordinate2D *screenUpperLeftLatLon;
129  AGLocationCoordinate2D *screenUpperRightLatLon;
130  AGLocationCoordinate2D *screenMiddleLatLon;
131  AGLocationCoordinate2D *longPressPointLatLon;
132  AGLocationCoordinate2D *currentLocation;
133  int zoomLevel;
134  float scaleX,scaleY;
135  QString remainingTimeToUpdateTraffic;
136 
139  int arg8, float arg9, float arg10, QString arg11)
140  {
141  screenLowerLeftLatLon = arg1;
142  screenLowerRightLatLon = arg2;
143  screenUpperLeftLatLon = arg3;
144  screenUpperRightLatLon = arg4;
145  screenMiddleLatLon = arg5;
146  longPressPointLatLon = arg6;
147  currentLocation = arg7;
148  zoomLevel = arg8;
149  scaleX = arg9;
150  scaleY = arg10;
151  remainingTimeToUpdateTraffic = arg11;
152  }
154  {
155  if (screenLowerLeftLatLon)
156  {
157  delete(screenLowerLeftLatLon);
158  }
159  if (screenLowerRightLatLon)
160  {
161  delete(screenLowerRightLatLon);
162  }
163  if (screenUpperLeftLatLon)
164  {
165  delete(screenUpperLeftLatLon);
166  }
167  if (screenUpperRightLatLon)
168  {
169  delete(screenUpperRightLatLon);
170  }
171  if (screenMiddleLatLon)
172  {
173  delete(screenMiddleLatLon);
174  }
175  if (longPressPointLatLon)
176  {
177  delete(longPressPointLatLon);
178  }
179  if (currentLocation)
180  {
181  delete(currentLocation);
182  }
183  }
184 };
185 
186 inline void AGLocationCoordinate2DSet(AGLocationCoordinate2D *geoLocation,AGLocationDegrees latitude,AGLocationDegrees longitude)
187 {
188  geoLocation->latitude = latitude;
189  geoLocation->longitude = longitude;
190 }
191 
192 inline void AGLocalPixelCoordinate2DSet(AGLocalPixelCoordinate2D *pixelCoordinate, AGPixelCoordinate localPixelX, AGPixelCoordinate localPixelY)
193 {
194  pixelCoordinate->localPixelX = localPixelX;
195  pixelCoordinate->localPixelY = localPixelY;
196 }
197 
198 inline void AGOffsetInPixelSet(AGOffsetInPixel *offset, AGOffsetCoordinate offsetX, AGOffsetCoordinate offsetY)
199 {
200  offset->offsetX = offsetX;
201  offset->offsetY = offsetY;
202 }
203 
204 inline void AGVertexSet(AGVertex *vertex, float x, float y, float z)
205 {
206  vertex->x = x;
207  vertex->y = y;
208  vertex->z = z;
209 }
210 
215 typedef struct
216 {
217  unsigned int location;
218  unsigned int length;
219 } AGRange;
220 
221 /*
222  * CLLocationDistance
223  *
224  * Discussion:
225  * Type used to represent a distance in meters.
226  */
227 /*
228 typedef double CLLocationDistance;
229 
230 
231  * kCLDistanceFilterNone
232  *
233  * Discussion:
234  * Use as the distanceFilter property for CLLocationManager. This indicates
235  * to the location service that no minimum movement filter is desired - ie, client will be informed
236  * of any movement.
237 
238 extern const CLLocationDistance kCLDistanceFilterNone;
239 
240 
241  * kCLLocationAccuracy<x>
242  *
243  * Discussion:
244  * Used to specify the accuracy level desired. The location service will try its best to achieve
245  * your desired accuracy. However, it is not guaranteed. To optimize
246  * power performance, be sure to specify an appropriate accuracy for your usage scenario (eg,
247  * use a large accuracy value when only a coarse location is needed).
248 
249 //extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
250 extern const CLLocationAccuracy kCLLocationAccuracyBest;
251 extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
252 extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
253 extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
254 extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;
255 
256 
257  * kCLLocationCoordinate2DInvalid
258  *
259  * Discussion:
260  * Used to specify an invalid CLLocationCoordinate2D.
261 
262 extern const CLLocationCoordinate2D kCLLocationCoordinate2DInvalid __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
263 
264 #ifdef __cplusplus
265 extern "C" {
266 #endif
267 
268 
269  * CLLocationCoordinate2DIsValid
270  *
271  * Discussion:
272  * Returns YES if the specified coordinate is valid, NO otherwise.
273 
274 BOOL CLLocationCoordinate2DIsValid(CLLocationCoordinate2D coord) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
275 
276 
277  * CLLocationCoordinate2DMake:
278  *
279  * Discussion:
280  * Returns a new CLLocationCoordinate2D at the given latitude and longitude
281 
282 CLLocationCoordinate2D CLLocationCoordinate2DMake(CLLocationDegrees latitude, CLLocationDegrees longitude) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
283 
284 #ifdef __cplusplus
285 }
286 #endif
287 
288 
289  * CLLocation
290  *
291  * Discussion:
292  * Represents a geographical coordinate along with accuracy and timestamp information.
293 
294 NS_CLASS_AVAILABLE(10_6, 2_0)
295 @interface CLLocation : NSObject <NSCopying, NSCoding>
296 {
297 @private
298  id _internal;
299 }
300 
301 
302  * initWithLatitude:longitude:
303  *
304  * Discussion:
305  * Initialize with the specified latitude and longitude.
306 
307 - (id)initWithLatitude:(CLLocationDegrees)latitude
308  longitude:(CLLocationDegrees)longitude;
309 
310 
311  * initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:timestamp:
312  *
313  * Discussion:
314  * Initialize with the specified parameters.
315 
316 - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate
317  altitude:(CLLocationDistance)altitude
318  horizontalAccuracy:(CLLocationAccuracy)hAccuracy
319  verticalAccuracy:(CLLocationAccuracy)vAccuracy
320  timestamp:(NSDate *)timestamp;
321 
322 
323  * initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:course:speed:timestamp:
324  *
325  * Discussion:
326  * Initialize with the specified parameters.
327 
328 - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate
329  altitude:(CLLocationDistance)altitude
330  horizontalAccuracy:(CLLocationAccuracy)hAccuracy
331  verticalAccuracy:(CLLocationAccuracy)vAccuracy
332  course:(CLLocationDirection)course
333  speed:(CLLocationSpeed)speed
334  timestamp:(NSDate *)timestamp __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_2);
335 
336 
337  * coordinate
338  *
339  * Discussion:
340  * Returns the coordinate of the current location.
341 
342 @property(readonly, nonatomic) CLLocationCoordinate2D coordinate;
343 
344 
345  * altitude
346  *
347  * Discussion:
348  * Returns the altitude of the location. Can be positive (above sea level) or negative (below sea level).
349 
350 @property(readonly, nonatomic) CLLocationDistance altitude;
351 
352 
353  * horizontalAccuracy
354  *
355  * Discussion:
356  * Returns the horizontal accuracy of the location. Negative if the lateral location is invalid.
357 
358 @property(readonly, nonatomic) CLLocationAccuracy horizontalAccuracy;
359 
360 
361  * verticalAccuracy
362  *
363  * Discussion:
364  * Returns the vertical accuracy of the location. Negative if the altitude is invalid.
365 
366 @property(readonly, nonatomic) CLLocationAccuracy verticalAccuracy;
367 
368 
369  * course
370  *
371  * Discussion:
372  * Returns the course of the location in degrees true North. Negative if course is invalid.
373  *
374  * Range:
375  * 0.0 - 359.9 degrees, 0 being true North
376 
377 @property(readonly, nonatomic) CLLocationDirection course __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_2_2);
378 
379 
380  * speed
381  *
382  * Discussion:
383  * Returns the speed of the location in m/s. Negative if speed is invalid.
384 
385 @property(readonly, nonatomic) CLLocationSpeed speed __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_2_2);
386 
387 
388  * timestamp
389  *
390  * Discussion:
391  * Returns the timestamp when this location was determined.
392 
393 @property(readonly, nonatomic) NSDate *timestamp;
394 
395 
396  * description
397  *
398  * Discussion:
399  * Returns a string representation of the location.
400 
401 - (NSString *)description;
402 
403 
404  * getDistanceFrom:
405  *
406  * Discussion:
407  * Deprecated. Use -distanceFromLocation: instead.
408 
409 - (CLLocationDistance)getDistanceFrom:(const CLLocation *)location __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_2);
410 
411 
412  * distanceFromLocation:
413  *
414  * Discussion:
415  * Returns the lateral distance between two locations.
416 
417 - (CLLocationDistance)distanceFromLocation:(const CLLocation *)location __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_2);
418 
419 @end
420 
421 */
422 
423 #endif /* AG_MAP_DATA_STRUCT */
private.
Definition: AGMapDataStruct.hpp:215
AGLocalPixelCoordinate2D struct for local pixel coordinate.
Definition: AGMapDataStruct.hpp:93
private.
Definition: AGMapDataStruct.hpp:114
AGOffsetInPixel Move offset pixel to draw annotation item.
Definition: AGMapDataStruct.hpp:102
AGGeoInformation It will provide current bounding box information.
Definition: AGMapDataStruct.hpp:125
AGLocationCoordinate2D struct for latitude and longitude.
Definition: AGMapDataStruct.hpp:83