OpenCPN Partial API docs
Loading...
Searching...
No Matches
route.cpp
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2013 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#include <wx/wxprec.h>
25#ifndef WX_PRECOMP
26#include <wx/wx.h>
27#endif
28
29#include <wx/arrstr.h>
30#include <wx/datetime.h>
31#include <wx/gdicmn.h>
32#include <wx/log.h>
33#include <wx/pen.h>
34#include <wx/string.h>
35
36#include "model/config_vars.h"
37#include "model/cutil.h"
38#include "model/georef.h"
39#include "model/georef.h"
40#include "model/config_vars.h"
41#include "model/nav_object_database.h"
42#include "model/route.h"
43#include "model/routeman.h"
44#include "model/select.h"
45#include "model/navobj_db.h"
46
47WayPointman *pWayPointMan;
48
49#include <wx/listimpl.cpp>
50
51Route::Route() {
52 m_bRtIsSelected = false;
53 m_bRtIsActive = false;
55 m_bIsBeingEdited = false;
56 m_bIsBeingCreated = false;
57 m_nm_sequence = 1;
58 m_route_length = 0.0;
59 m_route_time = 0.0;
60 m_bVisible = true;
61 m_bListed = true;
62 m_bDeleteOnArrival = false;
63 m_width = WIDTH_UNDEFINED;
64 m_style = wxPENSTYLE_INVALID;
65 m_hiliteWidth = 0;
66
67 pRoutePointList = new RoutePointList;
68 m_GUID = pWayPointMan->CreateGUID(NULL);
69 m_btemp = false;
70
71 m_ArrivalRadius = g_n_arrival_circle_radius; // Nautical Miles
72
73 m_LayerID = 0;
74 m_bIsInLayer = false;
75
76 m_Colour = "";
77
80
81 m_PlannedSpeed = ROUTE_DEFAULT_SPEED;
82 if (g_defaultBoatSpeed != ROUTE_DEFAULT_SPEED)
83 m_PlannedSpeed = g_defaultBoatSpeed;
84
85 m_PlannedDeparture = RTE_UNDEF_DEPARTURE;
86 m_TimeDisplayFormat = RTE_TIME_DISP_PC;
87 m_HyperlinkList = new HyperlinkList;
88
89 m_bsharedWPViz = false;
90}
91
92Route::~Route() {
93 delete pRoutePointList;
94 delete m_HyperlinkList;
95}
96
97// The following is used only for route splitting, assumes just created, empty
98// route
99//
100void Route::CloneRoute(Route *psourceroute, int start_nPoint, int end_nPoint,
101 const wxString &suffix,
102 const bool duplicate_first_point) {
103 m_RouteNameString = psourceroute->m_RouteNameString + suffix;
105 m_RouteEndString = psourceroute->m_RouteEndString;
106
107 int i;
108 for (i = start_nPoint; i <= end_nPoint; i++) {
109 if (!psourceroute->m_bIsInLayer &&
110 !(i == start_nPoint && duplicate_first_point)) {
111 AddPoint(psourceroute->GetPoint(i), false);
112 } else {
113 RoutePoint *psourcepoint = psourceroute->GetPoint(i);
114 RoutePoint *ptargetpoint = new RoutePoint(
115 psourcepoint->m_lat, psourcepoint->m_lon, psourcepoint->GetIconName(),
116 psourcepoint->GetName(), "", true);
117 ptargetpoint->m_bShowName =
118 psourcepoint->m_bShowName; // do not change new wpt's name visibility
119 AddPoint(ptargetpoint, false);
120 }
121 }
122
123 FinalizeForRendering();
124}
125
126wxString Route::IsPointNameValid(RoutePoint *pPoint,
127 const wxString &name) const {
128 wxString substr = name;
129 auto it = pRoutePointList->begin();
130 while (it != pRoutePointList->end()) {
131 RoutePoint *point = *it;
132 wxString exist = point->GetName();
133
134 if (pPoint->m_GUID == point->m_GUID) {
135 ++it;
136 } else if (substr == exist) {
137 return _("Name is not unique in route");
138 } else {
139 ++it;
140 }
141 }
142 return "";
143}
144
145void Route::AddPoint(RoutePoint *pNewPoint, bool b_rename_in_sequence,
146 bool b_deferBoxCalc) {
147 if (pNewPoint->m_bIsolatedMark) {
148 pNewPoint->SetShared(true);
149 }
150 pNewPoint->m_bIsolatedMark = false; // definitely no longer isolated
151 pNewPoint->m_bIsInRoute = true;
152
153 RoutePoint *prev = GetLastPoint();
154 pRoutePointList->push_back(pNewPoint);
155
156 if (!b_deferBoxCalc) FinalizeForRendering();
157
158 if (prev) UpdateSegmentDistance(prev, pNewPoint);
159
160 if (b_rename_in_sequence && pNewPoint->GetName().IsEmpty() &&
161 !pNewPoint->IsShared()) {
162 wxString name;
163 name.Printf("%03d", GetnPoints());
164 pNewPoint->SetName(name);
165 }
166 return;
167}
168
169void Route::AddPointAndSegment(RoutePoint *pNewPoint, bool b_rename_in_sequence,
170 bool b_deferBoxCalc) {
171 int npoints = GetnPoints();
172 RoutePoint *newpoint = pNewPoint;
173 if (newpoint->m_bIsInLayer) {
174 newpoint = new RoutePoint(pNewPoint->m_lat, pNewPoint->m_lon,
175 pNewPoint->GetIconName(), pNewPoint->GetName(),
176 "", false);
177 newpoint->m_bShowName =
178 pNewPoint->m_bShowName; // do not change new wpt's name visibility
179 }
180 AddPoint(newpoint, false);
181 if (npoints != 0) {
182 double rlat = GetPoint(npoints)->m_lat;
183 double rlon = GetPoint(npoints)->m_lon;
184 npoints = GetnPoints();
185 pSelect->AddSelectableRouteSegment(
186 rlat, rlon, GetPoint(npoints)->m_lat, GetPoint(npoints)->m_lon,
187 GetPoint(npoints - 1), GetPoint(npoints), this);
188 }
189 m_lastMousePointIndex = GetnPoints();
190}
191
192void Route::InsertPointAndSegment(RoutePoint *pNewPoint, int insert_after,
193 bool bRenamePoints, bool b_deferBoxCalc) {
194 // insert_after is zero-based.
195 {
196 bool add = false;
197
198 if (pNewPoint->m_bIsolatedMark) {
199 pNewPoint->SetShared(true);
200 }
201 pNewPoint->m_bIsolatedMark = false; // definitely no longer isolated
202 pNewPoint->m_bIsInRoute = true;
203
204 if (insert_after >= GetnPoints() - 1) {
205 wxLogMessage("Error insert after last point");
206 return;
207 }
208
209 auto pos = pRoutePointList->begin() + insert_after;
210 pNewPoint->m_bIsInRoute = true;
211 pNewPoint->SetNameShown(false);
212 pRoutePointList->insert(pos, pNewPoint);
213 if (bRenamePoints) RenameRoutePoints();
214 m_lastMousePointIndex = GetnPoints();
215 FinalizeForRendering();
216 UpdateSegmentDistances();
217 return;
218 }
219}
220
221RoutePoint *Route::GetPoint(int nWhichPoint) {
222 // nWhichPoint is 1-based.
223 if (nWhichPoint < 1) return nullptr;
224 if (nWhichPoint > static_cast<int>(pRoutePointList->size())) return nullptr;
225 auto pos = pRoutePointList->begin() + nWhichPoint - 1;
226 return *pos;
227}
228
229RoutePoint *Route::GetPoint(const wxString &guid) {
230 for (RoutePoint *prp : *pRoutePointList) {
231 if (guid == prp->m_GUID) return prp;
232 }
233 return (nullptr);
234}
235
236static void TestLongitude(double lon, double min, double max, bool &lonl,
237 bool &lonr) {
238 double clon = (min + max) / 2;
239 if (min - lon > 180) lon += 360;
240
241 lonl = lonr = false;
242 if (lon < min) {
243 if (lon < clon - 180)
244 lonr = true;
245 else
246 lonl = true;
247 } else if (lon > max) {
248 if (lon > clon + 180)
249 lonl = true;
250 else
251 lonr = true;
252 }
253}
254
255bool Route::ContainsSharedWP() {
256 for (RoutePoint *prp : *pRoutePointList) {
257 if (prp->IsShared()) return true;
258 }
259 return false;
260}
261
262// FIXME (leamas): can this be moved to GUI?
263int s_arrow_icon[] = {0, 0, 5, 2, 18, 6, 12, 0, 18, -6, 5, -2, 0, 0};
264
265void Route::ClearHighlights() {
266 for (RoutePoint *prp : *pRoutePointList) {
267 if (prp) prp->m_bPtIsSelected = false;
268 }
269}
270
271RoutePoint *Route::InsertPointBefore(RoutePoint *pRP, double rlat, double rlon,
272 bool bRenamePoints) {
273 RoutePoint *newpoint = new RoutePoint(rlat, rlon, g_default_routepoint_icon,
274 GetNewMarkSequenced(), "");
275 newpoint->m_bIsInRoute = true;
276 newpoint->SetNameShown(false);
277
278 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), pRP);
279 if (pos == pRoutePointList->end()) pos = pRoutePointList->begin();
280 pRoutePointList->insert(pos, newpoint);
281
282 if (bRenamePoints) RenameRoutePoints();
283
284 FinalizeForRendering();
285 UpdateSegmentDistances();
286
287 return (newpoint);
288}
289
290RoutePoint *Route::InsertPointAfter(RoutePoint *pRP, double rlat, double rlon,
291 bool bRenamePoints) {
292 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), pRP);
293 if (pos == pRoutePointList->end()) return nullptr;
294 ++pos;
295
296 RoutePoint *newpoint = new RoutePoint(rlat, rlon, g_default_routepoint_icon,
297 GetNewMarkSequenced(), "");
298 newpoint->m_bIsInRoute = true;
299 newpoint->SetNameShown(false);
300
301 pRoutePointList->insert(pos, newpoint);
302
303 if (bRenamePoints) RenameRoutePoints();
304
305 FinalizeForRendering();
306 UpdateSegmentDistances();
307
308 return (newpoint);
309}
310
311wxString Route::GetNewMarkSequenced() {
312 wxString ret;
313 ret.Printf("NM%03d", m_nm_sequence);
314 m_nm_sequence++;
315
316 return ret;
317}
318
319RoutePoint *Route::GetLastPoint() {
320 if (pRoutePointList->empty()) return nullptr;
321 return *(pRoutePointList->end() - 1);
322}
323
324int Route::GetIndexOf(RoutePoint *prp) {
325 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), prp);
326
327 if (pos == pRoutePointList->end()) return -1;
328 return static_cast<int>(pos - pRoutePointList->begin());
329}
330
331void Route::DeletePoint(RoutePoint *rp, bool bRenamePoints) {
332 // n.b. must delete Selectables and update config before deleting the
333 // point
334 if (rp->m_bIsInLayer) return;
335
336 pSelect->DeleteAllSelectableRoutePoints(this);
337 pSelect->DeleteAllSelectableRouteSegments(this);
338 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), rp);
339 if (pos != pRoutePointList->end()) pRoutePointList->erase(pos);
340 delete rp;
341
342 if (bRenamePoints) RenameRoutePoints();
343
344 if (GetnPoints() > 1) {
345 pSelect->AddAllSelectableRouteSegments(this);
346 pSelect->AddAllSelectableRoutePoints(this);
347
348 FinalizeForRendering();
349 UpdateSegmentDistances();
350 }
351}
352
353void Route::RemovePoint(RoutePoint *rp, bool bRenamePoints) {
354 if (rp->m_bIsActive && this->IsActive()) // FS#348
355 g_pRouteMan->DeactivateRoute();
356
357 pSelect->DeleteAllSelectableRoutePoints(this);
358 pSelect->DeleteAllSelectableRouteSegments(this);
359
360 // Arrange to remove all references to the same routepoint
361 // within the route. This can happen with circular or "round-trip" routes.
362 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), rp);
363 while (pos != pRoutePointList->end()) {
364 pRoutePointList->erase(pos);
365 pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), rp);
366 }
367
368 // check all other routes to see if this point appears in any other route
369 Route *pcontainer_route = FindRouteContainingWaypoint(rp);
370
371 if (pcontainer_route == NULL) {
372 rp->m_bIsInRoute = false; // Take this point out of this (and only) route
373 rp->m_bIsolatedMark = true; // This has become an isolated mark
374 NavObj_dB::GetInstance().UpdateRoutePoint(rp);
375 }
376
377 if (bRenamePoints) RenameRoutePoints();
378
379 // if ( m_nPoints > 1 )
380 {
381 pSelect->AddAllSelectableRouteSegments(this);
382 pSelect->AddAllSelectableRoutePoints(this);
383
384 // NavObjectChanges::getInstance()->UpdateRoute(this);
385 NavObj_dB::GetInstance().UpdateRoute(this);
386 FinalizeForRendering();
387 UpdateSegmentDistances();
388 }
389}
390
391void Route::DeSelectRoute() {
392 for (RoutePoint *rp : *pRoutePointList) {
393 rp->m_bPtIsSelected = false;
394 }
395}
396
397void Route::ReloadRoutePointIcons() {
398 for (RoutePoint *rp : *pRoutePointList) {
399 rp->ReLoadIcon();
400 }
401}
402
403void Route::FinalizeForRendering() { RBBox.Invalidate(); }
404
405LLBBox &Route::GetBBox() {
406 if (RBBox.GetValid()) return RBBox;
407
408 double bbox_lonmin, bbox_lonmax, bbox_latmin, bbox_latmax;
409
410 // wxRoutePointListNode *node = pRoutePointList->GetFirst();
411 auto it = pRoutePointList->begin();
412 RoutePoint *data = *it;
413
414 if (data->m_wpBBox.GetValid()) {
415 bbox_lonmax = data->m_wpBBox.GetMaxLon();
416 bbox_lonmin = data->m_wpBBox.GetMinLon();
417 bbox_latmax = data->m_wpBBox.GetMaxLat();
418 bbox_latmin = data->m_wpBBox.GetMinLat();
419 } else {
420 bbox_lonmax = bbox_lonmin = data->m_lon;
421 bbox_latmax = bbox_latmin = data->m_lat;
422 }
423
424 double lastlon = data->m_lon, wrap = 0;
425 for (++it; it != pRoutePointList->end(); ++it) {
426 data = *it;
427
428 if (lastlon - data->m_lon > 180)
429 wrap += 360;
430 else if (data->m_lon - lastlon > 180)
431 wrap -= 360;
432
433 double lon = data->m_lon + wrap;
434
435 if (lon > bbox_lonmax) bbox_lonmax = lon;
436 if (lon < bbox_lonmin) bbox_lonmin = lon;
437
438 if (data->m_lat > bbox_latmax) bbox_latmax = data->m_lat;
439 if (data->m_lat < bbox_latmin) bbox_latmin = data->m_lat;
440
441 lastlon = data->m_lon;
442 }
443
444 if (bbox_lonmin < -360)
445 bbox_lonmin += 360, bbox_lonmax += 360;
446 else if (bbox_lonmax > 360)
447 bbox_lonmin -= 360, bbox_lonmax -= 360;
448
449 if (bbox_lonmax - bbox_lonmin > 360) bbox_lonmin = -180, bbox_lonmax = 180;
450
451 RBBox.Set(bbox_latmin, bbox_lonmin, bbox_latmax, bbox_lonmax);
452
453 return RBBox;
454}
455
456/*
457 Update a single route segment lengths
458 Also, compute total route length by summing segment distances.
459 */
461 double planspeed) {
462 double slat1 = prp0->m_lat, slon1 = prp0->m_lon;
463 double slat2 = prp->m_lat, slon2 = prp->m_lon;
464
465 // Calculate the absolute distance from 1->2
466
467 double dd;
468 double br;
469 // why are we using mercator rather than great circle here?? [sean 8-11-2015]
470 DistanceBearingMercator(slat2, slon2, slat1, slon1, &br, &dd);
471
472 prp->SetCourse(br);
473 prp->SetDistance(dd);
474
475 // And store in Point 2
476 prp->m_seg_len = dd;
477
478 m_route_length += dd;
479
480 // If Point1 Description contains VMG, store it for Properties Dialog in
481 // Point2 If Point1 Description contains ETD, store it in Point1
482
483 if (planspeed > 0.) {
484 wxDateTime etd;
485
486 double legspeed = planspeed;
487 if (prp->GetPlannedSpeed() > 0.1 && prp->GetPlannedSpeed() < 1000.)
488 legspeed = prp->GetPlannedSpeed();
489 if (legspeed > 0.1 && legspeed < 1000.) {
490 m_route_time += 3600. * dd / legspeed;
491 prp->m_seg_vmg = legspeed;
492 }
493 wxLongLong duration = wxLongLong(3600.0 * prp->m_seg_len / prp->m_seg_vmg);
494 prp->SetETE(duration);
495 wxTimeSpan ts(0, 0, duration);
496 if (!prp0->GetManualETD().IsValid()) {
497 prp0->m_manual_etd = false;
498 if (prp0->GetETA().IsValid()) {
499 prp0->m_seg_etd = prp0->GetETA();
500 } else {
501 prp0->m_seg_etd =
502 m_PlannedDeparture + wxTimeSpan(0, 0, m_route_time - duration);
503 }
504 }
505
506 prp->m_seg_eta = prp0->GetETD() + ts;
507 if (!prp->m_manual_etd || !prp->GetETD().IsValid()) {
508 prp->m_seg_etd = prp->m_seg_eta;
509 prp->m_manual_etd = false;
510 }
511 }
512}
513
514/*
515 Update the route segment lengths, storing each segment length in <destination>
516 point. Also, compute total route length by summing segment distances.
517 */
518void Route::UpdateSegmentDistances(double planspeed) {
519 wxPoint rpt, rptn;
520
521 m_route_length = 0.0;
522 m_route_time = 0.0;
523
524 // wxRoutePointListNode *node = pRoutePointList->GetFirst();
525 auto it = pRoutePointList->begin();
526
527 if (it != pRoutePointList->end()) {
528 // Route start point
529 RoutePoint *prp0 = *it;
530 if (!prp0->m_manual_etd) {
533 }
534 for (++it; it != pRoutePointList->end(); ++it) {
535 RoutePoint *prp = *it;
536 UpdateSegmentDistance(prp0, prp, planspeed);
537
538 prp0 = prp;
539 }
540 }
541}
542
543void Route::Reverse(bool bRenamePoints) {
544 // Reverse the GUID list
545 wxArrayString RoutePointGUIDList;
546
547 int ncount = pRoutePointList->size();
548 for (int i = 0; i < ncount; i++)
549 RoutePointGUIDList.Add(GetPoint(ncount - i)->m_GUID);
550
551 pRoutePointList->clear();
552 m_route_length = 0.0;
553
554 // Iterate over the RoutePointGUIDs
555 for (unsigned int ip = 0; ip < RoutePointGUIDList.GetCount(); ip++) {
556 wxString GUID = RoutePointGUIDList[ip];
557 for (RoutePoint *prp : *pWayPointMan->GetWaypointList()) {
558 if (prp->m_GUID == GUID) {
559 AddPoint(prp);
560 break;
561 }
562 }
563 }
564
565 if (bRenamePoints) RenameRoutePoints();
566
567 // Switch start/end strings. anders, 2010-01-29
568 wxString tmp = m_RouteStartString;
570 m_RouteEndString = tmp;
571}
572
573void Route::SetVisible(bool visible, bool includeWpts) {
574 m_bVisible = visible;
575
576 if (!includeWpts) return;
577
578 for (RoutePoint *rp : *pWayPointMan->GetWaypointList()) {
579 // if this is a "shared" point, then do not turn off visibility.
580 // This step keeps the point available for selection to other routes,
581 // or may be manaully hidden in route-manager dialog.
582 if (rp->IsShared()) {
583 if (visible) rp->SetVisible(visible);
584 }
585 }
586}
587
588void Route::SetListed(bool visible) { m_bListed = visible; }
589
590void Route::AssembleRoute() {}
591
592void Route::ShowWaypointNames(bool bshow) {
593 for (RoutePoint *prp : *pRoutePointList) {
594 prp->SetNameShown(bshow);
595 }
596}
597
598bool Route::AreWaypointNamesVisible() {
599 bool bvis = false;
600 for (RoutePoint *prp : *pRoutePointList) {
601 if (prp->GetNameShown()) bvis = true;
602 }
603 return bvis;
604}
605
606void Route::RenameRoutePoints() {
607 // iterate on the route points.
608 // If dynamically named, rename according to current list position
609
610 int i = 1;
611 for (RoutePoint *prp : *pRoutePointList) {
612 if (prp->IsNameDynamic()) {
613 wxString name = prp->GetName();
614 if (name.Len() == 3) {
615 name.Printf("%03d", i);
616 } else if (name.Left(2) == "NM") {
617 name.Printf("%03d", i);
618 if (prp->GetName().Len() >= 5) {
619 name.Append(prp->GetName().Mid(5));
620 }
621 } else {
622 name.Printf("%03d", i);
623 name.Append(prp->GetName().Mid(3));
624 }
625 prp->SetName(name);
626 }
627 i++;
628 }
629}
630
631// Is this route equal to another, meaning,
632// Do all routepoint positions and names match?
633bool Route::IsEqualTo(Route *ptargetroute) {
634 auto pthisnode = (this->pRoutePointList)->begin();
635 auto pthatnode = (ptargetroute->pRoutePointList)->begin();
636
637 if (pthisnode == this->pRoutePointList->end()) return false;
638
639 if (this->m_bIsInLayer || ptargetroute->m_bIsInLayer) return false;
640
641 if (this->GetnPoints() != ptargetroute->GetnPoints()) return false;
642
643 while (pthisnode != this->pRoutePointList->end()) {
644 if (pthatnode == ptargetroute->pRoutePointList->end()) return false;
645
646 RoutePoint *pthisrp = *pthisnode;
647 RoutePoint *pthatrp = *pthatnode;
648
649 if ((fabs(pthisrp->m_lat - pthatrp->m_lat) > 1.0e-6) ||
650 (fabs(pthisrp->m_lon - pthatrp->m_lon) > 1.0e-6))
651 return false;
652
653 if (!pthisrp->GetName().IsSameAs(pthatrp->GetName())) return false;
654
655 ++pthisnode;
656 ++pthatnode;
657 }
658
659 return true; // success, they are the same
660}
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
LLBBox m_wpBBox
Bounding box for the waypoint.
wxString m_GUID
Globally Unique Identifier for the waypoint.
wxDateTime GetETD()
Retrieves the Estimated Time of Departure for this waypoint, in UTC.
bool IsNameDynamic()
bool m_bIsolatedMark
Flag indicating if the waypoint is a standalone mark.
bool m_bIsActive
Flag indicating if this waypoint is active for navigation.
wxDateTime GetManualETD()
Retrieves the manually set Estimated Time of Departure for this waypoint, in UTC.
wxDateTime m_seg_etd
Estimated Time of Departure from this waypoint, in UTC.
bool m_bIsInRoute
Flag indicating if this waypoint is part of a route.
double m_seg_len
Length of the leg from previous waypoint to this waypoint in nautical miles.
bool m_bShowName
Flag indicating if the waypoint name should be shown.
double GetPlannedSpeed()
Return the planned speed associated with this waypoint.
bool m_bPtIsSelected
Flag indicating if this waypoint is currently selected.
bool m_bIsInLayer
Flag indicating if the waypoint belongs to a layer.
bool m_manual_etd
Flag indicating whether the ETD has been manually set by the user.
double m_seg_vmg
Planned speed for traveling FROM this waypoint TO the next waypoint.
wxDateTime m_seg_eta
Estimated Time of Arrival at this waypoint, in UTC.
wxDateTime GetETA()
Retrieves the Estimated Time of Arrival for this waypoint, in UTC.
Represents a navigational route in the navigation system.
Definition route.h:99
int m_hiliteWidth
Width in pixels for highlighting the route when selected.
Definition route.h:356
bool m_bRtIsSelected
Flag indicating whether this route is currently selected in the UI.
Definition route.h:203
double m_PlannedSpeed
Default planned speed for the route in knots.
Definition route.h:321
wxString m_RouteStartString
Name or description of the route's starting point.
Definition route.h:252
bool m_bIsBeingCreated
Flag indicating that the route is currently being created by the user.
Definition route.h:219
void UpdateSegmentDistance(RoutePoint *prp0, RoutePoint *prp, double planspeed=-1.0)
Updates the navigation data for a single route segment between two waypoints.
Definition route.cpp:460
RoutePointList * pRoutePointList
Ordered list of waypoints (RoutePoints) that make up this route.
Definition route.h:336
double m_route_length
Total length of the route in nautical miles, calculated using rhumb line (Mercator) distances.
Definition route.h:237
bool m_bRtIsActive
Flag indicating whether this route is currently active for navigation.
Definition route.h:208
wxString m_Colour
Color name for rendering the route on the chart.
Definition route.h:346
bool m_bDeleteOnArrival
Flag indicating whether the route should be deleted once navigation reaches the end.
Definition route.h:268
wxString m_RouteEndString
Name or description of the route's ending point.
Definition route.h:257
RoutePoint * m_pRouteActivePoint
Pointer to the currently active waypoint within this route.
Definition route.h:214
bool m_btemp
Flag indicating if this is a temporary route.
Definition route.h:351
wxPenStyle m_style
Style of the route line when rendered on the chart.
Definition route.h:293
wxString m_TimeDisplayFormat
Format for displaying times in the UI.
Definition route.h:331
int m_width
Width of the route line in pixels when rendered on the chart.
Definition route.h:288
wxString m_RouteNameString
User-assigned name for the route.
Definition route.h:247
wxString m_GUID
Globally unique identifier for this route.
Definition route.h:273
wxDateTime m_PlannedDeparture
Planned departure time for the route, in UTC.
Definition route.h:326
bool m_bIsInLayer
Flag indicating whether this route belongs to a layer.
Definition route.h:278
double m_route_time
Total estimated time to complete the route in seconds.
Definition route.h:242
int m_lastMousePointIndex
Index of the most recently interacted with route point.
Definition route.h:298
HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this route.
Definition route.h:361
bool m_bIsBeingEdited
Flag indicating that the route is currently being edited by the user.
Definition route.h:224
bool m_NextLegGreatCircle
Flag indicating whether the next leg should be calculated using great circle navigation or rhumb line...
Definition route.h:315
int m_LayerID
Identifier of the layer containing this route.
Definition route.h:283
Global variables stored in configuration file.
Extern C linked utilities.
OpenCPN Georef utility.
MySQL based storage for routes, tracks, etc.
Route abstraction.
Routeman * g_pRouteMan
Global instance.
Definition routeman.cpp:60
Route Manager.
Select * pSelect
Global instance.
Definition select.cpp:36
Selected route, segment, waypoint, etc.