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

Path object. More...

Inheritance diagram for gem::Path:
Collaboration diagram for gem::Path:

Public Member Functions

 Path (const CoordinatesList &coords)
 Create a path from list of coordinates.
 Path (const CoordinatesList &coords, const IntList &waypoints)
 Create a path from list of coordinates and waypoints.
 Path (const DataBuffer &data, int format, ProgressListener listener=ProgressListener())
 Create a path from a data buffer of a given format.
 Path (const Path &)=default
 Default copy constructor.
 Path (Path &&)=default
 Default move constructor noexcept is deduced.
Path & operator= (const Path &path)=default
 Default copy assignment.
Path & operator= (Path &&path)=default
 Default move assignment noexcept is deduced.
bool operator== (Path const &path) const
 Compare if the paths are identical.
const CoordinatesListRef getCoordinates () const noexcept
 Get read-only access to the internal coordinates list.
const IntListRef getWayPoints () const noexcept
 Get read-only access to the internal waypoint list.
RectangleGeographicArea getArea () const noexcept
 Get path rectangle.
int getLength () const noexcept
 Get path length.
const StringRef getName () const noexcept
 Get path name.
Path & setName (const String &name) noexcept
 Set path name.
Path cloneStartEnd (const Coordinates &start, const Coordinates &end) const noexcept
 Clone path from the given coordinates.
Path cloneReverse () const noexcept
 Clone reverse order path.
DataBuffer exportAs (int format) const noexcept
 Export path coordinates in the requested data format.

Static Public Member Functions

static Coordinates getCoordinatesAtPercent (const CoordinatesList &coords, double percent) noexcept
 Get a coordinate along the path given by a fraction of the path length between 0.0 (departure point) and 1.0 (destination).

Detailed Description

Path object.

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

Constructor & Destructor Documentation

◆ Path() [1/3]

gem::Path::Path ( const CoordinatesList & coords)
inline

Create a path from list of coordinates.

Parameters
[in]coordsList of coordinates

◆ Path() [2/3]

gem::Path::Path ( const CoordinatesList & coords,
const IntList & waypoints )
inline

Create a path from list of coordinates and waypoints.

Parameters
[in]coordsList of coordinates
[in]waypointsList of waypoints

◆ Path() [3/3]

gem::Path::Path ( const DataBuffer & data,
int format,
ProgressListener listener = ProgressListener() )
inline

Create a path from a data buffer of a given format.

Parameters
[in]dataData buffer
[in]formatData format ( see EPathFileFormat )
[in]listenerProgress listener

If listener is empty, the path data is loaded from the data buffer before return. If the operation fails, the path is an empty object and GEM_GET_API_ERROR will return the error code

If listener is not empty, the path data is populated asynchronously from the data buffer.

Member Function Documentation

◆ cloneReverse()

Path gem::Path::cloneReverse ( ) const
inlinenoexcept

Clone reverse order path.

Returns
The cloned path

◆ cloneStartEnd()

Path gem::Path::cloneStartEnd ( const Coordinates & start,
const Coordinates & end ) const
inlinenoexcept

Clone path from the given coordinates.

Set start = end to create a circuit track

Parameters
[in]startThe start coordinates
[in]endThe end coordinates
Returns
The cloned path

◆ exportAs()

DataBuffer gem::Path::exportAs ( int format) const
inlinenoexcept

Export path coordinates in the requested data format.

Parameters
[in]formatData format, see EPathFileFormat
Returns
The data buffer with the path coordinates

◆ getArea()

RectangleGeographicArea gem::Path::getArea ( ) const
inlinenoexcept

Get path rectangle.

Returns
The path rectangle

◆ getCoordinates()

const CoordinatesListRef gem::Path::getCoordinates ( ) const
inlinenoexcept

Get read-only access to the internal coordinates list.

Returns
The coordinates list

◆ getCoordinatesAtPercent()

Coordinates gem::Path::getCoordinatesAtPercent ( const CoordinatesList & coords,
double percent )
inlinestaticnoexcept

Get a coordinate along the path given by a fraction of the path length between 0.0 (departure point) and 1.0 (destination).

Parameters
[in]coordsThe path coordinates list
[in]percentThe size percent (fraction) in the range [0, 1], e.g. 0.5 will return the coordinates of the point in the middle of the path
Returns
The coordinates at the given percent

◆ getLength()

int gem::Path::getLength ( ) const
inlinenoexcept

Get path length.

Returns
The path length in meters

◆ getName()

const StringRef gem::Path::getName ( ) const
inlinenoexcept

Get path name.

Returns
The path name

◆ getWayPoints()

const IntListRef gem::Path::getWayPoints ( ) const
inlinenoexcept

Get read-only access to the internal waypoint list.

Returns
The waypoint list

◆ operator=() [1/2]

Path & gem::Path::operator= ( const Path & path)
default

Default copy assignment.

Parameters
pathThe path to copy
Returns
A reference to this object

◆ operator=() [2/2]

Path & gem::Path::operator= ( Path && path)
default

Default move assignment noexcept is deduced.

Parameters
pathThe path to move
Returns
A reference to this object

◆ operator==()

bool gem::Path::operator== ( Path const & path) const
inline

Compare if the paths are identical.

Parameters
[in]pathThe path to compare
Returns
True if the paths are identical

◆ setName()

Path & gem::Path::setName ( const String & name)
inlinenoexcept

Set path name.

Parameters
[in]nameThe path name
Returns
A reference to this object