Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::Coordinates Class Reference

Coordinates object. More...

Inheritance diagram for gem::Coordinates:
Collaboration diagram for gem::Coordinates:

Public Member Functions

 Coordinates ()=default
 Default constructor.
 Coordinates (double latitude, double longitude, double altitude=0., double vAccuracy=-1., double hAccuracy=-1., int parentSceneObject=SO_Earth)
 Create a coordinates object from latitude, longitude and altitude.
 Coordinates (std::initializer_list< double > ilist, int parentSceneObject=SO_Earth)
 Construct from initializer list.
 Coordinates (const Coordinates &)=default
 Default copy constructor.
 Coordinates (Coordinates &&)=default
 Default move constructor noexcept is deduced.
Coordinatesoperator= (const Coordinates &coord)=default
 Default copy assignment.
Coordinatesoperator= (Coordinates &&coord)=default
 Default move assignment noexcept is deduced.
Coordinatesassign (double latitude, double longitude, double altitude=0., double vAccuracy=-1., double hAccuracy=-1., int sceneObject=EMainSceneObjects::SO_Earth) noexcept
 Assign the given values.
bool operator== (Coordinates const &coord) const noexcept
 Compare if two WGS coordinates are equal.
bool operator!= (Coordinates const &coord) const noexcept
 Compare if two WGS coordinates are not equal.
double getLatitude () const noexcept
 Get latitude in degrees.
CoordinatessetLatitude (double latitude) noexcept
 Set latitude in degrees.
double getLongitude () const noexcept
 Get longitude in degrees.
CoordinatessetLongitude (double longitude) noexcept
 Set longitude in degrees.
double getAltitude () const noexcept
 Get altitude in meters.
CoordinatessetAltitude (double altitude) noexcept
 Set altitude in meters.
bool hasHorizontalAccuracy () const noexcept
 Check if the horizontal accuracy is valid or not.
double getHorizontalAccuracy () const noexcept
 Get the horizontal accuracy of the location in meters.
CoordinatessetHorizontalAccuracy (double) noexcept
 Set the horizontal accuracy of the location in meters.
bool hasVerticalAccuracy () const noexcept
 Check if the vertical accuracy is valid or not.
double getVerticalAccuracy () const noexcept
 Get the vertical accuracy of the location in meters.
CoordinatessetVerticalAccuracy (double) noexcept
 Set the vertical accuracy of the location in meters.
bool valid () const noexcept
 Check if the coordinates are valid.
double getDistance (Coordinates const &point) const noexcept
 Calculate the distance in meters between two WGS84 coordinates.
double getAzimuth (Coordinates const &point) const noexcept
 Calculate the azimuth between the two points according to the ellipsoid model of WGS84.
int getSceneObject () const noexcept
 Gets parent scene object to which coordinates belongs.

Detailed Description

Coordinates object.

Implements share-read / copy-on-write Api object over ICoordinates.

Constructor & Destructor Documentation

◆ Coordinates() [1/3]

gem::Coordinates::Coordinates ( )
default

Default constructor.

Creates an empty coordinate object in default scene object coordinates system( SO_Earth )

◆ Coordinates() [2/3]

gem::Coordinates::Coordinates ( double latitude,
double longitude,
double altitude = 0.,
double vAccuracy = -1.,
double hAccuracy = -1.,
int parentSceneObject = SO_Earth )
inline

Create a coordinates object from latitude, longitude and altitude.

Parameters
[in]latitudeLatitude in degrees. Valid values -90.0 .. +90.0.
[in]longitudeLongitude in degrees. Valid values -180.0 .. +180.0.
[in]altitudeAltitude in meters.
[in]vAccuracyAltitude accuracy in meters. Deprecated, will be ignored
[in]hAccuracyLatitude / longitude accuracy in meters. Deprecated, will be ignored
[in]parentSceneObjectParent scene object in which coordinates system values are expressed.

◆ Coordinates() [3/3]

gem::Coordinates::Coordinates ( std::initializer_list< double > ilist,
int parentSceneObject = SO_Earth )
inline

Construct from initializer list.

list[0] = latitude, list[1] = longitude, list[2] = altitude ( optional )

Parameters
[in]ilistInitializer list.
[in]parentSceneObjectParent scene object in which coordinates system values are expressed

Member Function Documentation

◆ assign()

Coordinates & gem::Coordinates::assign ( double latitude,
double longitude,
double altitude = 0.,
double vAccuracy = -1.,
double hAccuracy = -1.,
int sceneObject = EMainSceneObjects::SO_Earth )
inlinenoexcept

Assign the given values.

Parameters
[in]latitudeLatitude in degrees. Valid values -90.0 .. +90.0.
[in]longitudeLongitude in degrees. Valid values -180.0 .. +180.0.
[in]altitudeAltitude in meters.
[in]vAccuracyAltitude accuracy in meters. Deprecated, will be ignored
[in]hAccuracyLatitude / longitude accuracy in meters. Deprecated, will be ignored
[in]sceneObjectParent scene object in which coordinates system values are expressed.
Returns
*this

