OpenCPN Partial API docs
Loading...
Searching...
No Matches
TrackPoint Class Reference

Represents a single point in a track. More...

#include <track.h>

Public Member Functions

 TrackPoint (double lat, double lon, wxString ts="")
 
 TrackPoint (double lat, double lon, wxDateTime dt)
 
 TrackPoint (TrackPoint *orig)
 
wxDateTime GetCreateTime (void)
 Retrieves the creation timestamp of a track point as a wxDateTime object.
 
void SetCreateTime (wxDateTime dt)
 Sets the creation timestamp for a track point.
 
const char * GetTimeString ()
 
bool HasValidTimestamp ()
 

Public Attributes

double m_lat
 
double m_lon
 
int m_GPXTrkSegNo
 

Detailed Description

Represents a single point in a track.

Definition at line 56 of file track.h.

Constructor & Destructor Documentation

◆ TrackPoint() [1/3]

TrackPoint::TrackPoint ( double  lat,
double  lon,
wxString  ts = "" 
)

Definition at line 125 of file track.cpp.

◆ TrackPoint() [2/3]

TrackPoint::TrackPoint ( double  lat,
double  lon,
wxDateTime  dt 
)

Definition at line 130 of file track.cpp.

◆ TrackPoint() [3/3]

TrackPoint::TrackPoint ( TrackPoint orig)

Definition at line 136 of file track.cpp.

◆ ~TrackPoint()

TrackPoint::~TrackPoint ( )

Definition at line 141 of file track.cpp.

Member Function Documentation

◆ GetCreateTime()

wxDateTime TrackPoint::GetCreateTime ( void  )

Retrieves the creation timestamp of a track point as a wxDateTime object.

Returns
wxDateTime object representing the creation time in UTC. If the internal timestamp string is invalid or empty, the returned wxDateTime may be invalid.

Definition at line 143 of file track.cpp.

◆ GetTimeString()

const char * TrackPoint::GetTimeString ( )
inline

Definition at line 84 of file track.h.

◆ HasValidTimestamp()

bool TrackPoint::HasValidTimestamp ( )
inline

Definition at line 85 of file track.h.

◆ SetCreateTime()

void TrackPoint::SetCreateTime ( wxDateTime  dt)

Sets the creation timestamp for a track point.

Parameters
dtThe wxDateTime object containing the timestamp to set. Should be in UTC time already, as no time zone conversion is performed. The time is directly formatted and marked with 'Z' (UTC indicator). If the provided datetime is invalid, an empty string will be stored.

Format: YYYY-MM-DDThh:mm:ssZ Example: 2023-04-15T14:22:38Z

Definition at line 149 of file track.cpp.

Member Data Documentation

◆ m_GPXTrkSegNo

int TrackPoint::m_GPXTrkSegNo

Definition at line 91 of file track.h.

◆ m_lat

double TrackPoint::m_lat

Definition at line 90 of file track.h.

◆ m_lon

double TrackPoint::m_lon

Definition at line 90 of file track.h.


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