TCoordinate Class Reference

API published in: S60 2nd Ed FP 2

Link against: lbs.lib

Capability Information

Required Capabilities

None

Exceptions

The capability Location is required in:

TInt RPositionServer::GetDefaultModuleId(TPositionModuleId& aModuleId) const;

TInt RPositionServer::GetNumModules(TUint& aNumModules) const;

TInt RPositionServer::GetModuleInfoByIndex(TInt aModuleIndex, TPositionModuleInfoBase& aModuleInfo) const;

TInt RPositionServer::GetModuleInfoById(TPositionModuleId aModuleId, TPositionModuleInfoBase& aModuleInfo) const;

TInt RPositionServer::GetModuleStatus(TPositionModuleStatusBase& aPosModuleStatus, TPositionModuleId aModuleId) const;

void RPositionServer::NotifyModuleStatusEvent(TPositionModuleStatusEventBase& aStatusEvent,TRequestStatus& aStatus,const TPositionModuleId aModuleId = KPositionNullModuleId) const;

TInt RPositioner::SetRequestor(CRequestor::TRequestorType aType,CRequestor::TRequestorFormat aFormat,const TDesC& aData);

TInt RPositioner::SetRequestor(const RRequestorStack& aRequestorStack);

TInt RPositioner::SetUpdateOptions(const TPositionUpdateOptionsBase& aPosOption);

TInt RPositioner::GetUpdateOptions(TPositionUpdateOptionsBase& aPosOption) const;

void RPositioner::GetLastKnownPosition(TPositionInfoBase& aPosInfo,TRequestStatus& aStatus) const;

void RPositioner::NotifyPositionUpdate(TPositionInfoBase& aPosInfo,TRequestStatus& aStatus) const;


#include <lbsposition.h>

Inherited by TLocality.


Detailed Description

TCoordinate is used to hold the basic coordinates of a location (latitude, longitude and altitude).

Public Member Functions

IMPORT_C  TCoordinate ()
  Default constructor for TCoordinate.
IMPORT_C  TCoordinate (const TReal64 &aLatitude, const TReal64 &aLongitude)
  Constructor for TCoordinate.
IMPORT_C  TCoordinate (const TReal64 &aLatitude, const TReal64 &aLongitude, TReal32 aAltitude)
  Constructor for TCoordinate.
IMPORT_C void  SetCoordinate (const TReal64 &aLatitude, const TReal64 &aLongitude)
  This method assigns a new latitude and longitude to the object.
IMPORT_C void  SetCoordinate (const TReal64 &aLatitude, const TReal64 &aLongitude, TReal32 aAltitude)
  This method assigns a new latitude, longitude and altitude to the object.
IMPORT_C void  SetDatum (TPositionDatumId aDatum)
  This method assigns a new datum to the object.
IMPORT_C TReal64  Latitude () const
  Accessor for latitude.
IMPORT_C TReal64  Longitude () const
  Accessor for longitude.
IMPORT_C TReal32  Altitude () const
  Accessor for altitude.
IMPORT_C TPositionDatumId  Datum () const
  Accessor for the datum.
IMPORT_C TInt  Distance (const TCoordinate &aCoordinate, TReal32 &aDistance) const
  This method calculates the distance between this coordinate and the supplied coordinate.
IMPORT_C TInt  BearingTo (const TCoordinate &aTargetCoordinate, TReal32 &aBearing) const
  This method calculates the bearing from this coordinate to the supplied coordinate.
IMPORT_C TInt  Move (TReal32 aBearing, TReal32 aDistance)
  This method moves this coordinate aDistance in the direction specified by aBearing.

Protected Attributes

TReal64  iLatitude
  Latitude, defaults to WGS-84 format.
TReal64  iLongitude
  Longitude, defaults to WGS-84 format.
TReal32  iAltitude
  Altitude, defaults to WGS-84 format.
TPositionDatumId  iDatum
  The ID of the datum the coordinate is in, defaults to WGS-84 format.
TUint8  iReserved [4]
  Unused variable for future expansion.

Constructor & Destructor Documentation

IMPORT_C TCoordinate::TCoordinate  ) 
 

Default constructor for TCoordinate.

Sets the member data to default values (NaN).

IMPORT_C TCoordinate::TCoordinate const TReal64 &  aLatitude,
const TReal64 &  aLongitude
 

Constructor for TCoordinate.

Allows the client to set just latitude and longitude, and sets the altitude to its default value (NaN).

