28#include <wx/datetime.h>
35#include "route_point.h"
36#include "wx28compat.h"
39#define WIDTH_UNDEFINED -1
41#define ROUTE_DEFAULT_SPEED 5.0
42#define RTE_TIME_DISP_UTC _T("UTC")
43#define RTE_TIME_DISP_PC _T("PC")
44#define RTE_TIME_DISP_LOCAL _T("LOCAL")
45#define RTE_UNDEF_DEPARTURE wxInvalidDateTime
47const wxString GpxxColorNames[] = {
48 _T(
"Black"), _T(
"DarkRed"), _T(
"DarkGreen"),
49 _T(
"DarkYellow"), _T(
"DarkBlue"), _T(
"DarkMagenta"),
50 _T(
"DarkCyan"), _T(
"LightGray"), _T(
"DarkGray"),
51 _T(
"Red"), _T(
"Green"), _T (
"Yellow"),
52 _T(
"Blue"), _T(
"Magenta"), _T(
"Cyan"),
55const wxColour GpxxColors[] = {
56 wxColour(0x00, 0x00, 0x00), wxColour(0x60, 0x00, 0x00),
57 wxColour(0x00, 0x60, 0x00), wxColour(0x80, 0x80, 0x00),
58 wxColour(0x00, 0x00, 0x60), wxColour(0x60, 0x00, 0x60),
59 wxColour(0x00, 0x80, 0x80), wxColour(0xC0, 0xC0, 0xC0),
60 wxColour(0x60, 0x60, 0x60), wxColour(0xFF, 0x00, 0x00),
61 wxColour(0x00, 0xFF, 0x00), wxColour(0xF0, 0xF0, 0x00),
62 wxColour(0x00, 0x00, 0xFF), wxColour(0xFE, 0x00, 0xFE),
63 wxColour(0x00, 0xFF, 0xFF), wxColour(0xFF, 0xFF, 0xFF)};
64const int StyleValues[] = {-1, wxSOLID, wxDOT,
65 wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH};
66const int WidthValues[] = {-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
77 virtual int GetnPoints(
void) {
return pRoutePointList->GetCount(); }
79 void AddPoint(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
80 bool b_deferBoxCalc =
false);
81 void InsertPointAndSegment(
RoutePoint *pNewPoint,
int insert_after,
82 bool b_rename_in_sequence =
true,
83 bool b_deferBoxCalc =
false);
84 void AddPointAndSegment(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
85 bool b_deferBoxCalc =
false);
90 bool bRenamePoints =
false);
92 bool bRenamePoints =
false);
104 void DeletePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
105 void RemovePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
106 void DeSelectRoute();
107 void FinalizeForRendering();
109 double planspeed = -1.0);
110 void UpdateSegmentDistances(
double planspeed = -1.0);
112 void SetHiLite(
int width) { m_hiliteWidth = width; }
113 void Reverse(
bool bRenamePoints =
false);
114 void RebuildGUIDList(
void);
115 void RenameRoutePoints();
116 void ReloadRoutePointIcons();
117 wxString GetNewMarkSequenced(
void);
118 void AssembleRoute();
119 bool IsEqualTo(
Route *ptargetroute);
120 void CloneRoute(
Route *psourceroute,
int start_nPoint,
int end_nPoint,
121 const wxString &suffix,
122 const bool duplicate_first_point =
false);
123 void ClearHighlights(
void);
125 void SetVisible(
bool visible =
true,
bool includeWpts =
true);
126 void SetListed(
bool visible =
true);
127 bool IsVisible() {
return m_bVisible; }
128 bool IsListed() {
return m_bListed; }
129 bool IsActive() {
return m_bRtIsActive; }
130 bool IsSelected() {
return m_bRtIsSelected; }
132 bool ContainsSharedWP();
133 void SetSharedWPViz(
bool sharedWPVIZ) { m_bsharedWPViz = sharedWPVIZ; }
134 bool GetSharedWPViz() {
return m_bsharedWPViz; }
136 double GetRouteArrivalRadius(
void) {
return m_ArrivalRadius; }
137 void SetRouteArrivalRadius(
double radius) { m_ArrivalRadius = radius; }
138 void SetDepartureDate(
const wxDateTime &dt) {
139 if (dt.IsValid()) m_PlannedDeparture = dt;
142 wxString GetName()
const {
return m_RouteNameString; }
143 wxString GetTo()
const {
return m_RouteEndString; }
144 wxString GetGUID()
const {
return m_GUID; }
145 void ShowWaypointNames(
bool bshow);
146 bool AreWaypointNamesVisible();
148 int m_ConfigRouteNum;
149 bool m_bRtIsSelected;
152 bool m_bIsBeingCreated;
153 bool m_bIsBeingEdited;
154 double m_route_length;
156 wxString m_RouteNameString;
157 wxString m_RouteStartString;
158 wxString m_RouteEndString;
159 wxString m_RouteDescription;
160 bool m_bDeleteOnArrival;
166 int m_lastMousePointIndex;
167 bool m_NextLegGreatCircle;
168 double m_PlannedSpeed;
169 wxDateTime m_PlannedDeparture;
170 wxString m_TimeDisplayFormat;
172 RoutePointList *pRoutePointList;
174 wxRect active_pt_rect;
178 HyperlinkList *m_HyperlinkList;
186 double m_ArrivalRadius;
190WX_DECLARE_LIST(
Route, RouteList);