29#include <wx/progdlg.h>
52 TrackPoint(
double lat,
double lon, wxString ts =
"");
53 TrackPoint(
double lat,
double lon, wxDateTime dt);
57 wxDateTime GetCreateTime(
void);
58 void SetCreateTime(wxDateTime dt);
59 const char *GetTimeString() {
return m_stimestring.c_str(); }
60 bool HasValidTimestamp() {
61 if (m_stimestring.size() != strlen(
"YYYY-MM-DDTHH:MM:SSZ"))
71 void SetCreateTime(wxString ts);
72 std::string m_stimestring;
86 int GetnPoints(
void) {
return TrackPoints.size(); }
88 void SetVisible(
bool visible =
true) { m_bVisible = visible; }
93 TrackPoint *AddNewPoint(vector2D point, wxDateTime time);
95 void SetListed(
bool listed =
true) { m_bListed = listed; }
96 virtual bool IsRunning() {
return false; }
98 bool IsVisible() {
return m_bVisible; }
99 bool IsListed() {
return m_bListed; }
101 int GetCurrentTrackSeg() {
return m_CurrentTrackSeg; }
102 void SetCurrentTrackSeg(
int seg) { m_CurrentTrackSeg = seg; }
105 int Simplify(
double maxDelta);
106 Route *RouteFromTrack(wxGenericProgressDialog *pprog);
108 void ClearHighlights();
110 wxString GetName(
bool auto_if_empty =
false)
const {
111 if (!auto_if_empty || !m_TrackNameString.IsEmpty()) {
112 return m_TrackNameString;
116 if ((
int)TrackPoints.size() > 0) rp = TrackPoints[0];
117 if (rp && rp->GetCreateTime().IsValid())
118 name = rp->GetCreateTime().FormatISODate() + _T(
" ") +
122 name = _(
"(Unnamed Track)");
126 void SetName(
const wxString name) { m_TrackNameString = name; }
132 wxString m_TrackDescription;
134 wxString m_TrackStartString;
135 wxString m_TrackEndString;
145 int m_CurrentTrackSeg;
147 HyperlinkList *m_HyperlinkList;
148 int m_HighlightedTrackPoint;
150 void Clone(
Track *psourcetrack,
int start_nPoint,
int end_nPoint,
151 const wxString &suffix);
156 void DouglasPeuckerReducer(std::vector<TrackPoint *> &list,
157 std::vector<bool> &keeplist,
int from,
int to,
160 double GetXTE(
double fm1Lat,
double fm1Lon,
double fm2Lat,
double fm2Lon,
161 double toLat,
double toLon);
163 std::vector<TrackPoint *> TrackPoints;
164 std::vector<std::vector<SubTrack> > SubTracks;
171 double ComputeScale(
int left,
int right);
172 void InsertSubTracks(LLBBox &box,
int level,
int pos);
183 wxString m_TrackNameString;
192 void SetPrecision(
int precision);
195 void Stop(
bool do_add_point =
false);
196 Track *DoExtendDaily();
197 bool IsRunning() {
return m_bRunning; }
199 void AdjustCurrentTrackPoint(
TrackPoint *prototype);
202 void OnTimerTrack(wxTimerEvent &event);
203 void AddPointNow(
bool do_add_point =
false);
206 wxTimer m_TimerTrack;
209 double m_TrackTimerSec;
210 double m_allowedMaxXTE;
211 double m_allowedMaxAngle;
213 vector2D m_lastAddedPoint;
215 wxDateTime m_prev_time;
222 double m_minTrackpoint_delta;
224 enum eTrackPointState {
230 std::deque<vector2D> skipPoints;
231 std::deque<wxDateTime> skipTimes;
233 DECLARE_EVENT_TABLE()