◆ getAltitude()

double gem::Coordinates::getAltitude ( ) const
inlinenoexcept

Get altitude in meters.

Returns
Altitude in meters.

◆ getAzimuth()

double gem::Coordinates::getAzimuth ( Coordinates const & point) const
inlinenoexcept

Calculate the azimuth between the two points according to the ellipsoid model of WGS84.

Parameters
point- the coordinates to which the azimuth should be calculated.
Returns
Azimuth in degrees between current coordinates and the point

◆ getDistance()

double gem::Coordinates::getDistance ( Coordinates const & point) const
inlinenoexcept

Calculate the distance in meters between two WGS84 coordinates.

Parameters
point- the coordinates to which the distance should be calculated.
Returns
Distance in meters between current coordinates and the point parameter.

◆ getHorizontalAccuracy()

double gem::Coordinates::getHorizontalAccuracy ( ) const
inlinenoexcept

Get the horizontal accuracy of the location in meters.

Deprecated
horizontal & vertical accuracy were removed from Coordinates
Returns
Always 0

◆ getLatitude()

double gem::Coordinates::getLatitude ( ) const
inlinenoexcept

Get latitude in degrees.

Valid values -90.0 .. +90.0.

Returns
Latitude in degrees.

◆ getLongitude()

double gem::Coordinates::getLongitude ( ) const
inlinenoexcept

Get longitude in degrees.

Valid values -180.0 .. +180.0.

Returns
Longitude in degrees.

◆ getSceneObject()

int gem::Coordinates::getSceneObject ( ) const
inlinenoexcept

Gets parent scene object to which coordinates belongs.

Returns
Scene object id, see EMainSceneObjects

◆ getVerticalAccuracy()

double gem::Coordinates::getVerticalAccuracy ( ) const
inlinenoexcept

Get the vertical accuracy of the location in meters.

Deprecated
horizontal & vertical accuracy were removed from Coordinates
Returns
Always 0

◆ hasHorizontalAccuracy()

bool gem::Coordinates::hasHorizontalAccuracy ( ) const
inlinenoexcept

Check if the horizontal accuracy is valid or not.

Deprecated
horizontal & vertical accuracy were removed from Coordinates
Returns
Always false

◆ hasVerticalAccuracy()

bool gem::Coordinates::hasVerticalAccuracy ( ) const
inlinenoexcept

Check if the vertical accuracy is valid or not.

Deprecated
horizontal & vertical accuracy were removed from Coordinates
Returns
Always false

◆ operator!=()

bool gem::Coordinates::operator!= ( Coordinates const & coord) const
inlinenoexcept

Compare if two WGS coordinates are not equal.

Parameters
coordThe coordinates to compare
Returns
True if the coordinates are not equal

◆ operator=() [1/2]

Coordinates & gem::Coordinates::operator= ( const Coordinates & coord)
default

Default copy assignment.

Returns
*this
Parameters
[in]coordCoordinates object to copy

◆ operator=() [2/2]

Coordinates & gem::Coordinates::operator= ( Coordinates && coord)
default

Default move assignment noexcept is deduced.

Returns
*this
Parameters
[in]coordCoordinates object to move

◆ operator==()

bool gem::Coordinates::operator== ( Coordinates const & coord) const
inlinenoexcept

Compare if two WGS coordinates are equal.

Parameters
coordThe coordinates to compare
Returns
True if the coordinates are equal

◆ setAltitude()

Coordinates & gem::Coordinates::setAltitude ( double altitude)
inlinenoexcept

Set altitude in meters.

Parameters
altitudeAltitude in meters.
Returns
*this

◆ setHorizontalAccuracy()

Coordinates & gem::Coordinates::setHorizontalAccuracy ( double )
inlinenoexcept

Set the horizontal accuracy of the location in meters.

Deprecated
horizontal & vertical accuracy were removed from Coordinates
Returns
*this

◆ setLatitude()

Coordinates & gem::Coordinates::setLatitude ( double latitude)
inlinenoexcept

Set latitude in degrees.

Valid values -90.0 .. +90.0.

Parameters
latitudeLatitude in degrees.
Returns
*this

◆ setLongitude()

Coordinates & gem::Coordinates::setLongitude ( double longitude)
inlinenoexcept

Set longitude in degrees.

Valid values -180.0 .. +180.0.

Parameters
longitudeLongitude in degrees.
Returns
*this

◆ setVerticalAccuracy()

Coordinates & gem::Coordinates::setVerticalAccuracy ( double )
inlinenoexcept

Set the vertical accuracy of the location in meters.

Deprecated
horizontal & vertical accuracy were removed from Coordinates
Returns
*this

◆ valid()

bool gem::Coordinates::valid ( ) const
inlinenoexcept

Check if the coordinates are valid.

Returns
True if the coordinates are valid