![]() |
Mapper
0.9.0
API documentation
|
Stores a set of tracks and / or waypoints, e.g. More...
#include <track.h>
Public Member Functions | |
Track ()=default | |
Constructs an empty track. More... | |
Track (const Georeferencing &map_georef) | |
Track (const Track &other) | |
Duplicates a track. More... | |
~Track () | |
void | clear () |
Deletes all data of the track, except the projection parameters. More... | |
bool | loadFrom (const QString &path, bool project_points) |
Attempts to load the track from the given file. More... | |
bool | loadGpxFrom (QIODevice &device, bool project_points) |
Attempts to load GPX data from the open device. More... | |
bool | saveTo (const QString &path) const |
Attempts to save the track to the given file. More... | |
bool | saveGpxTo (QIODevice &device) const |
Saves the track as GPX data to the open device. More... | |
void | appendTrackPoint (const TrackPoint &point) |
Appends the point and updates the point's map coordinates. More... | |
void | finishCurrentSegment () |
Marks the current track segment as finished, so the next added point will define the start of a new track segment. More... | |
void | appendWaypoint (const TrackPoint &point, const QString &name) |
Appends the waypoint and updates the point's map coordinates. More... | |
void | changeMapGeoreferencing (const Georeferencing &new_map_georef) |
Updates the map positions of all points based on the new georeferencing. More... | |
int | getNumSegments () const |
int | getSegmentPointCount (int segment_number) const |
const TrackPoint & | getSegmentPoint (int segment_number, int point_number) const |
int | getNumWaypoints () const |
const TrackPoint & | getWaypoint (int number) const |
const QString & | getWaypointName (int number) const |
LatLon | calcAveragePosition () const |
Averages all track coordinates. More... | |
Track & | operator= (const Track &rhs) |
Assigns a copy of another Track's data to this object. More... | |
Friends | |
bool | operator== (const Track &lhs, const Track &rhs) |
Compares waypoints, segments, and track points for equality. More... | |
Stores a set of tracks and / or waypoints, e.g.
taken from a GPS device.
All coordinates are assumed to be geographic WGS84 coordinates.
|
default |
Constructs an empty track.
OpenOrienteering::Track::Track | ( | const Georeferencing & | map_georef | ) |
OpenOrienteering::Track::Track | ( | const Track & | other | ) |
Duplicates a track.
|
default |
void OpenOrienteering::Track::appendTrackPoint | ( | const TrackPoint & | point | ) |
Appends the point and updates the point's map coordinates.
The point's map coordinates are determined from its geographic coordinates according to the map's georeferencing.
void OpenOrienteering::Track::appendWaypoint | ( | const TrackPoint & | point, |
const QString & | name | ||
) |
Appends the waypoint and updates the point's map coordinates.
The point's map coordinates are determined from its geographic coordinates according to the map's georeferencing.
LatLon OpenOrienteering::Track::calcAveragePosition | ( | ) | const |
Averages all track coordinates.
void OpenOrienteering::Track::changeMapGeoreferencing | ( | const Georeferencing & | new_map_georef | ) |
Updates the map positions of all points based on the new georeferencing.
void OpenOrienteering::Track::clear | ( | ) |
Deletes all data of the track, except the projection parameters.
void OpenOrienteering::Track::finishCurrentSegment | ( | ) |
Marks the current track segment as finished, so the next added point will define the start of a new track segment.
int OpenOrienteering::Track::getNumSegments | ( | ) | const |
int OpenOrienteering::Track::getNumWaypoints | ( | ) | const |
const TrackPoint & OpenOrienteering::Track::getSegmentPoint | ( | int | segment_number, |
int | point_number | ||
) | const |
int OpenOrienteering::Track::getSegmentPointCount | ( | int | segment_number | ) | const |
const TrackPoint & OpenOrienteering::Track::getWaypoint | ( | int | number | ) | const |
const QString & OpenOrienteering::Track::getWaypointName | ( | int | number | ) | const |
Attempts to load the track from the given file.
If you choose not to project_point, you have to call changeProjectionParams() afterwards.
Attempts to load GPX data from the open device.
Assigns a copy of another Track's data to this object.
Saves the track as GPX data to the open device.
Attempts to save the track to the given file.
Compares waypoints, segments, and track points for equality.
This operator does not (explicitly) compare the tracks' map georeferencing. When this feature is actually used, it affects the projection to map coordinates, and so its effects are recorded in the waypoints and track points.