Parameters:
[in]  aLatitude  specifies an initial value for latitude.
[in]  aLongitude  specifies an initial value for longitude.
IMPORT_C TCoordinate::TCoordinate const TReal64 &  aLatitude,
const TReal64 &  aLongitude,
TReal32  aAltitude
 

Constructor for TCoordinate.

Allows the client to set the latitude, longitude and altitude.

Parameters:
[in]  aLatitude  specifies an initial value for latitude.
[in]  aLongitude  specifies an initial value for longitude.
[in]  aAltitude  specifies an initial value for altitude.

Member Function Documentation

IMPORT_C TReal32 TCoordinate::Altitude  )  const
 

Accessor for altitude.

Returns:
the altitude component of this coordinate, in metres.
IMPORT_C TInt TCoordinate::BearingTo const TCoordinate aTargetCoordinate,
TReal32 &  aBearing
const
 

This method calculates the bearing from this coordinate to the supplied coordinate.

Parameters:
[in]  aTargetCoordinate  is the supplied target coordinate.
[out]  aBearing  upon successful completion, this is set to the bearing from this coordinate to aTargetCoordinate, in degrees counting clockwise relative to true north.
Returns:
a Symbian OS error code.

KErrArgument if any of iLatitude, iLongitude, aTargetCoordinate.iLatitude or aTargetCoordinate.iLongitude are set to NaN.

KErrPositionIncalculable if this coordinate is at a pole or if the two coordinates are the same or antipodal.

Reimplemented in TLocality.

IMPORT_C TPositionDatumId TCoordinate::Datum  )  const
 

Accessor for the datum.

Returns:
the datum of this coordinate.
IMPORT_C TInt TCoordinate::Distance const TCoordinate aCoordinate,
TReal32 &  aDistance
const
 

This method calculates the distance between this coordinate and the supplied coordinate.

Parameters:
[in]  aCoordinate  is another point to use in the calculation.
[out]  aDistance  upon successful completion, this is set to the distance between this coordinate and aCoordinate, in metres.
Returns:
a Symbian OS error code.

KErrArgument if any of iLatitude, iLongitude, aCoordinate.iLatitude or aCoordinate.iLongitude are set to NaN.

Reimplemented in TLocality.

IMPORT_C TReal64 TCoordinate::Latitude  )  const
 

Accessor for latitude.

Returns:
the latitude component of this coordinate.
IMPORT_C TReal64 TCoordinate::Longitude  )  const
 

Accessor for longitude.

Returns:
the longitude component of this coordinate.
IMPORT_C TInt TCoordinate::Move TReal32  aBearing,
TReal32  aDistance
 

This method moves this coordinate aDistance in the direction specified by aBearing.

Parameters:
aBearing  is the direction to move this coordinate, in degrees counting clockwise relative to true north.
aDistance  is the distance to move this coordinate, in metres.
Returns:
a Symbian OS error code.

KErrArgument if any of iLongitude or iLatitude are set to NaN.

KErrPositionIncalculable if this coordinate is at a pole.

IMPORT_C void TCoordinate::SetCoordinate const TReal64 &  aLatitude,
const TReal64 &  aLongitude,
TReal32  aAltitude
 

This method assigns a new latitude, longitude and altitude to the object.

Parameters:
[in]  aLatitude  specifies a new latitude.
[in]  aLongitude  specifies a new longitude.
aAltitude  specifies a new altitude.
IMPORT_C void TCoordinate::SetCoordinate const TReal64 &  aLatitude,
const TReal64 &  aLongitude
 

This method assigns a new latitude and longitude to the object.

The altitude is set to its default value (NaN).

Parameters:
[in]  aLatitude  specifies a new latitude.
[in]  aLongitude  specifies a new longitude.
IMPORT_C void TCoordinate::SetDatum TPositionDatumId  aDatum  ) 
 

This method assigns a new datum to the object.

Parameters:
aDatum  specifies a new datum.

Field Documentation

TReal32 TCoordinate::iAltitude [protected]
 

Altitude, defaults to WGS-84 format.

TPositionDatumId TCoordinate::iDatum [protected]
 

The ID of the datum the coordinate is in, defaults to WGS-84 format.

TReal64 TCoordinate::iLatitude [protected]
 

Latitude, defaults to WGS-84 format.

TReal64 TCoordinate::iLongitude [protected]
 

Longitude, defaults to WGS-84 format.

TUint8 TCoordinate::iReserved[4] [protected]
 

Unused variable for future expansion.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top