lbsposition.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : LbsPosition.h
00004 *  Part of     : Location Framework/Location FW
00005 *  Interface   : Location Acquisition API
00006 *  Description : Position classes
00007 *  Version     : %version: 4 %
00008 *
00009 *  Copyright (c) 2002-2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation. All rights are reserved. Copying,
00013 *  including reproducing, storing, adapting or translating, any
00014 *  or all of this material requires the prior written consent of
00015 *  Nokia Corporation. This material also contains confidential
00016 *  information which may not be disclosed to others without the
00017 *  prior written consent of Nokia Corporation.
00018 * ==============================================================================
00019 */
00020 
00021 #ifndef __LBSPOSITION_H__
00022 #define __LBSPOSITION_H__
00023 
00024 #include <e32std.h>
00025 
00035 typedef TUid TPositionDatumId;
00036 
00040 const TPositionDatumId KPositionDatumWgs84 = {0x101FAA29};
00041 
00042 
00047 class TCoordinate
00048         {
00049 public:
00050 
00055         IMPORT_C TCoordinate();
00056 
00064         IMPORT_C TCoordinate(const TReal64& aLatitude,
00065                              const TReal64& aLongitude);
00066 
00075         IMPORT_C TCoordinate(const TReal64& aLatitude,
00076                              const TReal64& aLongitude,
00077                              TReal32 aAltitude);
00078 
00085         IMPORT_C void SetCoordinate(const TReal64& aLatitude,
00086                                     const TReal64& aLongitude);
00087 
00094         IMPORT_C void SetCoordinate(const TReal64& aLatitude,
00095                                     const TReal64& aLongitude,
00096                                     TReal32 aAltitude);
00097 
00102         IMPORT_C void SetDatum(TPositionDatumId aDatum);
00103 
00108         IMPORT_C TReal64 Latitude() const;
00109 
00114         IMPORT_C TReal64 Longitude() const;
00115 
00120         IMPORT_C TReal32 Altitude() const;
00121 
00126         IMPORT_C TPositionDatumId Datum() const;
00127 
00128 
00140         IMPORT_C TInt Distance(const TCoordinate& aCoordinate,
00141                                TReal32& aDistance) const;
00142 
00157         IMPORT_C TInt BearingTo(const TCoordinate& aTargetCoordinate,
00158                                 TReal32& aBearing) const;
00159 
00171         IMPORT_C TInt Move(TReal32 aBearing, TReal32 aDistance);
00172 
00173 private:
00177         void NormalizeCoordinate();
00178 
00179 protected:
00181         TReal64 iLatitude;
00183         TReal64 iLongitude;
00185         TReal32 iAltitude;
00187         TPositionDatumId iDatum;
00189         TUint8 iReserved[4];
00190         };
00191 
00192 
00199 class TLocality : public TCoordinate
00200         {
00201 public:
00206         IMPORT_C TLocality();
00207 
00218         IMPORT_C TLocality(const TCoordinate& aCoordinate,
00219                            TReal32 aHorizontalAccuracy);
00220 
00233         IMPORT_C TLocality(const TCoordinate& aCoordinate,
00234                            TReal32 aHorizontalAccuracy,
00235                            TReal32 aVerticalAccuracy);
00236 
00244         IMPORT_C void SetHorizontalAccuracy(TReal32 aHorizontalAccuracy);
00245     
00253         IMPORT_C void SetVerticalAccuracy(TReal32 aVerticalAccuracy);
00254 
00263         IMPORT_C void SetAccuracy(TReal32 aHorizontalAccuracy,
00264                                   TReal32 aVerticalAccuracy);
00265 
00270         IMPORT_C TReal32 HorizontalAccuracy() const;
00271 
00276         IMPORT_C TReal32 VerticalAccuracy() const;
00277 
00289         IMPORT_C TInt Distance(const TCoordinate& aCoordinate,
00290                                TReal32& aDistance) const;
00291 
00308         IMPORT_C TInt Distance(const TLocality& aLocality,
00309                                TReal32& aDistance,
00310                                TReal32& aDelta) const;
00311 
00326         IMPORT_C TInt BearingTo(const TCoordinate& aTargetCoordinate,
00327                                 TReal32& aBearing) const;
00328 
00351         IMPORT_C TInt BearingTo(const TLocality& aTargetLocality,
00352                                 TReal32& aBearing,
00353                                 TReal32& aDelta) const;
00354 
00355 protected:
00357         TReal32 iHorizontalAccuracy;
00359         TReal32 iVerticalAccuracy;
00360 
00361 private:
00363         TUint8 iReserved[16];
00364         };
00365 
00366 
00380 class TPosition : public TLocality
00381         {
00382 public:
00387         IMPORT_C TPosition();
00388 
00396         IMPORT_C TPosition(const TLocality& aLocality,
00397                            TTime aTime);
00398 
00403         IMPORT_C void SetTime(TTime aTime);
00404 
00409         IMPORT_C void SetCurrentTime();
00410 
00416         IMPORT_C TTime Time() const;
00417 
00433         IMPORT_C TInt Speed(const TPosition& aPosition,
00434                             TReal32& aSpeed) const;
00455         IMPORT_C TInt Speed(const TPosition& aPosition,
00456                             TReal32& aSpeed,
00457                             TReal32& aDelta) const;
00458 
00459 protected:
00462         TTime iTime;
00463 
00464 private:
00466         TUint8 iReserved[16];
00467         };
00468 
00469 
00476 class TCourse
00477         {
00478 public:
00483         IMPORT_C TCourse();
00484 
00489         IMPORT_C TReal32 Speed() const;
00490 
00495         IMPORT_C TReal32 Heading() const;
00496 
00501     IMPORT_C TReal32 Course() const;
00502 
00507         IMPORT_C TReal32 SpeedAccuracy() const;
00508 
00513         IMPORT_C TReal32 HeadingAccuracy() const;
00514 
00519     IMPORT_C TReal32 CourseAccuracy() const;
00520 
00525         IMPORT_C void SetSpeed(TReal32 aSpeed);
00526 
00531         IMPORT_C void SetHeading(TReal32 aHeading);
00532 
00538         IMPORT_C void SetSpeedAccuracy(TReal32 aSpeedAccuracy);
00539 
00545         IMPORT_C void SetHeadingAccuracy(TReal32 aHeadingAccuracy);
00546 
00551         IMPORT_C void SetCourse(TReal32 aCourse);
00552 
00558         IMPORT_C void SetCourseAccuracy(TReal32 aCourseAccuracy);
00559 
00560 protected:
00562         TReal32 iSpeed;
00564         TReal32 iHeading;
00566         TReal32 iSpeedAccuracy;
00568         TReal32 iHeadingAccuracy;
00570         TReal32 iCourse;
00572         TReal32 iCourseAccuracy;
00573 
00574 private:
00576         TUint8 iReserved[16];
00577         };
00578 
00579 //__LBSPOSITION_H__
00580 #endif

Copyright © Nokia Corporation 2001-2008
Back to top