Mapper  0.9.0
API documentation
Public Member Functions | Friends | List of all members
OpenOrienteering::Track Class Reference

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 TrackPointgetSegmentPoint (int segment_number, int point_number) const
 
int getNumWaypoints () const
 
const TrackPointgetWaypoint (int number) const
 
const QStringgetWaypointName (int number) const
 
LatLon calcAveragePosition () const
 Averages all track coordinates. More...
 
Trackoperator= (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...
 

Detailed Description

Stores a set of tracks and / or waypoints, e.g.

taken from a GPS device.

All coordinates are assumed to be geographic WGS84 coordinates.

Constructor & Destructor Documentation

◆ Track() [1/3]

OpenOrienteering::Track::Track ( )
default

Constructs an empty track.

◆ Track() [2/3]

OpenOrienteering::Track::Track ( const Georeferencing map_georef)

◆ Track() [3/3]

OpenOrienteering::Track::Track ( const Track other)

Duplicates a track.

◆ ~Track()

OpenOrienteering::Track::~Track ( )
default

Member Function Documentation

◆ appendTrackPoint()

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.

◆ appendWaypoint()

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.

◆ calcAveragePosition()

LatLon OpenOrienteering::Track::calcAveragePosition ( ) const

Averages all track coordinates.

◆ changeMapGeoreferencing()

void OpenOrienteering::Track::changeMapGeoreferencing ( const Georeferencing new_map_georef)

Updates the map positions of all points based on the new georeferencing.

◆ clear()

void OpenOrienteering::Track::clear ( )

Deletes all data of the track, except the projection parameters.

◆ finishCurrentSegment()

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.

◆ getNumSegments()

int OpenOrienteering::Track::getNumSegments ( ) const

◆ getNumWaypoints()

int OpenOrienteering::Track::getNumWaypoints ( ) const

◆ getSegmentPoint()

const TrackPoint & OpenOrienteering::Track::getSegmentPoint ( int  segment_number,
int  point_number 
) const

◆ getSegmentPointCount()

int OpenOrienteering::Track::getSegmentPointCount ( int  segment_number) const

◆ getWaypoint()

const TrackPoint & OpenOrienteering::Track::getWaypoint ( int  number) const

◆ getWaypointName()

const QString & OpenOrienteering::Track::getWaypointName ( int  number) const

◆ loadFrom()

bool OpenOrienteering::Track::loadFrom ( const QString path,
bool  project_points 
)

Attempts to load the track from the given file.

If you choose not to project_point, you have to call changeProjectionParams() afterwards.

◆ loadGpxFrom()

bool OpenOrienteering::Track::loadGpxFrom ( QIODevice device,
bool  project_points 
)

Attempts to load GPX data from the open device.

◆ operator=()

Track & OpenOrienteering::Track::operator= ( const Track rhs)

Assigns a copy of another Track's data to this object.

◆ saveGpxTo()

bool OpenOrienteering::Track::saveGpxTo ( QIODevice device) const

Saves the track as GPX data to the open device.

◆ saveTo()

bool OpenOrienteering::Track::saveTo ( const QString path) const

Attempts to save the track to the given file.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const Track lhs,
const Track rhs 
)
friend

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.


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