31#include <wx/datetime.h>
43#define WIDTH_UNDEFINED -1
45#define ROUTE_DEFAULT_SPEED 5.0
46#define RTE_TIME_DISP_UTC "UTC"
47#define RTE_TIME_DISP_PC "PC"
48#define RTE_TIME_DISP_LOCAL "LOCAL"
49#define RTE_TIME_DISP_GLOBAL "GLOBAL SETTING"
50#define RTE_UNDEF_DEPARTURE wxInvalidDateTime
56const wxString GpxxColorNames[] = {
57 _T(
"Black"), _T(
"DarkRed"), _T(
"DarkGreen"),
58 _T(
"DarkYellow"), _T(
"DarkBlue"), _T(
"DarkMagenta"),
59 _T(
"DarkCyan"), _T(
"LightGray"), _T(
"DarkGray"),
60 _T(
"Red"), _T(
"Green"), _T (
"Yellow"),
61 _T(
"Blue"), _T(
"Magenta"), _T(
"Cyan"),
64const wxColour GpxxColors[] = {
65 wxColour(0x00, 0x00, 0x00), wxColour(0x60, 0x00, 0x00),
66 wxColour(0x00, 0x60, 0x00), wxColour(0x80, 0x80, 0x00),
67 wxColour(0x00, 0x00, 0x60), wxColour(0x60, 0x00, 0x60),
68 wxColour(0x00, 0x80, 0x80), wxColour(0xC0, 0xC0, 0xC0),
69 wxColour(0x60, 0x60, 0x60), wxColour(0xFF, 0x00, 0x00),
70 wxColour(0x00, 0xFF, 0x00), wxColour(0xF0, 0xF0, 0x00),
71 wxColour(0x00, 0x00, 0xFF), wxColour(0xFE, 0x00, 0xFE),
72 wxColour(0x00, 0xFF, 0xFF), wxColour(0xFF, 0xFF, 0xFF)};
73const int StyleValues[] = {-1, wxSOLID, wxDOT,
74 wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH};
75const int WidthValues[] = {-1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
107 wxString IsPointNameValid(
RoutePoint *pRP,
const wxString &name)
const;
109 void AddPoint(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
110 bool b_deferBoxCalc =
false);
111 void InsertPointAndSegment(
RoutePoint *pNewPoint,
int insert_after,
112 bool b_rename_in_sequence =
true,
113 bool b_deferBoxCalc =
false);
114 void AddPointAndSegment(
RoutePoint *pNewPoint,
115 bool b_rename_in_sequence =
true,
116 bool b_deferBoxCalc =
false);
121 bool bRenamePoints =
false);
123 bool bRenamePoints =
false);
126 void DeletePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
127 void RemovePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
128 void DeSelectRoute();
129 void FinalizeForRendering();
150 double planspeed = -1.0);
151 void UpdateSegmentDistances(
double planspeed = -1.0);
154 void Reverse(
bool bRenamePoints =
false);
155 void RebuildGUIDList(
void);
156 void RenameRoutePoints();
157 void ReloadRoutePointIcons();
158 wxString GetNewMarkSequenced(
void);
159 void AssembleRoute();
160 bool IsEqualTo(
Route *ptargetroute);
161 void CloneRoute(
Route *psourceroute,
int start_nPoint,
int end_nPoint,
162 const wxString &suffix,
163 const bool duplicate_first_point =
false);
164 void ClearHighlights(
void);
166 void SetVisible(
bool visible =
true,
bool includeWpts =
true);
167 void SetListed(
bool visible =
true);
168 bool IsVisible() {
return m_bVisible; }
169 bool IsListed() {
return m_bListed; }
173 bool ContainsSharedWP();
174 void SetSharedWPViz(
bool sharedWPVIZ) { m_bsharedWPViz = sharedWPVIZ; }
175 bool GetSharedWPViz() {
return m_bsharedWPViz; }
177 double GetRouteArrivalRadius(
void) {
return m_ArrivalRadius; }
178 void SetRouteArrivalRadius(
double radius) { m_ArrivalRadius = radius; }
190 wxString GetGUID()
const {
return m_GUID; }
191 void ShowWaypointNames(
bool bshow);
192 bool AreWaypointNamesVisible();
385 double m_ArrivalRadius;
393using RouteList = std::vector<Route *>;
Represents a waypoint or mark within the navigation system.
Represents a navigational route in the navigation system.
int m_hiliteWidth
Width in pixels for highlighting the route when selected.
bool m_bRtIsSelected
Flag indicating whether this route is currently selected in the UI.
double m_PlannedSpeed
Default planned speed for the route in knots.
wxString m_RouteStartString
Name or description of the route's starting point.
int m_ConfigRouteNum
Internal configuration/identification number for this route.
wxString m_RouteDescription
Additional descriptive information about the route.
bool m_bIsBeingCreated
Flag indicating that the route is currently being created by the user.
void UpdateSegmentDistance(RoutePoint *prp0, RoutePoint *prp, double planspeed=-1.0)
Updates the navigation data for a single route segment between two waypoints.
RoutePointList * pRoutePointList
Ordered list of waypoints (RoutePoints) that make up this route.
double m_route_length
Total length of the route in nautical miles, calculated using rhumb line (Mercator) distances.
bool m_bRtIsActive
Flag indicating whether this route is currently active for navigation.
wxString m_Colour
Color name for rendering the route on the chart.
bool m_bDeleteOnArrival
Flag indicating whether the route should be deleted once navigation reaches the end.
wxString m_RouteEndString
Name or description of the route's ending point.
RoutePoint * m_pRouteActivePoint
Pointer to the currently active waypoint within this route.
bool m_btemp
Flag indicating if this is a temporary route.
wxRect active_pt_rect
Bounding rectangle for the active point in screen coordinates.
wxPenStyle m_style
Style of the route line when rendered on the chart.
wxString m_TimeDisplayFormat
Format for displaying times in the UI.
int m_width
Width of the route line in pixels when rendered on the chart.
wxString m_RouteNameString
User-assigned name for the route.
wxString m_GUID
Globally unique identifier for this route.
wxDateTime m_PlannedDeparture
Planned departure time for the route, in UTC.
bool m_bIsInLayer
Flag indicating whether this route belongs to a layer.
double m_route_time
Total estimated time to complete the route in seconds.
int m_lastMousePointIndex
Index of the most recently interacted with route point.
void SetDepartureDate(const wxDateTime &dt)
Set the departure time of the route.
HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this route.
bool m_bIsBeingEdited
Flag indicating that the route is currently being edited by the user.
bool m_NextLegGreatCircle
Flag indicating whether the next leg should be calculated using great circle navigation or rhumb line...
int m_LayerID
Identifier of the layer containing this route.
Generic hyperlink data type.
Waypoint or mark abstraction.