Point

Since: BlackBerry 10.0.0

#include <bb/platform/geo/Point>

To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmaps

A point in geographic space that is represented by latitude and longitude coordinates in degrees and an altitude coordinate in meters.

Validity

A Point is considered valid when its three main attributes (altitude, latitude and longitude) are set. If a Point is invalid, its attributes are undefined.


Overview

Public Functions Index

Point (double lat=0, double lon=0)
Point (Point const &src)
~Point ()
doublealtitude () const
AltitudeMode::TypealtitudeMode () const
bb::platform::geo::BoundingBoxboundingBox () const
voidinvalidate ()
boolisValid () const
doublelatitude () const
doublelongitude () const
booloperator!= (const Point &rhs) const
Point &operator+= (const Point &rhs)
Point &operator-= (const Point &rhs)
Point &operator= (const Point &src)
booloperator== (const Point &rhs) const
boolset (double lat, double lon)
boolsetAltitude (double alt)
boolsetAltitudeMode (AltitudeMode::Type mode)
boolsetLatitude (double lat)
boolsetLongitude (double lon)

Public Functions

Point (
  • doublelat,
  • doublelon )

Creates a valid point instance.

Unless otherwise provided, a point defaults to 0 degrees latitude, 0 degrees longitude, and 0 meters above ground.

For historical reasons, the empty constructor creates a valid instance of Point.

Parameters
lat

The latitude value (0 default).

lon

The longitude value (0 default).

Since:

BlackBerry 10.0.0

Point (

Copy constructor.

Parameters
src

The object from which to copy information.

Since:

BlackBerry 10.0.0

~Point ()

Destructor.

Since:

BlackBerry 10.0.0

double altitude ()

Gets the altitude of this point in meters.

Since:

BlackBerry 10.0.0

AltitudeMode::Type altitudeMode ()

Captures how the altitude attribute should be interpreted.

Default value is AltitudeMode::RelativeToGround.

Return:

How the altitude property should be interpreted.

Since:

BlackBerry 10.0.0

bb::platform::geo::BoundingBox boundingBox ()

The bounding box of this point.

Return:

The bounding box of this point.

Since:

BlackBerry 10.0.0

void invalidate ()

Invalidates this point.

Since:

BlackBerry 10.2.0

bool isValid ()

Indicates whether this point contains valid information.

Since:

BlackBerry 10.2.0

double latitude ()

Retrieves the point's latitude in degrees.

Since:

BlackBerry 10.0.0

double longitude ()

Gets the point's longitude in degrees.

Since:

BlackBerry 10.0.0

bool operator!= (

Inequality operator.

Return:

true if any property is different.

Since:

BlackBerry 10.0.0

Point & operator+= (

Moves this point by the values given in the parameter.

This takes into consideration latitude, longitude and altitude.

Parameters
rhs

The point values that are added to this point. No changes occur if rhs is invalid. If this Point is invalid while rhs is valid, then this becomes equal to rhs.

Return:

A reference to this point.

Since:

BlackBerry 10.0.0

Point & operator-= (

Moves this point by the values given in the parameter, in a negative direction.

This takes into consideration latitude, longitude and altitude.

Parameters
rhs

The point values that are subtracted from this point. No changes occur if rhs is invalid. If this Point is invalid while rhs is valid, then this because a negative copy of rhs.

Return:

A reference to this point.

Since:

BlackBerry 10.0.0

Point & operator= (

Assignment operator.

Parameters
src

The source object from which to copy information and assign to this object.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

Return:

true if all properties are equal.

Since:

BlackBerry 10.0.0

bool set (
  • doublelat,
  • doublelon )

Sets the point's latitude and longitude in degrees.

This will result in a valid Point.

Return:

true if the operation resulted in a change.

Since:

BlackBerry 10.0.0

bool setAltitude (
  • doublealt)

Sets the altitude of this point in meters.

Return:

true if the operation resulted in a change.

Since:

BlackBerry 10.0.0

bool setAltitudeMode (

Sets the altitude mode.

The altitude measurement can be relative to the ground (default) or the sea level.

Since:

BlackBerry 10.0.0

Return:

true if the attribute changed.

Since:

BlackBerry 10.0.0

bool setLatitude (
  • doublelat)

Sets the point's latitude in degrees.

Return:

true if the operation resulted in a change.

Since:

BlackBerry 10.0.0

bool setLongitude (
  • doublelon)

Sets the point's longitude in degrees.

Return:

true if the operation resulted in a change.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus