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 {
195 bool add = false;
196
197 if (pNewPoint->m_bIsolatedMark) {
198 pNewPoint->SetShared(true);
199 }
200 pNewPoint->m_bIsolatedMark = false; // definitely no longer isolated
201 pNewPoint->m_bIsInRoute = true;
202
203 if (insert_after >= GetnPoints() - 1) {
204 wxLogMessage("Error insert after last point");
205 return;
206 }
207
208 auto pos = pRoutePointList->begin() + insert_after + 1;
209 pNewPoint->m_bIsInRoute = true;
210 pNewPoint->SetNameShown(false);
211 pRoutePointList->insert(pos, pNewPoint);
212 if (bRenamePoints) RenameRoutePoints();
213 m_lastMousePointIndex = GetnPoints();
214 FinalizeForRendering();
215 UpdateSegmentDistances();
216 return;
217 }
218}
219
220RoutePoint *Route::GetPoint(int nWhichPoint) {
221 // nWhichPoint is 1-based.
222 if (nWhichPoint < 1) return nullptr;
223 if (nWhichPoint > static_cast<int>(pRoutePointList->size())) return nullptr;
224 auto pos = pRoutePointList->begin() + nWhichPoint - 1;
225 return *pos;
226}
227
228RoutePoint *Route::GetPoint(const wxString &guid) {
229 for (RoutePoint *prp : *pRoutePointList) {
230 if (guid == prp->m_GUID) return prp;
231 }
232 return (nullptr);
233}
234
235static void TestLongitude(double lon, double min, double max, bool &lonl,
236 bool &lonr) {
237 double clon = (min + max) / 2;
238 if (min - lon > 180) lon += 360;
239
240 lonl = lonr = false;
241 if (lon < min) {
242 if (lon < clon - 180)
243 lonr = true;
244 else
245 lonl = true;
246 } else if (lon > max) {
247 if (lon > clon + 180)
248 lonl = true;
249 else
250 lonr = true;
251 }
252}
253
254bool Route::ContainsSharedWP() {
255 for (RoutePoint *prp : *pRoutePointList) {
256 if (prp->IsShared()) return true;
257 }
258 return false;
259}
260
261// FIXME (leamas): can this be moved to GUI?
262int s_arrow_icon[] = {0, 0, 5, 2, 18, 6, 12, 0, 18, -6, 5, -2, 0, 0};
263
264void Route::ClearHighlights() {
265 for (RoutePoint *prp : *pRoutePointList) {
266 if (prp) prp->m_bPtIsSelected = false;
267 }
268}
269
270RoutePoint *Route::InsertPointBefore(RoutePoint *pRP, double rlat, double rlon,
271 bool bRenamePoints) {
272 RoutePoint *newpoint = new RoutePoint(rlat, rlon, g_default_routepoint_icon,
273 GetNewMarkSequenced(), "");
274 newpoint->m_bIsInRoute = true;
275 newpoint->SetNameShown(false);
276
277 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), pRP);
278 if (pos == pRoutePointList->end()) pos = pRoutePointList->begin();
279 pRoutePointList->insert(pos, newpoint);
280
281 if (bRenamePoints) RenameRoutePoints();
282
283 FinalizeForRendering();
284 UpdateSegmentDistances();
285
286 return (newpoint);
287}
288
289RoutePoint *Route::InsertPointAfter(RoutePoint *pRP, double rlat, double rlon,
290 bool bRenamePoints) {
291 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), pRP);
292 if (pos == pRoutePointList->end()) return nullptr;
293 ++pos;
294
295 RoutePoint *newpoint = new RoutePoint(rlat, rlon, g_default_routepoint_icon,
296 GetNewMarkSequenced(), "");
297 newpoint->m_bIsInRoute = true;
298 newpoint->SetNameShown(false);
299
300 pRoutePointList->insert(pos, newpoint);
301
302 if (bRenamePoints) RenameRoutePoints();
303
304 FinalizeForRendering();
305 UpdateSegmentDistances();
306
307 return (newpoint);
308}
309
310wxString Route::GetNewMarkSequenced() {
311 wxString ret;
312 ret.Printf("NM%03d", m_nm_sequence);
313 m_nm_sequence++;
314
315 return ret;
316}
317
318RoutePoint *Route::GetLastPoint() {
319 if (pRoutePointList->empty()) return nullptr;
320 return *(pRoutePointList->end() - 1);
321}
322
323int Route::GetIndexOf(RoutePoint *prp) {
324 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), prp);
325
326 if (pos == pRoutePointList->end()) return 0;
327 return static_cast<int>(pos - pRoutePointList->begin());
328}
329
330void Route::DeletePoint(RoutePoint *rp, bool bRenamePoints) {
331 // n.b. must delete Selectables and update config before deleting the
332 // point
333 if (rp->m_bIsInLayer) return;
334
335 pSelect->DeleteAllSelectableRoutePoints(this);
336 pSelect->DeleteAllSelectableRouteSegments(this);
337 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), rp);
338 if (pos != pRoutePointList->end()) pRoutePointList->erase(pos);
339 delete rp;
340
341 if (bRenamePoints) RenameRoutePoints();
342
343 if (GetnPoints() > 1) {
344 pSelect->AddAllSelectableRouteSegments(this);
345 pSelect->AddAllSelectableRoutePoints(this);
346
347 FinalizeForRendering();
348 UpdateSegmentDistances();
349 }
350}
351
352void Route::RemovePoint(RoutePoint *rp, bool bRenamePoints) {
353 if (rp->m_bIsActive && this->IsActive()) // FS#348
354 g_pRouteMan->DeactivateRoute();
355
356 pSelect->DeleteAllSelectableRoutePoints(this);
357 pSelect->DeleteAllSelectableRouteSegments(this);
358
359 // Arrange to remove all references to the same routepoint
360 // within the route. This can happen with circular or "round-trip" routes.
361 auto pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), rp);
362 while (pos != pRoutePointList->end()) {
363 pRoutePointList->erase(pos);
364 pos = std::find(pRoutePointList->begin(), pRoutePointList->end(), rp);
365 }
366
367 // check all other routes to see if this point appears in any other route
368 Route *pcontainer_route = FindRouteContainingWaypoint(rp);
369
370 if (pcontainer_route == NULL) {
371 rp->m_bIsInRoute = false; // Take this point out of this (and only) route
372 rp->m_bIsolatedMark = true; // This has become an isolated mark
373 NavObj_dB::GetInstance().UpdateRoutePoint(rp);
374 }
375
376 if (bRenamePoints) RenameRoutePoints();
377
378 // if ( m_nPoints > 1 )
379 {
380 pSelect->AddAllSelectableRouteSegments(this);
381 pSelect->AddAllSelectableRoutePoints(this);
382
383 // NavObjectChanges::getInstance()->UpdateRoute(this);
384 NavObj_dB::GetInstance().UpdateRoute(this);
385 FinalizeForRendering();
386 UpdateSegmentDistances();
387 }
388}
389
390void Route::DeSelectRoute() {
391 for (RoutePoint *rp : *pRoutePointList) {
392 rp->m_bPtIsSelected = false;
393 }
394}
395
396void Route::ReloadRoutePointIcons() {
397 for (RoutePoint *rp : *pRoutePointList) {
398 rp->ReLoadIcon();
399 }
400}
401
402void Route::FinalizeForRendering() { RBBox.Invalidate(); }
403
404LLBBox &Route::GetBBox() {
405 if (RBBox.GetValid()) return RBBox;
406
407 double bbox_lonmin, bbox_lonmax, bbox_latmin, bbox_latmax;
408
409 // wxRoutePointListNode *node = pRoutePointList->GetFirst();
410 auto it = pRoutePointList->begin();
411 RoutePoint *data = *it;
412
413 if (data->m_wpBBox.GetValid()) {
414 bbox_lonmax = data->m_wpBBox.GetMaxLon();
415 bbox_lonmin = data->m_wpBBox.GetMinLon();
416 bbox_latmax = data->m_wpBBox.GetMaxLat();
417 bbox_latmin = data->m_wpBBox.GetMinLat();
418 } else {
419 bbox_lonmax = bbox_lonmin = data->m_lon;
420 bbox_latmax = bbox_latmin = data->m_lat;
421 }
422
423 double lastlon = data->m_lon, wrap = 0;
424 for (++it; it != pRoutePointList->end(); ++it) {
425 data = *it;
426
427 if (lastlon - data->m_lon > 180)
428 wrap += 360;
429 else if (data->m_lon - lastlon > 180)
430 wrap -= 360;
431
432 double lon = data->m_lon + wrap;
433
434 if (lon > bbox_lonmax) bbox_lonmax = lon;
435 if (lon < bbox_lonmin) bbox_lonmin = lon;
436
437 if (data->m_lat > bbox_latmax) bbox_latmax = data->m_lat;
438 if (data->m_lat < bbox_latmin) bbox_latmin = data->m_lat;
439
440 lastlon = data->m_lon;
441 }
442
443 if (bbox_lonmin < -360)
444 bbox_lonmin += 360, bbox_lonmax += 360;
445 else if (bbox_lonmax > 360)
446 bbox_lonmin -= 360, bbox_lonmax -= 360;
447
448 if (bbox_lonmax - bbox_lonmin > 360) bbox_lonmin = -180, bbox_lonmax = 180;
449
450 RBBox.Set(bbox_latmin, bbox_lonmin, bbox_latmax, bbox_lonmax);
451
452 return RBBox;
453}
454
455/*
456 Update a single route segment lengths
457 Also, compute total route length by summing segment distances.
458 */
460 double planspeed) {
461 double slat1 = prp0->m_lat, slon1 = prp0->m_lon;
462 double slat2 = prp->m_lat, slon2 = prp->m_lon;
463
464 // Calculate the absolute distance from 1->2
465
466 double dd;
467 double br;
468 // why are we using mercator rather than great circle here?? [sean 8-11-2015]
469 DistanceBearingMercator(slat2, slon2, slat1, slon1, &br, &dd);
470
471 prp->SetCourse(br);
472 prp->SetDistance(dd);
473
474 // And store in Point 2
475 prp->m_seg_len = dd;
476
477 m_route_length += dd;
478
479 // If Point1 Description contains VMG, store it for Properties Dialog in
480 // Point2 If Point1 Description contains ETD, store it in Point1
481
482 if (planspeed > 0.) {
483 wxDateTime etd;
484
485 double legspeed = planspeed;
486 if (prp->GetPlannedSpeed() > 0.1 && prp->GetPlannedSpeed() < 1000.)
487 legspeed = prp->GetPlannedSpeed();
488 if (legspeed > 0.1 && legspeed < 1000.) {
489 m_route_time += 3600. * dd / legspeed;
490 prp->m_seg_vmg = legspeed;
491 }
492 wxLongLong duration = wxLongLong(3600.0 * prp->m_seg_len / prp->m_seg_vmg);
493 prp->SetETE(duration);
494 wxTimeSpan ts(0, 0, duration);
495 if (!prp0->GetManualETD().IsValid()) {
496 prp0->m_manual_etd = false;
497 if (prp0->GetETA().IsValid()) {
498 prp0->m_seg_etd = prp0->GetETA();
499 } else {
500 prp0->m_seg_etd =
501 m_PlannedDeparture + wxTimeSpan(0, 0, m_route_time - duration);
502 }
503 }
504
505 prp->m_seg_eta = prp0->GetETD() + ts;
506 if (!prp->m_manual_etd || !prp->GetETD().IsValid()) {
507 prp->m_seg_etd = prp->m_seg_eta;
508 prp->m_manual_etd = false;
509 }
510 }
511}
512
513/*
514 Update the route segment lengths, storing each segment length in <destination>
515 point. Also, compute total route length by summing segment distances.
516 */
517void Route::UpdateSegmentDistances(double planspeed) {
518 wxPoint rpt, rptn;
519
520 m_route_length = 0.0;
521 m_route_time = 0.0;
522
523 // wxRoutePointListNode *node = pRoutePointList->GetFirst();
524 auto it = pRoutePointList->begin();
525
526 if (it != pRoutePointList->end()) {
527 // Route start point
528 RoutePoint *prp0 = *it;
529 if (!prp0->m_manual_etd) {
532 }
533 for (++it; it != pRoutePointList->end(); ++it) {
534 RoutePoint *prp = *it;
535 UpdateSegmentDistance(prp0, prp, planspeed);
536
537 prp0 = prp;
538 }
539 }
540}
541
542void Route::Reverse(bool bRenamePoints) {
543 // Reverse the GUID list
544 wxArrayString RoutePointGUIDList;
545
546 int ncount = pRoutePointList->size();
547 for (int i = 0; i < ncount; i++)
548 RoutePointGUIDList.Add(GetPoint(ncount - i)->m_GUID);
549
550 pRoutePointList->clear();
551 m_route_length = 0.0;
552
553 // Iterate over the RoutePointGUIDs
554 for (unsigned int ip = 0; ip < RoutePointGUIDList.GetCount(); ip++) {
555 wxString GUID = RoutePointGUIDList[ip];
556 for (RoutePoint *prp : *pWayPointMan->GetWaypointList()) {
557 if (prp->m_GUID == GUID) {
558 AddPoint(prp);
559 break;
560 }
561 }
562 }
563
564 if (bRenamePoints) RenameRoutePoints();
565
566 // Switch start/end strings. anders, 2010-01-29
567 wxString tmp = m_RouteStartString;
569 m_RouteEndString = tmp;
570}
571
572void Route::SetVisible(bool visible, bool includeWpts) {
573 m_bVisible = visible;
574
575 if (!includeWpts) return;
576
577 for (RoutePoint *rp : *pWayPointMan->GetWaypointList()) {
578 // if this is a "shared" point, then do not turn off visibility.
579 // This step keeps the point available for selection to other routes,
580 // or may be manaully hidden in route-manager dialog.
581 if (rp->IsShared()) {
582 if (visible) rp->SetVisible(visible);
583 }
584 }
585}
586
587void Route::SetListed(bool visible) { m_bListed = visible; }
588
589void Route::AssembleRoute() {}
590
591void Route::ShowWaypointNames(bool bshow) {
592 for (RoutePoint *prp : *pRoutePointList) {
593 prp->SetNameShown(bshow);
594 }
595}
596
597bool Route::AreWaypointNamesVisible() {
598 bool bvis = false;
599 for (RoutePoint *prp : *pRoutePointList) {
600 if (prp->GetNameShown()) bvis = true;
601 }
602 return bvis;
603}
604
605void Route::RenameRoutePoints() {
606 // iterate on the route points.
607 // If dynamically named, rename according to current list position
608
609 int i = 1;
610 for (RoutePoint *prp : *pRoutePointList) {
611 if (prp->IsNameDynamic()) {
612 wxString name = prp->GetName();
613 if (name.Len() == 3) {
614 name.Printf("%03d", i);
615 } else if (name.Left(2) == "NM") {
616 name.Printf("%03d", i);
617 if (prp->GetName().Len() >= 5) {
618 name.Append(prp->GetName().Mid(5));
619 }
620 } else {
621 name.Printf("%03d", i);
622 name.Append(prp->GetName().Mid(3));
623 }
624 prp->SetName(name);
625 }
626 i++;
627 }
628}
629
630// Is this route equal to another, meaning,
631// Do all routepoint positions and names match?
632bool Route::IsEqualTo(Route *ptargetroute) {
633 auto pthisnode = (this->pRoutePointList)->begin();
634 auto pthatnode = (ptargetroute->pRoutePointList)->begin();
635
636 if (pthisnode == this->pRoutePointList->end()) return false;
637
638 if (this->m_bIsInLayer || ptargetroute->m_bIsInLayer) return false;
639
640 if (this->GetnPoints() != ptargetroute->GetnPoints()) return false;
641
642 while (pthisnode != this->pRoutePointList->end()) {
643 if (pthatnode == ptargetroute->pRoutePointList->end()) return false;
644
645 RoutePoint *pthisrp = *pthisnode;
646 RoutePoint *pthatrp = *pthatnode;
647
648 if ((fabs(pthisrp->m_lat - pthatrp->m_lat) > 1.0e-6) ||
649 (fabs(pthisrp->m_lon - pthatrp->m_lon) > 1.0e-6))
650 return false;
651
652 if (!pthisrp->GetName().IsSameAs(pthatrp->GetName())) return false;
653
654 ++pthisnode;
655 ++pthatnode;
656 }
657
658 return true; // success, they are the same
659}
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:459
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.