29 #include <wx/colour.h>
30 #include <wx/datetime.h>
31 #include <wx/gdicmn.h>
32 #include <wx/object.h>
34 #include <wx/string.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
54 const 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"),
62 const 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)};
71 const int StyleValues[] = {-1, wxSOLID, wxDOT,
72 wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH};
73 const int WidthValues[] = {-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
82 virtual int GetnPoints(
void) {
return pRoutePointList->GetCount(); }
84 void AddPoint(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
85 bool b_deferBoxCalc =
false);
86 void InsertPointAndSegment(
RoutePoint *pNewPoint,
int insert_after,
87 bool b_rename_in_sequence =
true,
88 bool b_deferBoxCalc =
false);
89 void AddPointAndSegment(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
90 bool b_deferBoxCalc =
false);
95 bool bRenamePoints =
false);
97 bool bRenamePoints =
false);
100 void DeletePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
101 void RemovePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
102 void DeSelectRoute();
103 void FinalizeForRendering();
105 double planspeed = -1.0);
106 void UpdateSegmentDistances(
double planspeed = -1.0);
108 void SetHiLite(
int width) { m_hiliteWidth = width; }
109 void Reverse(
bool bRenamePoints =
false);
110 void RebuildGUIDList(
void);
111 void RenameRoutePoints();
112 void ReloadRoutePointIcons();
113 wxString GetNewMarkSequenced(
void);
114 void AssembleRoute();
115 bool IsEqualTo(
Route *ptargetroute);
116 void CloneRoute(
Route *psourceroute,
int start_nPoint,
int end_nPoint,
117 const wxString &suffix,
118 const bool duplicate_first_point =
false);
119 void ClearHighlights(
void);
121 void SetVisible(
bool visible =
true,
bool includeWpts =
true);
122 void SetListed(
bool visible =
true);
123 bool IsVisible() {
return m_bVisible; }
124 bool IsListed() {
return m_bListed; }
125 bool IsActive() {
return m_bRtIsActive; }
126 bool IsSelected() {
return m_bRtIsSelected; }
128 bool ContainsSharedWP();
129 void SetSharedWPViz(
bool sharedWPVIZ) { m_bsharedWPViz = sharedWPVIZ; }
130 bool GetSharedWPViz() {
return m_bsharedWPViz; }
132 double GetRouteArrivalRadius(
void) {
return m_ArrivalRadius; }
133 void SetRouteArrivalRadius(
double radius) { m_ArrivalRadius = radius; }
134 void SetDepartureDate(
const wxDateTime &dt) {
135 if (dt.IsValid()) m_PlannedDeparture = dt;
138 wxString GetName()
const {
return m_RouteNameString; }
139 wxString GetTo()
const {
return m_RouteEndString; }
140 wxString GetGUID()
const {
return m_GUID; }
141 void ShowWaypointNames(
bool bshow);
142 bool AreWaypointNamesVisible();
144 int m_ConfigRouteNum;
145 bool m_bRtIsSelected;
148 bool m_bIsBeingCreated;
149 bool m_bIsBeingEdited;
150 double m_route_length;
152 wxString m_RouteNameString;
153 wxString m_RouteStartString;
154 wxString m_RouteEndString;
155 wxString m_RouteDescription;
156 bool m_bDeleteOnArrival;
162 int m_lastMousePointIndex;
163 bool m_NextLegGreatCircle;
164 double m_PlannedSpeed;
165 wxDateTime m_PlannedDeparture;
166 wxString m_TimeDisplayFormat;
168 RoutePointList *pRoutePointList;
170 wxRect active_pt_rect;
174 HyperlinkList *m_HyperlinkList;
182 double m_ArrivalRadius;
186 WX_DECLARE_LIST(
Route, RouteList);