30#include <wx/datetime.h>
36#include "model/route_point.h"
37#include "model/routeman.h"
38#include "model/hyperlink.h"
42#define WIDTH_UNDEFINED -1
44#define ROUTE_DEFAULT_SPEED 5.0
45#define RTE_TIME_DISP_UTC _T("UTC")
46#define RTE_TIME_DISP_PC _T("PC")
47#define RTE_TIME_DISP_LOCAL _T("LOCAL")
48#define RTE_UNDEF_DEPARTURE wxInvalidDateTime
54const wxString GpxxColorNames[] = {
55 _T(
"Black"), _T(
"DarkRed"), _T(
"DarkGreen"),
56 _T(
"DarkYellow"), _T(
"DarkBlue"), _T(
"DarkMagenta"),
57 _T(
"DarkCyan"), _T(
"LightGray"), _T(
"DarkGray"),
58 _T(
"Red"), _T(
"Green"), _T (
"Yellow"),
59 _T(
"Blue"), _T(
"Magenta"), _T(
"Cyan"),
62const wxColour GpxxColors[] = {
63 wxColour(0x00, 0x00, 0x00), wxColour(0x60, 0x00, 0x00),
64 wxColour(0x00, 0x60, 0x00), wxColour(0x80, 0x80, 0x00),
65 wxColour(0x00, 0x00, 0x60), wxColour(0x60, 0x00, 0x60),
66 wxColour(0x00, 0x80, 0x80), wxColour(0xC0, 0xC0, 0xC0),
67 wxColour(0x60, 0x60, 0x60), wxColour(0xFF, 0x00, 0x00),
68 wxColour(0x00, 0xFF, 0x00), wxColour(0xF0, 0xF0, 0x00),
69 wxColour(0x00, 0x00, 0xFF), wxColour(0xFE, 0x00, 0xFE),
70 wxColour(0x00, 0xFF, 0xFF), wxColour(0xFF, 0xFF, 0xFF)};
71const int StyleValues[] = {-1, wxSOLID, wxDOT,
72 wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH};
73const int WidthValues[] = {-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
82 virtual int GetnPoints(
void) {
return pRoutePointList->GetCount(); }
83 wxString IsPointNameValid(
RoutePoint *pRP,
const wxString &name)
const;
85 void AddPoint(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
86 bool b_deferBoxCalc =
false);
87 void InsertPointAndSegment(
RoutePoint *pNewPoint,
int insert_after,
88 bool b_rename_in_sequence =
true,
89 bool b_deferBoxCalc =
false);
91 bool b_rename_in_sequence =
true,
92 bool b_deferBoxCalc =
false);
97 bool bRenamePoints =
false);
99 bool bRenamePoints =
false);
102 void DeletePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
103 void RemovePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
104 void DeSelectRoute();
105 void FinalizeForRendering();
107 double planspeed = -1.0);
108 void UpdateSegmentDistances(
double planspeed = -1.0);
110 void SetHiLite(
int width) { m_hiliteWidth = width; }
111 void Reverse(
bool bRenamePoints =
false);
112 void RebuildGUIDList(
void);
113 void RenameRoutePoints();
114 void ReloadRoutePointIcons();
115 wxString GetNewMarkSequenced(
void);
116 void AssembleRoute();
117 bool IsEqualTo(
Route *ptargetroute);
118 void CloneRoute(
Route *psourceroute,
int start_nPoint,
int end_nPoint,
119 const wxString &suffix,
120 const bool duplicate_first_point =
false);
121 void ClearHighlights(
void);
123 void SetVisible(
bool visible =
true,
bool includeWpts =
true);
124 void SetListed(
bool visible =
true);
125 bool IsVisible() {
return m_bVisible; }
126 bool IsListed() {
return m_bListed; }
127 bool IsActive() {
return m_bRtIsActive; }
128 bool IsSelected() {
return m_bRtIsSelected; }
130 bool ContainsSharedWP();
131 void SetSharedWPViz(
bool sharedWPVIZ) { m_bsharedWPViz = sharedWPVIZ; }
132 bool GetSharedWPViz() {
return m_bsharedWPViz; }
134 double GetRouteArrivalRadius(
void) {
return m_ArrivalRadius; }
135 void SetRouteArrivalRadius(
double radius) { m_ArrivalRadius = radius; }
136 void SetDepartureDate(
const wxDateTime &dt) {
137 if (dt.IsValid()) m_PlannedDeparture = dt;
140 wxString GetName()
const {
return m_RouteNameString; }
141 wxString GetTo()
const {
return m_RouteEndString; }
142 wxString GetGUID()
const {
return m_GUID; }
143 void ShowWaypointNames(
bool bshow);
144 bool AreWaypointNamesVisible();
146 int m_ConfigRouteNum;
147 bool m_bRtIsSelected;
150 bool m_bIsBeingCreated;
151 bool m_bIsBeingEdited;
152 double m_route_length;
154 wxString m_RouteNameString;
155 wxString m_RouteStartString;
156 wxString m_RouteEndString;
157 wxString m_RouteDescription;
158 bool m_bDeleteOnArrival;
164 int m_lastMousePointIndex;
165 bool m_NextLegGreatCircle;
166 double m_PlannedSpeed;
167 wxDateTime m_PlannedDeparture;
168 wxString m_TimeDisplayFormat;
170 RoutePointList *pRoutePointList;
172 wxRect active_pt_rect;
176 HyperlinkList *m_HyperlinkList;
184 double m_ArrivalRadius;
188WX_DECLARE_LIST(
Route, RouteList);