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};
106 wxString IsPointNameValid(
RoutePoint *pRP,
const wxString &name)
const;
108 void AddPoint(
RoutePoint *pNewPoint,
bool b_rename_in_sequence =
true,
109 bool b_deferBoxCalc =
false);
110 void InsertPointAndSegment(
RoutePoint *pNewPoint,
int insert_after,
111 bool b_rename_in_sequence =
true,
112 bool b_deferBoxCalc =
false);
113 void AddPointAndSegment(
RoutePoint *pNewPoint,
114 bool b_rename_in_sequence =
true,
115 bool b_deferBoxCalc =
false);
120 bool bRenamePoints =
false);
122 bool bRenamePoints =
false);
125 void DeletePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
126 void RemovePoint(
RoutePoint *rp,
bool bRenamePoints =
false);
127 void DeSelectRoute();
128 void FinalizeForRendering();
149 double planspeed = -1.0);
150 void UpdateSegmentDistances(
double planspeed = -1.0);
153 void Reverse(
bool bRenamePoints =
false);
154 void RebuildGUIDList(
void);
155 void RenameRoutePoints();
156 void ReloadRoutePointIcons();
157 wxString GetNewMarkSequenced(
void);
158 void AssembleRoute();
159 bool IsEqualTo(
Route *ptargetroute);
160 void CloneRoute(
Route *psourceroute,
int start_nPoint,
int end_nPoint,
161 const wxString &suffix,
162 const bool duplicate_first_point =
false);
163 void ClearHighlights(
void);
165 void SetVisible(
bool visible =
true,
bool includeWpts =
true);
166 void SetListed(
bool visible =
true);
167 bool IsVisible() {
return m_bVisible; }
168 bool IsListed() {
return m_bListed; }
172 bool ContainsSharedWP();
173 void SetSharedWPViz(
bool sharedWPVIZ) { m_bsharedWPViz = sharedWPVIZ; }
174 bool GetSharedWPViz() {
return m_bsharedWPViz; }
176 double GetRouteArrivalRadius(
void) {
return m_ArrivalRadius; }
177 void SetRouteArrivalRadius(
double radius) { m_ArrivalRadius = radius; }
189 wxString GetGUID()
const {
return m_GUID; }
190 void ShowWaypointNames(
bool bshow);
191 bool AreWaypointNamesVisible();
384 double m_ArrivalRadius;
392WX_DECLARE_LIST(
Route, RouteList);
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.