OpenCPN Partial API docs
Loading...
Searching...
No Matches
api_121.cpp
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2024 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, write to the *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
24#include <algorithm>
25#include <map>
26#include <memory>
27#include <string>
28#include <vector>
29
30#include <wx/wx.h>
31#include <wx/event.h>
32#include <wx/string.h>
33#include <wx/window.h>
34
35#include "model/ais_decoder.h"
37#include "model/gui_events.h"
38#include "model/gui_vars.h"
39#include "model/navobj_db.h"
41#include "model/own_ship.h"
42#include "model/route.h"
43#include "model/track.h"
44
45#include "chcanv.h"
46#include "ocpn_plugin.h"
47#include "tcmgr.h"
48
49// translate O route class to PlugIn_Waypoint_ExV2
50static void PlugInExV2FromRoutePoint(PlugIn_Waypoint_ExV2* dst,
51 /* const*/ RoutePoint* src) {
52 dst->m_lat = src->m_lat;
53 dst->m_lon = src->m_lon;
54 dst->IconName = src->GetIconName();
55 dst->m_MarkName = src->GetName();
56 dst->m_MarkDescription = src->GetDescription();
57 dst->IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
58 dst->IsVisible = src->IsVisible();
59 dst->m_CreateTime = src->GetCreateTime(); // not const
60 dst->m_GUID = src->m_GUID;
61
62 // Transcribe (clone) the html HyperLink List, if present
63 if (src->m_HyperlinkList) {
64 delete dst->m_HyperlinkList;
65 dst->m_HyperlinkList = nullptr;
66
67 if (src->m_HyperlinkList->size() > 0) {
68 dst->m_HyperlinkList = new Plugin_HyperlinkList;
69
70 for (Hyperlink* link : *src->m_HyperlinkList) {
72 h->DescrText = link->DescrText;
73 h->Link = link->Link;
74 h->Type = link->LType;
75 dst->m_HyperlinkList->Append(h);
76 }
77 }
78 }
79
80 // Get the range ring info
85 dst->m_TideStation = src->m_TideStation;
86
87 // Get other extended info
88 dst->IsNameVisible = src->m_bShowName;
89 dst->scamin = src->GetScaMin();
90 dst->b_useScamin = src->GetUseSca();
91 dst->IsActive = src->m_bIsActive;
92
93 dst->scamax = src->GetScaMax();
94 dst->m_PlannedSpeed = src->GetPlannedSpeed();
95 dst->m_ETD = src->GetManualETD();
96 dst->m_WaypointArrivalRadius = src->GetWaypointArrivalRadius();
97 dst->m_bShowWaypointRangeRings = src->GetShowWaypointRangeRings();
98}
99
100static void cloneHyperlinkListExV2(RoutePoint* dst,
101 const PlugIn_Waypoint_ExV2* src) {
102 // Transcribe (clone) the html HyperLink List, if present
103 if (src->m_HyperlinkList == nullptr) return;
104
105 if (src->m_HyperlinkList->GetCount() > 0) {
106 Plugin_HyperlinkList::compatibility_iterator linknode =
107 src->m_HyperlinkList->GetFirst();
108 while (linknode) {
109 Plugin_Hyperlink* link = linknode->GetData();
110
111 Hyperlink* h = new Hyperlink();
112 h->DescrText = link->DescrText;
113 h->Link = link->Link;
114 h->LType = link->Type;
115
116 dst->m_HyperlinkList->push_back(h);
117
118 linknode = linknode->GetNext();
119 }
120 }
121}
122
123static RoutePoint* CreateNewPoint(const PlugIn_Waypoint_ExV2* src,
124 bool b_permanent) {
125 RoutePoint* pWP = new RoutePoint(src->m_lat, src->m_lon, src->IconName,
126 src->m_MarkName, src->m_GUID);
127
128 pWP->m_bIsolatedMark = true; // This is an isolated mark
129
130 cloneHyperlinkListExV2(pWP, src);
131
133
134 if (src->m_CreateTime.IsValid())
135 pWP->SetCreateTime(src->m_CreateTime);
136 else {
137 pWP->SetCreateTime(wxDateTime::Now().ToUTC());
138 }
139
140 pWP->m_btemp = (b_permanent == false);
141
142 // Extended fields
143 pWP->SetIconName(src->IconName);
144 pWP->SetWaypointRangeRingsNumber(src->nrange_rings);
145 pWP->SetWaypointRangeRingsStep(src->RangeRingSpace);
146 pWP->SetWaypointRangeRingsStepUnits(src->RangeRingSpaceUnits);
147 pWP->SetWaypointRangeRingsColour(src->RangeRingColor);
148 pWP->SetTideStation(src->m_TideStation);
149 pWP->SetScaMin(src->scamin);
150 pWP->SetUseSca(src->b_useScamin);
151 pWP->SetNameShown(src->IsNameVisible);
152 pWP->SetVisible(src->IsVisible);
153
154 pWP->SetWaypointArrivalRadius(src->m_WaypointArrivalRadius);
155 pWP->SetShowWaypointRangeRings(src->m_bShowWaypointRangeRings);
156 pWP->SetScaMax(src->scamax);
157 pWP->SetPlannedSpeed(src->m_PlannedSpeed);
158 if (src->m_ETD.IsValid())
159 pWP->SetETD(src->m_ETD);
160 else
161 pWP->SetETD(wxEmptyString);
162 return pWP;
163}
164
165static bool AddPlugInRouteExV3(HostApi121::Route* proute, bool b_permanent) {
166 ::Route* route = new ::Route();
167
168 PlugIn_Waypoint_ExV2* pwaypointex;
169 RoutePoint *pWP, *pWP_src;
170 int ip = 0;
171 wxDateTime plannedDeparture;
172
173 Plugin_WaypointExV2List::compatibility_iterator pwpnode =
174 proute->pWaypointList->GetFirst();
175 while (pwpnode) {
176 pwaypointex = pwpnode->GetData();
177
178 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->m_GUID);
179 if (!pWP) {
180 pWP = CreateNewPoint(pwaypointex, b_permanent);
181 pWP->m_bIsolatedMark = false;
182 }
183
184 route->AddPoint(pWP);
185
186 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
187
188 if (ip > 0)
189 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
190 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
191 route);
192
193 plannedDeparture = pwaypointex->m_CreateTime;
194 ip++;
195 pWP_src = pWP;
196
197 pwpnode = pwpnode->GetNext(); // PlugInWaypoint
198 }
199
200 route->m_PlannedDeparture = plannedDeparture;
201
202 route->m_RouteNameString = proute->m_NameString;
203 route->m_RouteStartString = proute->m_StartString;
204 route->m_RouteEndString = proute->m_EndString;
205 if (!proute->m_GUID.IsEmpty()) {
206 route->m_GUID = proute->m_GUID;
207 }
208 route->m_btemp = (b_permanent == false);
209 route->SetVisible(proute->m_isVisible);
210 route->m_RouteDescription = proute->m_Description;
211
212 route->m_PlannedSpeed = proute->m_PlannedSpeed;
213 route->m_Colour = proute->m_Colour;
214 route->m_style = proute->m_style;
215 route->m_PlannedDeparture = proute->m_PlannedDeparture;
216 route->m_TimeDisplayFormat = proute->m_TimeDisplayFormat;
217
218 pRouteList->push_back(route);
219
220 if (b_permanent) {
221 // pConfig->AddNewRoute(route);
222 NavObj_dB::GetInstance().InsertRoute(route);
223 }
224
225 GuiEvents::GetInstance().on_routes_update.Notify();
226
227 return true;
228}
229
230static bool UpdatePlugInRouteExV3(HostApi121::Route* proute) {
231 bool b_found = false;
232
233 // Find the Route
234 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->m_GUID);
235 if (pRoute) b_found = true;
236
237 if (b_found) {
238 bool b_permanent = !pRoute->m_btemp;
239 g_pRouteMan->DeleteRoute(pRoute);
240
241 b_found = AddPlugInRouteExV3(proute, b_permanent);
242 }
243
244 return b_found;
245}
246
247// translate O route class to PlugIn_Waypoint_Ex
248static void PlugInExFromRoutePoint(PlugIn_Waypoint_Ex* dst,
249 /* const*/ RoutePoint* src) {
250 dst->m_lat = src->m_lat;
251 dst->m_lon = src->m_lon;
252 dst->IconName = src->GetIconName();
253 dst->m_MarkName = src->GetName();
254 dst->m_MarkDescription = src->GetDescription();
255 dst->IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
256 dst->IsVisible = src->IsVisible();
257 dst->m_CreateTime = src->GetCreateTime(); // not const
258 dst->m_GUID = src->m_GUID;
259
260 // Transcribe (clone) the html HyperLink List, if present
261 if (src->m_HyperlinkList) {
262 delete dst->m_HyperlinkList;
263 dst->m_HyperlinkList = nullptr;
264
265 if (src->m_HyperlinkList->size() > 0) {
266 dst->m_HyperlinkList = new Plugin_HyperlinkList;
267 for (Hyperlink* link : *src->m_HyperlinkList) {
269 h->DescrText = link->DescrText;
270 h->Link = link->Link;
271 h->Type = link->LType;
272 dst->m_HyperlinkList->Append(h);
273 }
274 }
275 }
276
277 // Get the range ring info
281
282 // Get other extended info
283 dst->IsNameVisible = src->m_bShowName;
284 dst->scamin = src->GetScaMin();
285 dst->b_useScamin = src->GetUseSca();
286 dst->IsActive = src->m_bIsActive;
287}
288
289static void cloneHyperlinkListEx(RoutePoint* dst,
290 const PlugIn_Waypoint_Ex* src) {
291 // Transcribe (clone) the html HyperLink List, if present
292 if (src->m_HyperlinkList == nullptr) return;
293
294 if (src->m_HyperlinkList->GetCount() > 0) {
295 Plugin_HyperlinkList::compatibility_iterator linknode =
296 src->m_HyperlinkList->GetFirst();
297 while (linknode) {
298 Plugin_Hyperlink* link = linknode->GetData();
299
300 Hyperlink* h = new Hyperlink();
301 h->DescrText = link->DescrText;
302 h->Link = link->Link;
303 h->LType = link->Type;
304
305 dst->m_HyperlinkList->push_back(h);
306
307 linknode = linknode->GetNext();
308 }
309 }
310}
311
312static wxString DropMarkPI(double lat, double lon) {
313 if ((fabs(lat) > 80.0) || (fabs(lon) > 180.)) return "";
314
315 RoutePoint* pWP =
316 new RoutePoint(lat, lon, g_default_wp_icon, wxEmptyString, wxEmptyString);
317 pWP->m_bIsolatedMark = true; // This is an isolated mark
318 pSelect->AddSelectableRoutePoint(lat, lon, pWP);
319 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
320 return pWP->m_GUID;
321}
322
323static wxString RouteCreatePI(int canvas_index, bool start) {
324 if ((size_t)canvas_index < g_canvasArray.GetCount()) {
325 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
326 if (cc) {
327 if (start) {
328 cc->StartRoute();
329 return "0";
330 } else {
331 return cc->FinishRoute();
332 }
333 }
334 }
335 return "-1";
336}
337
338static bool DoMeasurePI(int canvas_index, bool start) {
339 if ((size_t)canvas_index < g_canvasArray.GetCount()) {
340 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
341 if (cc) {
342 if (start) {
343 cc->StartMeasureRoute();
344 return true;
345 } else {
346 cc->CancelMeasureRoute();
347 cc->Refresh(false);
348 return true;
349 }
350 }
351 }
352 return false;
353}
354
355static void EnableDefaultConsole(bool enable) {
356 g_bhide_route_console = !enable;
357}
358
359static wxString NavToHerePI(double lat, double lon) {
360 RoutePoint* pWP_dest =
361 new RoutePoint(lat, lon, g_default_wp_icon, wxEmptyString, wxEmptyString);
362 pSelect->AddSelectableRoutePoint(lat, lon, pWP_dest);
363
364 RoutePoint* pWP_src = new RoutePoint(gLat, gLon, g_default_wp_icon,
365 wxEmptyString, wxEmptyString);
366 pSelect->AddSelectableRoutePoint(gLat, gLon, pWP_src);
367
368 Route* temp_route = new Route();
369 pRouteList->push_back(temp_route);
370
371 temp_route->AddPoint(pWP_src);
372 temp_route->AddPoint(pWP_dest);
373
374 pSelect->AddSelectableRouteSegment(gLat, gLon, lat, lon, pWP_src, pWP_dest,
375 temp_route);
376
377 temp_route->m_RouteNameString = _("Temporary GOTO Route");
378 temp_route->m_RouteStartString = _("Here");
379 temp_route->m_RouteEndString = _("There");
380 temp_route->m_bDeleteOnArrival = true;
381
382 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
383
384 g_pRouteMan->ActivateRoute(temp_route, pWP_dest);
385 return temp_route->m_GUID;
386}
387
388static bool ActivateRoutePI(wxString route_guid, bool activate) {
389 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
390 if (!route) return false;
391
392 if (activate) {
393 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
394 RoutePoint* best_point =
395 g_pRouteMan->FindBestActivatePoint(route, gLat, gLon, gCog, gSog);
396 g_pRouteMan->ActivateRoute(route, best_point);
397 route->m_bRtIsSelected = false;
398 return true;
399 } else {
400 g_pRouteMan->DeactivateRoute();
401 route->m_bRtIsSelected = false;
402 return true;
403 }
404 return false;
405}
406
407static void SetMaxZoomScale(double max_scale) {
408 g_maxzoomin = wxRound(wxMax(max_scale, 100.));
409}
410
411static void EnableDefaultContextMenus(bool enable) {
412 g_bhide_context_menus = !enable;
413}
414
415static void SetMinZoomScale(double min_scale) {
416 for (unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
417 ChartCanvas* cc = g_canvasArray.Item(i);
418 cc->SetAbsoluteMinScale(min_scale);
419 }
420}
421
422static std::shared_ptr<HostApi121::PiPointContext> GetContextAtPoint(
423 int x, int y, int canvas_index) {
424 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
425 if (cc) {
426 return cc->GetCanvasContextAtPoint(x, y);
427 } else {
428 auto rstruct = std::make_shared<HostApi121::PiPointContext>();
429 rstruct->object_type = HostApi121::PiContextObjectType::kObjectUnknown;
430 rstruct->object_ident = "";
431 return rstruct;
432 }
433}
434
435static wxBitmap GetObjectIcon_PlugIn(const wxString& name) {
436 if (pWayPointMan)
437 return *pWayPointMan->GetIconBitmap(name);
438 else
439 return wxNullBitmap;
440}
441
442static bool IsRouteActive(wxString route_guid) {
443 if (g_pRouteMan->GetpActiveRoute())
444 return (route_guid.IsSameAs(g_pRouteMan->GetpActiveRoute()->m_GUID));
445 else
446 return false;
447}
448
449static void SetBoatPosition(double zlat, double zlon) {
450 gLat = zlat;
451 gLon = zlon;
452 GuiEvents::GetInstance().gframe_update_status_bar.Notify();
453}
454
455static void RouteInsertWaypoint(int canvas_index, wxString route_guid,
456 double zlat, double zlon) {
457 ChartCanvas* parent =
458 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
459 if (!parent) return;
460
461 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
462 if (!route) return;
463
464 if (route->m_bIsInLayer) return;
465
466 int seltype = parent->PrepareContextSelections(zlat, zlon);
467 if ((seltype & SELTYPE_ROUTESEGMENT) != SELTYPE_ROUTESEGMENT) return;
468
469 bool rename = false;
470 route->InsertPointAfter(parent->GetFoundRoutepoint(), zlat, zlon, rename);
471
472 pSelect->DeleteAllSelectableRoutePoints(route);
473 pSelect->DeleteAllSelectableRouteSegments(route);
474 pSelect->AddAllSelectableRouteSegments(route);
475 pSelect->AddAllSelectableRoutePoints(route);
476
477 NavObj_dB::GetInstance().UpdateRoute(route);
478}
479
480static void RouteAppendWaypoint(int canvas_index, wxString route_guid) {
481 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
482 if (!route) return;
483
484 ChartCanvas* parent =
485 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
486 if (!parent) return;
487
488 parent->m_pMouseRoute = route;
489 parent->m_routeState = route->GetnPoints() + 1;
490 parent->m_pMouseRoute->m_lastMousePointIndex = route->GetnPoints();
491 parent->m_pMouseRoute->SetHiLite(50);
492
493 auto pLast = route->GetLastPoint();
494
495 parent->m_prev_rlat = pLast->m_lat;
496 parent->m_prev_rlon = pLast->m_lon;
497 parent->m_prev_pMousePoint = pLast;
498
499 parent->m_bAppendingRoute = true;
500}
501
502static void FinishRoute(int canvas_index) {
503 ChartCanvas* parent =
504 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
505 if (!parent) return;
506
507 parent->FinishRoute();
508}
509
510static bool IsRouteBeingCreated(int canvas_index) {
511 ChartCanvas* parent =
512 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
513 if (!parent) return false;
514 return !(parent->m_pMouseRoute == NULL);
515}
516
517static bool AreRouteWaypointNamesVisible(wxString route_guid) {
518 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
519 if (!route) return false;
520 return route->AreWaypointNamesVisible();
521}
522
523static void ShowRouteWaypointNames(wxString route_guid, bool show) {
524 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
525 if (!route) return;
526 route->ShowWaypointNames(show);
527}
528
529static void NavigateToWaypoint(wxString waypoint_guid) {
530 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(waypoint_guid);
531 if (!prp) return;
532
533 RoutePoint* pWP_src = new RoutePoint(gLat, gLon, g_default_wp_icon,
534 wxEmptyString, wxEmptyString);
535 pSelect->AddSelectableRoutePoint(gLat, gLon, pWP_src);
536
537 Route* temp_route = new Route();
538 pRouteList->push_back(temp_route);
539
540 temp_route->AddPoint(pWP_src);
541 temp_route->AddPoint(prp);
542 prp->SetShared(true);
543
544 pSelect->AddSelectableRouteSegment(gLat, gLon, prp->m_lat, prp->m_lon,
545 pWP_src, prp, temp_route);
546
547 wxString name = prp->GetName();
548 if (name.IsEmpty()) name = _("(Unnamed Waypoint)");
549 wxString rteName = _("Go to ");
550 rteName.Append(name);
551 temp_route->m_RouteNameString = rteName;
552 temp_route->m_RouteStartString = _("Here");
553 temp_route->m_RouteEndString = name;
554 temp_route->m_bDeleteOnArrival = true;
555
556 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
557 g_pRouteMan->ActivateRoute(temp_route, prp);
558}
559
560// AIS related
561static bool IsAISTrackVisible(wxString ais_mmsi) {
562 long mmsi = 0;
563 ais_mmsi.ToLong(&mmsi);
564 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
565 if (myptarget)
566 return myptarget->b_show_track;
567 else
568 return false;
569}
570
571static void AISToggleShowTrack(wxString ais_mmsi) {
572 long mmsi = 0;
573 ais_mmsi.ToLong(&mmsi);
574 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
575 if (myptarget) myptarget->ToggleShowTrack();
576}
577
578static void AISToggleShowCPA(wxString ais_mmsi) {
579 long mmsi = 0;
580 ais_mmsi.ToLong(&mmsi);
581 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
582 if (myptarget) myptarget->Toggle_AIS_CPA();
583}
584
585static void ShowAISTargetQueryDialog(int canvas_index, wxString ais_mmsi) {
586 ChartCanvas* parent =
587 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
588 if (!parent) return;
589
590 long mmsi = 0;
591 ais_mmsi.ToLong(&mmsi);
592 ShowAISTargetQueryDialog(parent, mmsi);
593}
594
595static void ShowAISTargetList(int canvas_index) {
596 ChartCanvas* parent =
597 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
598 if (!parent) return;
599 parent->ShowAISTargetList();
600}
601
602static bool IsMeasureActive(int canvas_index) {
603 ChartCanvas* parent =
604 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
605 if (!parent) return false;
606 return parent->m_bMeasure_Active;
607}
608
609static void CancelMeasure(int canvas_index) {
610 ChartCanvas* parent =
611 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
612 if (!parent) return;
613 parent->CancelMeasureRoute();
614}
615
616static void SetDepthUnitVisible(bool bviz) { g_bhide_depth_units = !bviz; }
617
618static void SetOverzoomFlagVisible(bool bviz) { g_bhide_overzoom_flag = !bviz; }
619
620// Extended Chart table management support
621static void AddNoShowDirectory(std::string chart_dir) {
622 ChartDirectoryExcludedVector.push_back(chart_dir);
623}
624
625static void RemoveNoShowDirectory(std::string chart_dir) {
626 auto it = std::find(ChartDirectoryExcludedVector.begin(),
627 ChartDirectoryExcludedVector.end(), chart_dir);
628 if (it != ChartDirectoryExcludedVector.end())
629 ChartDirectoryExcludedVector.erase(it); // Erase the element
630}
631
632static void ClearNoShowVector() { ChartDirectoryExcludedVector.clear(); }
633
634static const std::vector<std::string>& GetNoShowVector() {
636}
637
638static bool SelectChartFamily(int CanvasIndex, ChartFamilyEnumPI Family) {
639 auto window = GetCanvasByIndex(CanvasIndex);
640 auto oCanvas = dynamic_cast<ChartCanvas*>(window);
641 if (oCanvas) {
642 // Chose the "best" chart in the new family
643 // Strategy: Chose a chart from the new family that is the same native scale
644 // as the current refernce chart.
645 // If this chart is not present in the new family. chose the next larger
646 // scale chart.
647 // If there are no larger scale charts available in the new family,
648 // chose the next smaller scale chart.
649 int ref_index = oCanvas->GetQuiltReferenceChartIndex();
650 if (ref_index == -1) return false; // No chart loaded yet
651 const ChartTableEntry& cte_ref = ChartData->GetChartTableEntry(ref_index);
652
653 // No action needed if ref chart is already same as target
654 // unless the ref chart is a basemep
655 if (cte_ref.GetChartFamily() == Family) {
656 if (!cte_ref.IsBasemap()) return false;
657 }
658
659 // Special case for switching to ENC
660 int index_smallest_nobasemap = -1;
661 if (Family == PI_CHART_FAMILY_VECTOR) {
662 // Find the smallest scale chart that is not a basemap
663 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
664 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
665 if ((cte.GetChartFamily() == Family) && !cte.IsBasemap())
666 index_smallest_nobasemap = index;
667 }
668 if (index_smallest_nobasemap < 0) {
669 // There is no ENC except basemap
670 // So choose the smallest scale basemap as reference
671 int index_smallest_basemap = -1;
672 int scale_smallest_basemap = 1;
673 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
674 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
675 if ((cte.GetChartFamily() == Family) && cte.IsBasemap()) {
676 if (cte.GetScale() > scale_smallest_basemap) {
677 scale_smallest_basemap = cte.GetScale();
678 index_smallest_basemap = index;
679 }
680 }
681 }
682 if (index_smallest_basemap >= 0) {
683 const ChartTableEntry& cte =
684 ChartData->GetChartTableEntry(index_smallest_basemap);
685 oCanvas->SelectQuiltRefdbChart(index_smallest_basemap, false);
686 // Induce a recomposition of the quilt
687 oCanvas->ZoomCanvasSimple(.9999);
688 oCanvas->DoCanvasUpdate();
689 oCanvas->ReloadVP();
690 return true;
691 }
692 }
693 }
694
695 int target_scale = cte_ref.GetScale();
696
697 int target_index = -1;
698 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
699 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
700 if (cte.GetChartFamily() != Family) continue;
701 if (cte.IsBasemap()) continue;
702
703 if (cte.GetScale() == target_scale) {
704 target_index = index;
705 break;
706 }
707 }
708
709 if (target_index < 0) {
710 // Find the largest scale chart that is lower than the reference chart
711 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
712 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
713 if (cte.GetChartFamily() != Family) continue;
714 if (cte.IsBasemap()) continue;
715 if (cte.GetScale() <= target_scale) {
716 target_index = index;
717 }
718 }
719 }
720
721 if (target_index < 0) {
722 // Find the largest scale chart that is higher than the reference chart
723 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
724 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
725 if (cte.GetChartFamily() != Family) continue;
726 if (cte.IsBasemap()) continue;
727 if (cte.GetScale() > target_scale) {
728 target_index = index;
729 break;
730 }
731 }
732 }
733
734 if (target_index >= 0) {
735 const ChartTableEntry& cte = ChartData->GetChartTableEntry(target_index);
736 // Found a suitable chart in the new family
737 if (oCanvas->IsChartQuiltableRef(target_index)) {
738 oCanvas->SelectQuiltRefdbChart(target_index, false); // no autoscale
739
740 // Induce a recomposition of the quilt
741 oCanvas->ZoomCanvasSimple(.9999);
742 oCanvas->DoCanvasUpdate();
743 oCanvas->ReloadVP();
744 return true;
745 }
746 }
747 }
748 return false;
749}
750
751static void CenterToAisTarget(wxString ais_mmsi) {
752 long mmsi = 0;
753 if (ais_mmsi.ToLong(&mmsi)) {
754 std::shared_ptr<AisTargetData> pAISTarget = nullptr;
755 if (g_pAIS) pAISTarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
756
757 if (pAISTarget)
758 GuiEvents::GetInstance().on_center_ais_target.Notify(pAISTarget);
759 }
760} // same as AISTargetListDialog::CenterToTarget ( false )
761
762static void AisTargetCreateWpt(wxString ais_mmsi) {
763 long mmsi = 0;
764 if (ais_mmsi.ToLong(&mmsi)) {
765 std::shared_ptr<AisTargetData> pAISTarget = NULL;
766 if (g_pAIS) pAISTarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
767
768 if (pAISTarget) {
769 RoutePoint* pWP =
770 new RoutePoint(pAISTarget->Lat, pAISTarget->Lon, g_default_wp_icon,
771 wxEmptyString, wxEmptyString);
772 pWP->m_bIsolatedMark = true; // This is an isolated mark
773 pSelect->AddSelectableRoutePoint(pAISTarget->Lat, pAISTarget->Lon, pWP);
774 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
775
776 GuiEvents::GetInstance().on_routes_update.Notify();
777 }
778 }
779} // same as AISTargetListDialog::OnTargetCreateWpt
780
781static void AisShowAllTracks(bool show) {
782 if (g_pAIS) {
783 for (const auto& it : g_pAIS->GetTargetList()) {
784 auto pAISTarget = it.second;
785 if (NULL != pAISTarget) {
786 pAISTarget->b_show_track = show;
787
788 // Check for any persistently tracked target, force b_show_track_old
789 std::map<int, Track*>::iterator itt;
790 itt = g_pAIS->m_persistent_tracks.find(pAISTarget->MMSI);
791 if (itt != g_pAIS->m_persistent_tracks.end()) {
792 pAISTarget->b_show_track_old = show;
793 }
794 }
795 }
796 } // same as AISTargetListDialog::OnHideAllTracks /
797 // AISTargetListDialog::OnShowAllTracks
798}
799
800static void AisToggleTrack(wxString ais_mmsi) {
801 long mmsi = 0;
802 if (ais_mmsi.ToLong(&mmsi)) {
803 std::shared_ptr<AisTargetData> pAISTarget = NULL;
804 if (g_pAIS) pAISTarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
805
806 if (pAISTarget) {
807 pAISTarget->b_show_track_old =
808 pAISTarget->b_show_track; // Store current state before toggling
809 pAISTarget->b_show_track =
810 !pAISTarget->b_show_track; // Toggle visibility
811 }
812 }
813}
814
815static int GetContextMenuMask() { return g_canvas_context_menu_disable_mask; }
816
817static void SetContextMenuMask(int mask) {
818 g_canvas_context_menu_disable_mask = mask;
819}
820
821static bool IsAIS_CPAVisible(wxString ais_mmsi) {
822 long mmsi = 0;
823 ais_mmsi.ToLong(&mmsi);
824 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
825 if (myptarget)
826 return myptarget->b_show_AIS_CPA;
827 else
828 return false;
829}
830
831static void SetTrackVisibility(const wxString& track_GUID, bool viz) {
832 for (Track* ptrack : g_TrackList) {
833 if (ptrack->m_GUID == track_GUID) {
834 ptrack->SetVisible(viz);
835 break;
836 }
837 }
838}
839
840// Tide query API for plugins
841
842bool GetNearestTideStation(double lat, double lon,
843 PlugIn_TideStation* station) {
844 if (!ptcmgr || !ptcmgr->IsReady() || !station) return false;
845
846 auto stations = ptcmgr->GetStationsForLL(lat, lon);
847 for (auto& [dist, pIDX] : stations) {
848 if (pIDX->IDX_type == 'T' || pIDX->IDX_type == 't') {
849 // Find the array index for this IDX_entry pointer
850 for (int i = 1; i <= ptcmgr->Get_max_IDX(); i++) {
851#pragma GCC diagnostic push
852#pragma GCC diagnostic ignored "-Wstringop-truncation"
853 if (ptcmgr->GetIDX_entry(i) == pIDX) {
854 station->index = i;
855 strncpy(station->name, pIDX->IDX_station_name, 89);
856 station->name[89] = '\0';
857 station->lat = pIDX->IDX_lat;
858 station->lon = pIDX->IDX_lon;
859 return true;
860 }
861#pragma GCC diagnostic pop
862 }
863 }
864 }
865 return false;
866}
867
868bool GetTideHeight(int stationIndex, time_t time, float* height) {
869 if (!ptcmgr || !ptcmgr->IsReady() || !height) return false;
870 float dir = 0.0f;
871 return ptcmgr->GetTideOrCurrent(time, stationIndex, *height, dir);
872}
873
874bool HostApi121::AddRoute(HostApi121::Route* route, bool permanent) {
875 return ::AddPlugInRouteExV3(route, permanent);
876}
877
879 return ::UpdatePlugInRouteExV3(route);
880}
881
882std::unique_ptr<HostApi121::Route> HostApi121::GetRoute(const wxString& guid) {
883 ::Route* route = g_pRouteMan->FindRouteByGUID(guid);
884 if (!route) return nullptr;
885
886 auto dst_route = std::make_unique<HostApi121::Route>();
887
888 for (RoutePoint* src_wp : *route->pRoutePointList) {
890 PlugInExV2FromRoutePoint(dst_wp, src_wp);
891 dst_route->pWaypointList->Append(dst_wp);
892 }
893 dst_route->m_NameString = route->m_RouteNameString;
894 dst_route->m_StartString = route->m_RouteStartString;
895 dst_route->m_EndString = route->m_RouteEndString;
896 dst_route->m_GUID = route->m_GUID;
897 dst_route->m_isActive = g_pRouteMan->GetpActiveRoute() == route;
898 dst_route->m_isVisible = route->IsVisible();
899 dst_route->m_Description = route->m_RouteDescription;
900 dst_route->m_PlannedSpeed = route->m_PlannedSpeed;
901 dst_route->m_Colour = route->m_Colour;
902 dst_route->m_style = route->m_style;
903 dst_route->m_PlannedDeparture = route->m_PlannedDeparture;
904 dst_route->m_TimeDisplayFormat = route->m_TimeDisplayFormat;
905
906 return dst_route;
907}
908
909wxString HostApi121::DropMarkPI(double lat, double lon) {
910 return ::DropMarkPI(lat, lon);
911}
912
913wxString HostApi121::RouteCreatePI(int canvas_index, bool start) {
914 return ::RouteCreatePI(canvas_index, start);
915}
916
917bool HostApi121::DoMeasurePI(int canvas_index, bool start) {
918 return ::DoMeasurePI(canvas_index, start);
919}
920
921wxString HostApi121::NavToHerePI(double lat, double lon) {
922 return ::NavToHerePI(lat, lon);
923}
924
925bool HostApi121::ActivateRoutePI(wxString route_guid, bool activate) {
926 return ::ActivateRoutePI(route_guid, activate);
927}
928
929void HostApi121::EnableDefaultConsole(bool enable) {
930 ::EnableDefaultConsole(enable);
931}
932
933void HostApi121::EnableDefaultContextMenus(bool enable) {
934 ::EnableDefaultContextMenus(enable);
935}
936
937void HostApi121::SetMinZoomScale(double min_scale) {
938 ::SetMinZoomScale(min_scale);
939}
940
941void HostApi121::SetMaxZoomScale(double max_scale) {
942 ::SetMaxZoomScale(max_scale);
943}
944
945std::shared_ptr<HostApi121::PiPointContext> HostApi121::GetContextAtPoint(
946 int x, int y, int canvas_index) {
947 return ::GetContextAtPoint(x, y, canvas_index);
948}
949
950wxBitmap HostApi121::GetObjectIcon_PlugIn(const wxString& name) {
951 return ::GetObjectIcon_PlugIn(name);
952}
953
954bool HostApi121::IsRouteActive(wxString route_guid) {
955 return ::IsRouteActive(route_guid);
956}
957
958void HostApi121::SetBoatPosition(double zlat, double zlon) {
959 ::SetBoatPosition(zlat, zlon);
960}
961
962void HostApi121::RouteInsertWaypoint(int canvas_index, wxString route_guid,
963 double zlat, double zlon) {
964 ::RouteInsertWaypoint(canvas_index, route_guid, zlat, zlon);
965}
966
967void HostApi121::RouteAppendWaypoint(int canvas_index, wxString route_guid) {
968 ::RouteAppendWaypoint(canvas_index, route_guid);
969}
970
971void HostApi121::FinishRoute(int canvas_index) { ::FinishRoute(canvas_index); }
972
973bool HostApi121::IsRouteBeingCreated(int canvas_index) {
974 return ::IsRouteBeingCreated(canvas_index);
975}
976
977bool HostApi121::AreRouteWaypointNamesVisible(wxString route_guid) {
978 return ::AreRouteWaypointNamesVisible(route_guid);
979}
980
981void HostApi121::ShowRouteWaypointNames(wxString route_guid, bool show) {
982 ::ShowRouteWaypointNames(route_guid, show);
983}
984
985void HostApi121::NavigateToWaypoint(wxString waypoint_guid) {
986 ::NavigateToWaypoint(waypoint_guid);
987}
988
989bool HostApi121::IsAISTrackVisible(const wxString& ais_mmsi) const {
990 return ::IsAISTrackVisible(ais_mmsi);
991}
992
993void HostApi121::AISToggleShowTrack(const wxString& ais_mmsi) {
994 ::AISToggleShowTrack(ais_mmsi);
995}
996
997bool HostApi121::IsAIS_CPAVisible(const wxString& ais_mmsi) const {
998 return ::IsAIS_CPAVisible(ais_mmsi);
999}
1000
1001void HostApi121::AISToggleShowCPA(const wxString& ais_mmsi) {
1002 ::AISToggleShowCPA(ais_mmsi);
1003}
1004
1005void HostApi121::ShowAISTargetQueryDialog(int canvas_index,
1006 const wxString& ais_mmsi) {
1007 ::ShowAISTargetQueryDialog(canvas_index, ais_mmsi);
1008}
1009
1010void HostApi121::ShowAISTargetList(int canvas_index) {
1011 ::ShowAISTargetList(canvas_index);
1012}
1013
1014bool HostApi121::IsMeasureActive(int canvas_index) {
1015 return ::IsMeasureActive(canvas_index);
1016}
1017
1018void HostApi121::CancelMeasure(int canvas_index) {
1019 ::CancelMeasure(canvas_index);
1020}
1021
1022void HostApi121::SetDepthUnitVisible(bool bviz) { ::SetDepthUnitVisible(bviz); }
1023
1024void HostApi121::SetOverzoomFlagVisible(bool viz) {
1025 ::SetOverzoomFlagVisible(viz);
1026}
1027
1028void HostApi121::AddNoShowDirectory(std::string chart_dir) {
1029 ::AddNoShowDirectory(chart_dir);
1030}
1031
1032void HostApi121::RemoveNoShowDirectory(std::string chart_dir) {
1033 ::RemoveNoShowDirectory(chart_dir);
1034}
1035
1036void HostApi121::ClearNoShowVector() { ::ClearNoShowVector(); }
1037
1038const std::vector<std::string>& HostApi121::GetNoShowVector() {
1039 return ::GetNoShowVector();
1040}
1041
1042bool HostApi121::SelectChartFamily(int CanvasIndex, ChartFamilyEnumPI Family) {
1043 return ::SelectChartFamily(CanvasIndex, Family);
1044};
1045
1046// Enhanced AIS Target List support
1047
1048void HostApi121::CenterToAisTarget(wxString ais_mmsi) {
1049 ::CenterToAisTarget(ais_mmsi);
1050}
1051
1052void HostApi121::AisTargetCreateWpt(wxString ais_mmsi) {
1053 ::AisTargetCreateWpt(ais_mmsi);
1054}
1055
1056void HostApi121::AisShowAllTracks(bool show) { ::AisShowAllTracks(show); }
1057
1058void HostApi121::AisToggleTrack(wxString ais_mmsi) {
1059 ::AisToggleTrack(ais_mmsi);
1060}
1061
1062// Context menu enable/disable, by object type
1063int HostApi121::GetContextMenuMask() { return ::GetContextMenuMask(); }
1064
1065void HostApi121::SetContextMenuMask(int mask) { ::SetContextMenuMask(mask); }
1066
1067void HostApi121::SetTrackVisibiiity(const wxString& track_GUID, bool viz) {
1068 ::SetTrackVisibility(track_GUID, viz);
1069}
1070
1071bool HostApi121::GetNearestTideStation(double lat, double lon,
1072 PlugIn_TideStation* station) {
1073 return ::GetNearestTideStation(lat, lon, station);
1074}
1075
1076bool HostApi121::GetTideHeight(int stationIndex, time_t time, float* height) {
1077 return ::GetTideHeight(stationIndex, time, height);
1078}
AisDecoder * g_pAIS
Global instance.
Class AisDecoder and helpers.
AIS target definitions.
std::vector< std::string > ChartDirectoryExcludedVector
Global instance.
Definition chartdb.cpp:73
ChartDB * ChartData
Global instance.
Definition chartdb.cpp:71
arrayofCanvasPtr g_canvasArray
Global instance.
Definition chcanv.cpp:173
Generic Chart canvas base.
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:174
int PrepareContextSelections(double lat, double lon)
Definition chcanv.cpp:8098
virtual bool AddRoute(Route *route, bool permanent=true)
Add route to database, updated version of AddPlugInRouteExV2.
Definition api_121.cpp:874
virtual std::unique_ptr< HostApi121::Route > GetRoute(const wxString &guid)
Retrieve route from database.
Definition api_121.cpp:882
virtual bool UpdateRoute(Route *route)
Update database route, updated version of UpdatePlugInRouteExV2.
Definition api_121.cpp:878
bool m_isVisible
True if route should be displayed.
Plugin_WaypointExV2List * pWaypointList
List of waypoints making up this route in order.
wxString m_StartString
Description of route start point.
wxString m_Description
Optional route description/notes.
wxString m_NameString
User-visible name of the route.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of route end point.
wxDateTime m_ETD
Estimated departure time in UTC, or wxInvalidDateTime if not set.
wxString m_MarkDescription
Optional description text.
wxString m_GUID
Globally unique identifier.
wxString m_TideStation
Tide Station Identifier.
wxDateTime m_CreateTime
Creation timestamp in UTC.
bool m_bShowWaypointRangeRings
True to show range rings on chart.
wxString IconDescription
User-friendly description of icon.
double m_lat
Latitude in decimal degrees.
wxColour RangeRingColor
Color to draw range rings.
bool IsActive
Active state (e.g. destination).
Plugin_HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
double scamin
Minimum display scale (1:X) for waypoint visibility.
double scamax
Maximum display scale (1:X) for waypoint visibility.
bool b_useScamin
True to enable scale-dependent visibility.
wxString IconName
Name of icon to use for waypoint symbol.
bool IsNameVisible
True to show waypoint name on chart.
double m_PlannedSpeed
Planned speed for next leg (knots).
double RangeRingSpace
Distance between range rings in preferred units.
double m_lon
Longitude in decimal degrees.
double m_WaypointArrivalRadius
Arrival radius in nautical miles.
int RangeRingSpaceUnits
Units for range ring spacing - 0:nm, 1:km.
wxString m_MarkName
Display name of waypoint.
bool IsVisible
Visibility state on chart.
int nrange_rings
Number of range rings to display around waypoint.
Extended waypoint class with additional navigation features.
wxDateTime m_CreateTime
Creation timestamp in UTC.
wxColour RangeRingColor
Color to draw range rings.
int nrange_rings
Number of range rings to display around waypoint.
wxString IconDescription
User-friendly description of icon.
bool b_useScamin
True to enable scale-dependent visibility.
double RangeRingSpace
Distance between range rings in preferred units.
Plugin_HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
wxString m_MarkName
Display name of waypoint.
wxString m_GUID
Globally unique identifier.
double m_lon
Longitude in decimal degrees.
wxString IconName
Name of icon to use for waypoint symbol.
double scamin
Minimum display scale (1:X) for waypoint visibility.
bool IsNameVisible
True to show waypoint name on chart.
double m_lat
Latitude in decimal degrees.
wxString m_MarkDescription
Optional description text.
bool IsActive
Active state (e.g. destination).
bool IsVisible
Visibility state on chart.
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
wxColour m_wxcWaypointRangeRingsColour
Color for the range rings display.
wxString m_MarkDescription
Description text for the waypoint.
int m_iWaypointRangeRingsNumber
Number of range rings to display around the waypoint.
void SetCreateTime(wxDateTime dt)
Sets the create time of this RoutePoint in UTC.
wxString m_GUID
Globally Unique Identifier for the waypoint.
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.
bool m_bShowName
Flag indicating if the waypoint name should be shown.
double GetPlannedSpeed()
Return the planned speed associated with this waypoint.
bool m_btemp
Flag indicating if this is a temporary waypoint.
int m_iWaypointRangeRingsStepUnits
Units for the range rings step (0=nm, 1=km).
wxDateTime GetCreateTime(void)
Returns the Create Time of this RoutePoint in UTC.
float m_fWaypointRangeRingsStep
Distance between consecutive range rings.
wxString m_TideStation
Associated tide station identifier.
void SetETD(const wxDateTime &etd)
Sets the Estimated Time of Departure for this waypoint, in UTC.
Represents a navigational route in the navigation system.
Definition route.h:99
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
wxString m_RouteDescription
Additional descriptive information about the route.
Definition route.h:262
RoutePointList * pRoutePointList
Ordered list of waypoints (RoutePoints) that make up this route.
Definition route.h:336
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
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
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
int m_lastMousePointIndex
Index of the most recently interacted with route point.
Definition route.h:298
Represents a track, which is a series of connected track points.
Definition track.h:117
Misc GUI event vars, a singleton.
Miscellaneous globals primarely used by gui layer, not persisted in configuration file.
MySQL based storage for routes, tracks, etc.
User notifications manager.
PlugIn Object Definition/API.
ChartFamilyEnumPI
Enumeration of chart families (broad categories).
@ PI_CHART_FAMILY_VECTOR
Vector chart formats (S-57, CM93, etc.).
wxWindow * GetCanvasByIndex(int canvasIndex)
Gets chart canvas window by index.
double gLat
Vessel's current latitude in decimal degrees.
Definition own_ship.cpp:26
double gCog
Course over ground in degrees (0-359.99).
Definition own_ship.cpp:28
double gSog
Speed over ground in knots.
Definition own_ship.cpp:29
double gLon
Vessel's current longitude in decimal degrees.
Definition own_ship.cpp:27
Position, course, speed, etc.
Route abstraction.
Routeman * g_pRouteMan
Global instance.
Definition routeman.cpp:60
RouteList * pRouteList
Global instance.
Definition routeman.cpp:66
Select * pSelect
Global instance.
Definition select.cpp:36
Represents an entry in the chart table, containing information about a single chart.
Definition chartdbs.h:190
TCMgr * ptcmgr
Global instance.
Definition tcmgr.cpp:42
Tide and Current Manager @TODO Add original author copyright.
std::vector< Track * > g_TrackList
Global instance.
Definition track.cpp:97
Recorded track abstraction.