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 "UTC"
46#define RTE_TIME_DISP_PC "PC"
47#define RTE_TIME_DISP_LOCAL "LOCAL"
48#define RTE_TIME_DISP_GLOBAL "GLOBAL SETTING"
49#define RTE_UNDEF_DEPARTURE wxInvalidDateTime
55const wxString GpxxColorNames[] = {
56 _T(
"Black"), _T(
"DarkRed"), _T(
"DarkGreen"),
57 _T(
"DarkYellow"), _T(
"DarkBlue"), _T(
"DarkMagenta"),
58 _T(
"DarkCyan"), _T(
"LightGray"), _T(
"DarkGray"),
59 _T(
"Red"), _T(
"Green"), _T (
"Yellow"),
60 _T(
"Blue"), _T(
"Magenta"), _T(
"Cyan"),
63const wxColour GpxxColors[] = {
64 wxColour(0x00, 0x00, 0x00), wxColour(0x60, 0x00, 0x00),
65 wxColour(0x00, 0x60, 0x00), wxColour(0x80, 0x80, 0x00),
66 wxColour(0x00, 0x00, 0x60), wxColour(0x60, 0x00, 0x60),
67 wxColour(0x00, 0x80, 0x80), wxColour(0xC0, 0xC0, 0xC0),
68 wxColour(0x60, 0x60, 0x60), wxColour(0xFF, 0x00, 0x00),
69 wxColour(0x00, 0xFF, 0x00), wxColour(0xF0, 0xF0, 0x00),
70 wxColour(0x00, 0x00, 0xFF), wxColour(0xFE, 0x00, 0xFE),
71 wxColour(0x00, 0xFF, 0xFF), wxColour(0xFF, 0xFF, 0xFF)};
72const int StyleValues[] = {-1, wxSOLID, wxDOT,
73 wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH};
74const int WidthValues[] = {-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
103 virtual int GetnPoints(
void) {
return pRoutePointList->GetCount(); }
104 wxString IsPointNameValid(
RoutePoint *pRP,
const wxString &name)
const;
106 void AddPoint(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
107 bool b_deferBoxCalc =
false);
108 void InsertPointAndSegment(
RoutePoint *pNewPoint,
int insert_after,
109 bool b_rename_in_sequence =
true,
110 bool b_deferBoxCalc =
false);
111 void AddPointAndSegment(
RoutePoint *pNewPoint,
112 bool b_rename_in_sequence =
true,
113 bool b_deferBoxCalc =
false);
118 bool bRenamePoints =
false);
120 bool bRenamePoints =
false);
123 void DeletePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
124 void RemovePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
125 void DeSelectRoute();
126 void FinalizeForRendering();
147 double planspeed = -1.0);
148 void UpdateSegmentDistances(
double planspeed = -1.0);
150 void SetHiLite(
int width) { m_hiliteWidth = width; }
151 void Reverse(
bool bRenamePoints =
false);
152 void RebuildGUIDList(
void);
153 void RenameRoutePoints();
154 void ReloadRoutePointIcons();
155 wxString GetNewMarkSequenced(
void);
156 void AssembleRoute();
157 bool IsEqualTo(
Route *ptargetroute);
158 void CloneRoute(
Route *psourceroute,
int start_nPoint,
int end_nPoint,
159 const wxString &suffix,
160 const bool duplicate_first_point =
false);
161 void ClearHighlights(
void);
163 void SetVisible(
bool visible =
true,
bool includeWpts =
true);
164 void SetListed(
bool visible =
true);
165 bool IsVisible() {
return m_bVisible; }
166 bool IsListed() {
return m_bListed; }
167 bool IsActive() {
return m_bRtIsActive; }
168 bool IsSelected() {
return m_bRtIsSelected; }
170 bool ContainsSharedWP();
171 void SetSharedWPViz(
bool sharedWPVIZ) { m_bsharedWPViz = sharedWPVIZ; }
172 bool GetSharedWPViz() {
return m_bsharedWPViz; }
174 double GetRouteArrivalRadius(
void) {
return m_ArrivalRadius; }
175 void SetRouteArrivalRadius(
double radius) { m_ArrivalRadius = radius; }
185 wxString GetName()
const {
return m_RouteNameString; }
186 wxString GetTo()
const {
return m_RouteEndString; }
187 wxString GetGUID()
const {
return m_GUID; }
188 void ShowWaypointNames(
bool bshow);
189 bool AreWaypointNamesVisible();
191 int m_ConfigRouteNum;
192 bool m_bRtIsSelected;
195 bool m_bIsBeingCreated;
196 bool m_bIsBeingEdited;
197 double m_route_length;
199 wxString m_RouteNameString;
200 wxString m_RouteStartString;
201 wxString m_RouteEndString;
202 wxString m_RouteDescription;
203 bool m_bDeleteOnArrival;
209 int m_lastMousePointIndex;
210 bool m_NextLegGreatCircle;
211 double m_PlannedSpeed;
214 wxString m_TimeDisplayFormat;
216 RoutePointList *pRoutePointList;
218 wxRect active_pt_rect;
222 HyperlinkList *m_HyperlinkList;
230 double m_ArrivalRadius;
234WX_DECLARE_LIST(
Route, RouteList);
Represents a waypoint or mark within the navigation system.
Represents a navigational route in the navigation system.
void UpdateSegmentDistance(RoutePoint *prp0, RoutePoint *prp, double planspeed=-1.0)
Updates the navigation data for a single route segment between two waypoints.
wxDateTime m_PlannedDeparture
The departure time of the route, in UTC.
void SetDepartureDate(const wxDateTime &dt)
Set the departure time of the route.