30#include <wx/dcmemory.h>
32#include <wx/glcanvas.h>
33#include <wx/notebook.h>
37#include "model/ais_decoder.h"
39#include "model/idents.h"
40#include "model/multiplexer.h"
42#include "model/own_ship.h"
44#include "model/route.h"
45#include "model/track.h"
52#include "glChartCanvas.h"
56#include "OCPN_AUIManager.h"
57#include "ocpn_frame.h"
58#include "OCPNPlatform.h"
62#include "pluginmanager.h"
63#include "routemanagerdialog.h"
64#include "routeman_gui.h"
66#include "SoundFactory.h"
68#include "SystemCmdSound.h"
70#include "waypointman_gui.h"
71#include "shapefile_basemap.h"
77#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
78extern wxLocale* plocale_def_lang;
87extern bool g_bShowChartBar;
91extern RouteList* pRouteList;
92extern std::vector<Track*> g_TrackList;
94extern s52plib* ps52plib;
95extern wxString ChartListFileName;
97extern ColorScheme global_color_scheme;
98extern wxArrayString g_locale_catalog_array;
99extern int g_GUIScaleFactor;
100extern int g_ChartScaleFactor;
104extern int g_chart_zoom_modifier_raster;
105extern int g_chart_zoom_modifier_vector;
107extern bool g_bopengl;
109extern ChartGroupArray* g_pGroupArray;
113extern unsigned int g_canvasConfig;
115extern wxString g_CmdSoundString;
117unsigned int gs_plib_flags;
120extern bool g_bquiting;
121extern bool g_disable_main_toolbar;
122extern bool g_btenhertz;
123extern bool g_CanvasHideNotificationIcon;
125WX_DEFINE_ARRAY_PTR(
ChartCanvas*, arrayofCanvasPtr);
126extern arrayofCanvasPtr g_canvasArray;
128void NotifySetupOptionsPlugin(
const PlugInData* pic);
143 wxItemKind kind, wxString shortHelp, wxString longHelp,
144 wxObject* clientData,
int position,
int tool_sel,
147 return s_ppim->AddToolbarTool(label, bitmap, bmpRollover, kind, shortHelp,
148 longHelp, clientData, position, tool_sel,
155 if (s_ppim) s_ppim->RemoveToolbarTool(tool_id);
159 if (s_ppim) s_ppim->SetToolbarToolViz(item, viz);
163 if (s_ppim) s_ppim->SetToolbarItemState(item, toggle);
167 if (s_ppim) s_ppim->SetToolbarItemBitmaps(item, bitmap, bmpRollover);
171 wxString SVGfileRollover, wxString SVGfileToggled,
172 wxItemKind kind, wxString shortHelp, wxString longHelp,
173 wxObject* clientData,
int position,
int tool_sel,
176 return s_ppim->AddToolbarTool(label, SVGfile, SVGfileRollover,
177 SVGfileToggled, kind, shortHelp, longHelp,
178 clientData, position, tool_sel, pplugin);
184 wxString SVGfileRollover,
185 wxString SVGfileToggled) {
187 s_ppim->SetToolbarItemBitmaps(item, SVGfile, SVGfileRollover,
195 return s_ppim->AddCanvasContextMenuItem(pitem, pplugin, name);
201 if (s_ppim) s_ppim->SetCanvasContextMenuItemViz(item, viz, name);
205 if (s_ppim) s_ppim->SetCanvasContextMenuItemGrey(item, grey, name);
209 if (s_ppim) s_ppim->RemoveCanvasContextMenuItem(item, name);
230 return reinterpret_cast<wxFileConfig*
>(
237 wxWindow* pret = NULL;
239 MyFrame* pFrame = s_ppim->GetParentFrame();
240 pret = (wxWindow*)pFrame->GetPrimaryCanvas();
246 if (win) win->Refresh(
true);
306 return FontMgr::Get().
GetFont(TextElement, default_size);
309wxFont* GetOCPNScaledFont_PlugIn(wxString TextElement,
int default_size) {
314 return g_Platform->GetToolbarScaleFactor(GUIScaleFactor);
318 return g_Platform->GetToolbarScaleFactor(g_GUIScaleFactor);
322 return g_Platform->GetChartScaleFactorExp(g_ChartScaleFactor);
330 return FontMgr::Get().
AddAuxKey(TextElement);
335 return g_StyleManager->GetCurrentStyle()->name;
341 unsigned int height) {
342 wxBitmap bmp = LoadSVG(filename, width, height);
350 SVGDocumentPixelSize(filename, w, h);
351 if (w == 0 || h == 0) {
358 return LoadSVG(filename, w, h);
369 return g_Platform->GetSharedDataDirPtr();
373 if (!g_pAIS)
return NULL;
375 ArrayOfPlugIn_AIS_Targets* pret =
new ArrayOfPlugIn_AIS_Targets;
378 for (
const auto& it : g_pAIS->GetTargetList()) {
387 td.n_alarm_state = AIS_ALARM_SET;
397 SendMessageToAllPlugins(message_id, message_body);
405 Nevent.SetID(message_id);
406 Nevent.SetJSONText(message_body);
407 gFrame->GetEventHandler()->AddPendingEvent(Nevent);
413 gFrame->JumpToPosition(gFrame->GetFocusCanvas(), lat, lon,
scale);
418#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
420 if (plocale_def_lang) {
422 g_locale_catalog_array.Add(catalog);
424 return plocale_def_lang->AddCatalog(catalog);
434 std::string full_sentence = buf.ToStdString();
436 if ((full_sentence[0] ==
'$') || (full_sentence[0] ==
'!')) {
437 std::string identifier;
439 identifier = full_sentence.substr(1, 5);
443 auto address = std::make_shared<NavAddr0183>(
"virtual");
445 std::make_shared<const Nmea0183Msg>(identifier, full_sentence, address);
446 auto msg_all = std::make_shared<const Nmea0183Msg>(*msg,
"ALL");
448 auto& msgbus = NavMsgBus::GetInstance();
450 msgbus.Notify(std::move(msg));
451 msgbus.Notify(std::move(msg_all));
457 wxXmlDocument doc = ChartData->GetXMLDescription(dbIndex, b_getGeom);
463 bool b_ProgressDialog) {
465 ArrayOfCDI ChartDirArray;
466 for (
unsigned int i = 0; i < dir_array.GetCount(); i++) {
467 wxString dirname = dir_array[i];
469 cdi.fullpath = dirname;
470 cdi.magic_number = _T(
"");
471 ChartDirArray.Add(cdi);
473 bool b_ret = gFrame->UpdateChartDatabaseInplace(ChartDirArray, b_force_update,
475 ChartData->GetDBFileName());
476 gFrame->ChartsRefresh();
481 return ChartData->GetChartDirArrayString();
486 wxFileName fn(full_path);
487 wxString fdir = fn.GetPath();
491 bret = ChartData->AddSingleChart(full_path);
495 pConfig->UpdateChartDirs(ChartData->GetChartDirArray());
496 ChartData->SaveBinary(ChartListFileName);
499 ArrayOfCDI XnewChartDirArray;
500 pConfig->LoadChartDirArray(XnewChartDirArray);
503 ChartData->
LoadBinary(ChartListFileName, XnewChartDirArray);
506 if (g_pGroupArray) ChartData->ApplyGroupArray(g_pGroupArray);
508 if (g_options && g_options->IsShown())
509 g_options->UpdateDisplayedChartDirList(ChartData->GetChartDirArray());
511 if (b_RefreshCanvas || !gFrame->GetPrimaryCanvas()->GetQuiltMode()) {
512 gFrame->ChartsRefresh();
522 bret = ChartData->RemoveSingleChart(full_path);
525 pConfig->UpdateChartDirs(ChartData->GetChartDirArray());
526 ChartData->SaveBinary(ChartListFileName);
529 ArrayOfCDI XnewChartDirArray;
530 pConfig->LoadChartDirArray(XnewChartDirArray);
533 ChartData->
LoadBinary(ChartListFileName, XnewChartDirArray);
536 if (g_pGroupArray) ChartData->ApplyGroupArray(g_pGroupArray);
538 if (g_options && g_options->IsShown())
539 g_options->UpdateDisplayedChartDirList(ChartData->GetChartDirArray());
541 gFrame->ChartsRefresh();
551 if (!g_pOptions)
return NULL;
556 parentid = g_pOptions->m_pageDisplay;
559 parentid = g_pOptions->m_pageConnections;
562 parentid = g_pOptions->m_pageCharts;
565 parentid = g_pOptions->m_pageShips;
568 parentid = g_pOptions->m_pageUI;
571 parentid = g_pOptions->m_pagePlugins;
575 _T(
"Error in PluginManager::AddOptionsPage: Unknown parent"));
580 return g_pOptions->AddPage(parentid, title);
584 if (!g_pOptions)
return false;
585 return g_pOptions->DeletePluginPage(page);
589 wxString* accumulator) {
590 if (!pos)
return false;
593 AisError nerr = AIS_GENERIC_ERROR;
594 if (g_pAIS) nerr = g_pAIS->DecodeSingleVDO(str, &gpd, accumulator);
595 if (nerr == AIS_NoError) {
616 if (g_bShowChartBar) {
618 if (cc && cc->GetPiano()) {
619 val = cc->GetPiano()->GetHeight();
625bool GetRoutepointGPX(
RoutePoint* pRoutePoint,
char* buffer,
626 unsigned int buffer_length) {
630 pgpx->AddGPXWaypoint(pRoutePoint);
631 wxString gpxfilename = wxFileName::CreateTempFileName(wxT(
"gpx"));
632 pgpx->SaveFile(gpxfilename);
635 wxFFile gpxfile(gpxfilename);
637 if (gpxfile.ReadAll(&s)) {
638 if (s.Length() < buffer_length) {
639 strncpy(buffer, (
const char*)s.mb_str(wxConvUTF8), buffer_length - 1);
645 ::wxRemoveFile(gpxfilename);
651 if (g_pRouteMan->IsAnyRouteActive())
652 return GetRoutepointGPX(g_pRouteMan->GetpActivePoint(), buffer,
659 double dist,
double* dlat,
661 PositionBearingDistanceMercator(lat, lon, brg, dist, dlat, dlon);
665 double lon1,
double* brg,
double* dist) {
666 DistanceBearingMercator(lat0, lon0, lat1, lon1, brg, dist);
671 return DistGreatCircle(slat, slon, dlat, dlon);
674void toTM_Plugin(
float lat,
float lon,
float lat0,
float lon0,
double* x,
676 toTM(lat, lon, lat0, lon0, x, y);
679void fromTM_Plugin(
double x,
double y,
double lat0,
double lon0,
double* lat,
681 fromTM(x, y, lat0, lon0, lat, lon);
684void toSM_Plugin(
double lat,
double lon,
double lat0,
double lon0,
double* x,
686 toSM(lat, lon, lat0, lon0, x, y);
689void fromSM_Plugin(
double x,
double y,
double lat0,
double lon0,
double* lat,
691 fromSM(x, y, lat0, lon0, lat, lon);
695 double* x,
double* y) {
696 toSM_ECC(lat, lon, lat0, lon0, x, y);
700 double* lat,
double* lon) {
701 fromSM_ECC(x, y, lat0, lon0, lat, lon);
705 return toUsrDistance(nm_distance,
unit);
709 return fromUsrDistance(usr_distance,
unit);
713 return toUsrSpeed(kts_speed,
unit);
717 return toUsrWindSpeed(kts_speed,
unit);
721 return fromUsrSpeed(usr_speed,
unit);
725 return fromUsrWindSpeed(usr_wspeed,
unit);
729 return toUsrTemp(cel_temp,
unit);
733 return fromUsrTemp(usr_temp,
unit);
737 return getUsrDistanceUnit(
unit);
743 return getUsrWindSpeedUnit(
unit);
752 return toUsrDepth(m_depth,
unit);
756 return fromUsrDepth(usr_depth,
unit);
770 static bool loaded =
false;
772 gshhsCrossesLandInit();
775 return gshhsCrossesLand(lat1, lon1, lat2, lon2);
791 const wxString& icon_ident,
792 const wxString& wp_name,
793 const wxString& GUID) {
794 wxDateTime now = wxDateTime::Now();
805PlugIn_Waypoint::~PlugIn_Waypoint() {}
808PlugIn_Route::PlugIn_Route(
void) {
pWaypointList =
new Plugin_WaypointList; }
810PlugIn_Route::~PlugIn_Route(
void) {
818PlugIn_Track::PlugIn_Track(
void) {
pWaypointList =
new Plugin_WaypointList; }
820PlugIn_Track::~PlugIn_Track(
void) {
830 wxString description) {
831 wxImage image = pimage->ConvertToImage();
832 WayPointmanGui(*pWayPointMan).ProcessIcon(image, key, description);
841 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
847 h->Link = link->
Link;
848 h->LType = link->
Type;
850 dst->m_HyperlinkList->Append(h);
852 linknode = linknode->GetNext();
862 bool b_unique =
true;
863 wxRoutePointListNode* prpnode = pWayPointMan->GetWaypointList()->GetFirst();
867 if (prp->m_GUID == pwaypoint->
m_GUID) {
871 prpnode = prpnode->GetNext();
874 if (!b_unique)
return false;
882 cloneHyperlinkList(pWP, pwaypoint);
889 wxDateTime dtnow(wxDateTime::Now());
890 pWP->SetCreateTime(dtnow);
893 pWP->m_btemp = (b_permanent ==
false);
895 pSelect->AddSelectableRoutePoint(pwaypoint->
m_lat, pwaypoint->
m_lon, pWP);
896 if (b_permanent) pConfig->AddNewWayPoint(pWP, -1);
898 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
899 pRouteManagerDialog->UpdateWptListCtrl();
906 bool b_found =
false;
907 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
909 if (prp) b_found =
true;
912 pWayPointMan->DestroyWaypoint(prp);
913 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
914 pRouteManagerDialog->UpdateWptListCtrl();
922 bool b_found =
false;
925 if (prp) b_found =
true;
928 double lat_save = prp->m_lat;
929 double lon_save = prp->m_lon;
931 prp->m_lat = pwaypoint->
m_lat;
932 prp->m_lon = pwaypoint->
m_lon;
943 prp->m_HyperlinkList->Clear();
945 wxPlugin_HyperlinkListNode* linknode =
952 h->Link = link->
Link;
953 h->LType = link->
Type;
955 prp->m_HyperlinkList->Append(h);
957 linknode = linknode->GetNext();
962 if (prp) prp->ReLoadIcon();
964 auto canvas = gFrame->GetPrimaryCanvas();
965 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
966 canvas->GetScaleValue());
968 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
970 pFind->m_slat = pwaypoint->
m_lat;
971 pFind->m_slon = pwaypoint->
m_lon;
974 if (!prp->m_btemp) pConfig->UpdateWayPoint(prp);
976 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
977 pRouteManagerDialog->UpdateWptListCtrl();
986 dst->
m_lat = src->m_lat;
987 dst->
m_lon = src->m_lon;
993 dst->
m_GUID = src->m_GUID;
996 if (src->m_HyperlinkList ==
nullptr)
return;
1001 if (src->m_HyperlinkList->GetCount() > 0) {
1004 wxHyperlinkListNode* linknode = src->m_HyperlinkList->GetFirst();
1010 h->
Link = link->Link;
1011 h->
Type = link->LType;
1015 linknode = linknode->GetNext();
1022 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
1024 if (!prp)
return false;
1026 PlugInFromRoutePoint(pwaypoint, prp);
1032 wxArrayString result;
1033 const RoutePointList* list = pWayPointMan->GetWaypointList();
1035 wxRoutePointListNode* prpnode = list->GetFirst();
1038 result.Add(prp->m_GUID);
1040 prpnode = prpnode->GetNext();
1047 wxArrayString result;
1048 RouteList* list = pRouteList;
1050 wxRouteListNode* prpnode = list->GetFirst();
1052 Route* proute = prpnode->GetData();
1053 result.Add(proute->
m_GUID);
1055 prpnode = prpnode->GetNext();
1062 wxArrayString result;
1063 for (
Track* ptrack : g_TrackList) {
1064 result.Add(ptrack->m_GUID);
1071 wxArrayString result;
1072 const RoutePointList* list = pWayPointMan->GetWaypointList();
1074 wxRoutePointListNode* prpnode = list->GetFirst();
1079 result.Add(prp->m_GUID);
1082 if (!prp->m_bIsInLayer) result.Add(prp->m_GUID);
1085 if (prp->m_bIsInLayer) result.Add(prp->m_GUID);
1089 prpnode = prpnode->GetNext();
1096 wxArrayString result;
1097 RouteList* list = pRouteList;
1099 wxRouteListNode* prpnode = list->GetFirst();
1101 Route* proute = prpnode->GetData();
1104 result.Add(proute->
m_GUID);
1114 prpnode = prpnode->GetNext();
1121 wxArrayString result;
1122 for (
Track* ptrack : g_TrackList) {
1125 result.Add(ptrack->m_GUID);
1128 if (!ptrack->m_bIsInLayer) result.Add(ptrack->m_GUID);
1131 if (ptrack->m_bIsInLayer) result.Add(ptrack->m_GUID);
1140 wxArrayString result;
1142 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1143 wxString* ps = pWayPointMan->GetIconKey(i);
1155 wxDateTime plannedDeparture;
1157 wxPlugin_WaypointListNode* pwpnode = proute->
pWaypointList->GetFirst();
1159 pwp = pwpnode->GetData();
1165 cloneHyperlinkList(pWP, pwp);
1167 pWP->m_bShowName =
false;
1170 route->AddPoint(pWP);
1172 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
1175 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
1176 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
1183 pwpnode = pwpnode->GetNext();
1191 if (!proute->
m_GUID.IsEmpty()) {
1194 route->
m_btemp = (b_permanent ==
false);
1196 pRouteList->Append(route);
1198 if (b_permanent) pConfig->AddNewRoute(route);
1200 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1201 pRouteManagerDialog->UpdateRouteListCtrl();
1207 bool b_found =
false;
1210 Route* pRoute = g_pRouteMan->FindRouteByGUID(GUID);
1212 g_pRouteMan->
DeleteRoute(pRoute, NavObjectChanges::getInstance());
1219 bool b_found =
false;
1222 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->
m_GUID);
1223 if (pRoute) b_found =
true;
1226 bool b_permanent = (pRoute->
m_btemp ==
false);
1227 g_pRouteMan->
DeleteRoute(pRoute, NavObjectChanges::getInstance());
1242 wxPlugin_WaypointListNode* pwpnode = ptrack->
pWaypointList->GetFirst();
1244 pwp = pwpnode->GetData();
1249 track->AddPoint(pWP);
1252 pSelect->AddSelectableTrackSegment(pWP_src->m_lat, pWP_src->m_lon,
1253 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
1258 pwpnode = pwpnode->GetNext();
1264 track->m_GUID = ptrack->
m_GUID;
1265 track->m_btemp = (b_permanent ==
false);
1267 g_TrackList.push_back(track);
1269 if (b_permanent) pConfig->AddNewTrack(track);
1271 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1272 pRouteManagerDialog->UpdateTrkListCtrl();
1278 bool b_found =
false;
1281 Track* pTrack = g_pRouteMan->FindTrackByGUID(GUID);
1287 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1288 pRouteManagerDialog->UpdateTrkListCtrl();
1294 bool b_found =
false;
1297 Track* pTrack = g_pRouteMan->FindTrackByGUID(ptrack->
m_GUID);
1298 if (pTrack) b_found =
true;
1301 bool b_permanent = (pTrack->m_btemp ==
false);
1315 return glChartCanvas::HasNormalizedViewPort(ocpn_vp);
1341 glChartCanvas::NormalizedViewPort(ocpn_vp, lat, lon);
1360 pret->
MMSI = ptarget->MMSI;
1361 pret->
Class = ptarget->Class;
1363 pret->
SOG = ptarget->SOG;
1364 pret->
COG = ptarget->COG;
1365 pret->
HDG = ptarget->HDG;
1366 pret->
Lon = ptarget->Lon;
1367 pret->
Lat = ptarget->Lat;
1368 pret->
ROTAIS = ptarget->ROTAIS;
1369 pret->
ShipType = ptarget->ShipType;
1370 pret->
IMO = ptarget->IMO;
1372 pret->
Range_NM = ptarget->Range_NM;
1373 pret->
Brg = ptarget->Brg;
1377 pret->
TCPA = ptarget->TCPA;
1378 pret->
CPA = ptarget->CPA;
1382 memcpy(pret->CallSign, ptarget->CallSign,
sizeof(ptarget->CallSign) - 1);
1383 memcpy(pret->ShipName, ptarget->ShipName,
sizeof(ptarget->ShipName) - 1);
1402 gFrame->GetPrimaryCanvas()->DoRotateCanvas(rotation);
1408 gFrame->GetPrimaryCanvas()->DoTiltCanvas(tilt);
1412 gFrame->GetPrimaryCanvas()->SetVPProjection(projection);
1415OcpnSound* g_PluginSound = SoundFactory();
1416static void onPlugInPlaySoundExFinished(
void* ptr) {}
1420 bool ok = g_PluginSound->Load(sound_file, deviceIndex);
1422 wxLogWarning(
"Cannot load sound file: %s", sound_file);
1425 auto cmd_sound =
dynamic_cast<SystemCmdSound*
>(g_PluginSound);
1426 if (cmd_sound) cmd_sound->SetCmd(g_CmdSoundString.mb_str(wxConvUTF8));
1428 g_PluginSound->SetFinishedCallback(onPlugInPlaySoundExFinished, NULL);
1429 ok = g_PluginSound->Play();
1431 wxLogWarning(
"Cannot play sound file: %s", sound_file);
1437 return gFrame->GetPrimaryCanvas()->CheckEdgePan(x, y, dragging, margin,
1443 return style->GetIcon(name);
1447 gFrame->GetPrimaryCanvas()->pPlugIn_Cursor = pCursor;
1452 g_options->AddChartDir(path);
1458 g_options->pScanCheckBox->SetValue(
true);
1459 g_options->pUpdateCheckBox->SetValue(
true);
1465 g_options->pUpdateCheckBox->SetValue(
true);
1472 wxString Title, wxString initDir) {
1473 return g_Platform->DoDirSelectorDialog(parent, file_spec, Title, initDir);
1477 wxString Title, wxString initDir,
1478 wxString suggestedName, wxString wildcard) {
1479 return g_Platform->DoFileSelectorDialog(parent, file_spec, Title, initDir,
1480 suggestedName, wildcard);
1503 if (gFrame->GetPrimaryCanvas())
1504 vp.
ref_scale = gFrame->GetPrimaryCanvas()->GetVP().ref_scale;
1515 ViewPort ocpn_vp = CreateCompatibleViewportEx(vp);
1520 AISDraw(dc, ocpn_vp, NULL);
1524 return FontMgr::Get().
SetFontColor(TextElement, color);
1534 wxFontStyle style, wxFontWeight weight,
1535 bool underline,
const wxString& facename,
1536 wxFontEncoding encoding) {
1538 underline, facename, encoding);
1541int PluginGetMinAvailableGshhgQuality() {
1542 return gFrame->GetPrimaryCanvas()->GetMinAvailableGshhgQuality();
1544int PluginGetMaxAvailableGshhgQuality() {
1545 return gFrame->GetPrimaryCanvas()->GetMaxAvailableGshhgQuality();
1550 g_bPluginHandleAutopilotRoute = enable;
1553bool LaunchDefaultBrowser_Plugin(wxString url) {
1554 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
1564 if (cc && cc->GetSelectedRoutePoint()) {
1565 return cc->GetSelectedRoutePoint()->m_GUID;
1567 return wxEmptyString;
1572 if (cc && cc->GetSelectedRoute()) {
1573 return cc->GetSelectedRoute()->
m_GUID;
1575 return wxEmptyString;
1580 if (cc && cc->GetSelectedTrack()) {
1581 return cc->GetSelectedTrack()->m_GUID;
1583 return wxEmptyString;
1593 std::unique_ptr<PlugIn_Route> r;
1594 Route* route = g_pRouteMan->FindRouteByGUID(GUID);
1595 if (route ==
nullptr)
return r;
1605 src_wp = node->GetData();
1608 PlugInFromRoutePoint(dst_wp, src_wp);
1612 node = node->GetNext();
1623 std::unique_ptr<PlugIn_Track> t;
1625 Track* pTrack = g_pRouteMan->FindTrackByGUID(GUID);
1626 if (!pTrack)
return t;
1628 std::unique_ptr<PlugIn_Track> tk =
1633 dst_track->
m_EndString = pTrack->m_TrackEndString;
1634 dst_track->
m_GUID = pTrack->m_GUID;
1636 for (
int i = 0; i < pTrack->GetnPoints(); i++) {
1641 dst_wp->
m_lat = ptp->m_lat;
1642 dst_wp->
m_lon = ptp->m_lon;
1655 return g_overlayCanvas;
1661 auto oCanvas =
dynamic_cast<ChartCanvas*
>(canvas);
1662 if (oCanvas) gFrame->JumpToPosition(oCanvas, lat, lon,
scale);
1670 ChartCanvas* l_canvas = gFrame->GetCanvasUnderMouse();
1672 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); ++i) {
1673 if (l_canvas == g_canvasArray[i])
return i;
1691 if (g_canvasConfig == 0)
1692 return gFrame->GetPrimaryCanvas();
1694 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1695 return g_canvasArray[canvasIndex];
1703 if (g_canvasConfig == 0)
1704 return gFrame->GetPrimaryCanvas()->CheckEdgePan(x, y, dragging, margin,
1707 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1708 return g_canvasArray[canvasIndex]->CheckEdgePan(x, y, dragging, margin,
1717 if (g_canvasConfig == 0)
1718 gFrame->GetPrimaryCanvas()->pPlugIn_Cursor = pCursor;
1720 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1721 g_canvasArray[canvasIndex]->pPlugIn_Cursor = pCursor;
1727 if (g_canvasConfig == 1)
return 2;
1736 return g_MainToolbar->GetToolbarRect();
1738 return wxRect(0, 0, 1, 1);
1747 g_pRouteMan->ZeroCurrentXTEToActivePoint();
1768 pivp.
lat_min = tvp.GetBBox().GetMinLat();
1769 pivp.
lat_max = tvp.GetBBox().GetMaxLat();
1770 pivp.
lon_min = tvp.GetBBox().GetMinLon();
1771 pivp.
lon_max = tvp.GetBBox().GetMaxLon();
1773 pivp.
bValid = tvp.IsValid();
1778ListOfPI_S57Obj* PlugInManager::GetLightsObjRuleListVisibleAtLatLon(
1780 ListOfPI_S57Obj* list = NULL;
1794 list = picbx->GetLightsObjRuleListVisibleAtLatLon(zlat, zlon, &pi_vp);
1805#include <wx/listimpl.cpp>
1806WX_DEFINE_LIST(Plugin_WaypointExList)
1809PlugIn_Waypoint_Ex::PlugIn_Waypoint_Ex() {
InitDefaults(); }
1811PlugIn_Waypoint_Ex::PlugIn_Waypoint_Ex(
1812 double lat,
double lon,
const wxString& icon_ident,
const wxString& wp_name,
1813 const wxString& GUID,
const double ScaMin,
const bool bNameVisible,
1814 const int nRangeRings,
const double RangeDistance,
1815 const wxColor RangeColor) {
1818 wxDateTime now = wxDateTime::Now();
1851 if (!prp)
return false;
1853 if (prp->m_bIsInRoute && !prp->IsShared())
return false;
1864 wxRouteListNode* node = pRouteList->GetFirst();
1866 Route* proute = node->GetData();
1870 if (prp == pWP) nCount++;
1871 pnode = pnode->GetNext();
1874 node = node->GetNext();
1880PlugIn_Waypoint_Ex::~PlugIn_Waypoint_Ex() {}
1883PlugIn_Route_Ex::PlugIn_Route_Ex(
void) {
1887PlugIn_Route_Ex::~PlugIn_Route_Ex(
void) {
1899 dst->
m_lat = src->m_lat;
1900 dst->
m_lon = src->m_lon;
1901 dst->
IconName = src->GetIconName();
1904 dst->
IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
1907 dst->
m_GUID = src->m_GUID;
1910 if (src->m_HyperlinkList ==
nullptr)
return;
1915 if (src->m_HyperlinkList->GetCount() > 0) {
1918 wxHyperlinkListNode* linknode = src->m_HyperlinkList->GetFirst();
1924 h->
Link = link->Link;
1925 h->
Type = link->LType;
1929 linknode = linknode->GetNext();
1940 dst->
scamin = src->GetScaMin();
1945static void cloneHyperlinkListEx(
RoutePoint* dst,
1951 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
1957 h->Link = link->
Link;
1958 h->LType = link->
Type;
1960 dst->m_HyperlinkList->Append(h);
1962 linknode = linknode->GetNext();
1973 cloneHyperlinkListEx(pWP, src);
1980 wxDateTime dtnow(wxDateTime::Now());
1981 pWP->SetCreateTime(dtnow);
1984 pWP->m_btemp = (b_permanent ==
false);
1991 pWP->SetScaMin(src->
scamin);
2000 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
2002 if (!prp)
return false;
2004 PlugInExFromRoutePoint(pwaypoint, prp);
2014 bool b_unique =
true;
2015 wxRoutePointListNode* prpnode = pWayPointMan->GetWaypointList()->GetFirst();
2019 if (prp->m_GUID == pwaypointex->
m_GUID) {
2023 prpnode = prpnode->GetNext();
2026 if (!b_unique)
return false;
2028 RoutePoint* pWP = CreateNewPoint(pwaypointex, b_permanent);
2030 pWP->SetShowWaypointRangeRings(pwaypointex->
nrange_rings > 0);
2032 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2033 if (b_permanent) pConfig->AddNewWayPoint(pWP, -1);
2035 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2036 pRouteManagerDialog->UpdateWptListCtrl();
2043 bool b_found =
false;
2046 if (prp) b_found =
true;
2049 double lat_save = prp->m_lat;
2050 double lon_save = prp->m_lon;
2052 prp->m_lat = pwaypoint->
m_lat;
2053 prp->m_lon = pwaypoint->
m_lon;
2054 prp->SetIconName(pwaypoint->
IconName);
2064 prp->m_HyperlinkList->Clear();
2066 wxPlugin_HyperlinkListNode* linknode =
2073 h->Link = link->
Link;
2074 h->LType = link->
Type;
2076 prp->m_HyperlinkList->Append(h);
2078 linknode = linknode->GetNext();
2084 prp->SetWaypointRangeRingsNumber(pwaypoint->
nrange_rings);
2087 prp->SetScaMin(pwaypoint->
scamin);
2091 prp->SetShowWaypointRangeRings(pwaypoint->
nrange_rings > 0);
2093 if (prp) prp->ReLoadIcon();
2095 auto canvas = gFrame->GetPrimaryCanvas();
2096 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
2097 canvas->GetScaleValue());
2099 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
2101 pFind->m_slat = pwaypoint->
m_lat;
2102 pFind->m_slon = pwaypoint->
m_lon;
2105 if (!prp->m_btemp) pConfig->UpdateWayPoint(prp);
2107 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2108 pRouteManagerDialog->UpdateWptListCtrl();
2120 wxDateTime plannedDeparture;
2122 wxPlugin_WaypointExListNode* pwpnode = proute->
pWaypointList->GetFirst();
2124 pwaypointex = pwpnode->GetData();
2126 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->
m_GUID);
2128 pWP = CreateNewPoint(pwaypointex, b_permanent);
2132 route->AddPoint(pWP);
2134 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2137 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
2138 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
2145 pwpnode = pwpnode->GetNext();
2153 if (!proute->
m_GUID.IsEmpty()) {
2156 route->
m_btemp = (b_permanent ==
false);
2160 pRouteList->Append(route);
2162 if (b_permanent) pConfig->AddNewRoute(route);
2164 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2165 pRouteManagerDialog->UpdateRouteListCtrl();
2171 bool b_found =
false;
2174 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->
m_GUID);
2175 if (pRoute) b_found =
true;
2178 bool b_permanent = !pRoute->
m_btemp;
2179 g_pRouteMan->
DeleteRoute(pRoute, NavObjectChanges::getInstance());
2202 std::unique_ptr<PlugIn_Route_Ex> r;
2203 Route* route = g_pRouteMan->FindRouteByGUID(GUID);
2204 if (route ==
nullptr)
return r;
2214 src_wp = node->GetData();
2217 PlugInExFromRoutePoint(dst_wp, src_wp);
2221 node = node->GetNext();
2227 dst_route->
m_isActive = g_pRouteMan->GetpActiveRoute() == route;
2236 RoutePoint* rp = g_pRouteMan->GetpActivePoint();
2238 return wxEmptyString;
2245 Route* rt = g_pRouteMan->GetpActiveRoute();
2247 return wxEmptyString;
2257 MyApp& app = wxGetApp();
2258 return (app.m_comm_bridge.GetPriorityMaps());
2262 std::vector<std::string> result;
2264 MyApp& app = wxGetApp();
2267 app.m_comm_bridge.GetPriorityContainer(
"position").active_source;
2268 result.push_back(
id);
2269 id = app.m_comm_bridge.GetPriorityContainer(
"velocity").active_source;
2270 result.push_back(
id);
2271 id = app.m_comm_bridge.GetPriorityContainer(
"heading").active_source;
2272 result.push_back(
id);
2273 id = app.m_comm_bridge.GetPriorityContainer(
"variation").active_source;
2274 result.push_back(
id);
2275 id = app.m_comm_bridge.GetPriorityContainer(
"satellites").active_source;
2276 result.push_back(
id);
2283#if defined(__WXOSX__) || defined(__WXGTK3__)
2285 if (gFrame) rv = gFrame->GetContentScaleFactor();
2290 double scaler = 1.0;
2292 if (gFrame) scaler = (double)(gFrame->ToDIP(100)) / 100.;
2309 bool state = gFrame->IsFullScreen();
2310 if (set_full_screen_on && !state)
2311 gFrame->ToggleFullScreen();
2312 else if (!set_full_screen_on && state)
2313 gFrame->ToggleFullScreen();
2316extern bool g_useMUI;
2318 bool current_mui_state = g_useMUI;
2321 if (enable && !current_mui_state) {
2323 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2325 if (cc) cc->CreateMUIBar();
2327 }
else if (!enable && current_mui_state) {
2329 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2331 if (cc) cc->DestroyMuiBar();
2340 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2341 if (cc) cc->SetShowGPSCompassWindow(enable);
2347 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2349 return cc->GetShowGPSCompassWindow();
2356extern bool g_bShowStatusBar;
2358 g_bShowStatusBar = enable;
2359 gFrame->ConfigureStatusBar();
2365 bool current_chartbar_state = g_bShowChartBar;
2366 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2368 if (current_chartbar_state && !enable) {
2369 gFrame->ToggleChartBar(cc);
2370 g_bShowChartBar = current_chartbar_state;
2371 }
else if (!current_chartbar_state && enable) {
2372 gFrame->ToggleChartBar(cc);
2373 g_bShowChartBar = current_chartbar_state;
2376 g_bShowChartBar = enable;
2381extern bool g_bShowMenuBar;
2384 if (g_bShowMenuBar) {
2385 g_bShowMenuBar =
false;
2386 if (gFrame->m_pMenuBar) {
2387 gFrame->SetMenuBar(NULL);
2388 gFrame->m_pMenuBar->Destroy();
2389 gFrame->m_pMenuBar = NULL;
2393 g_bShowMenuBar =
true;
2394 gFrame->BuildMenuBar();
2401 if (ps52plib) ps52plib->m_chartSymbols.UpdateTableColor(table, name, color);
2405 wxColor ret = wxColor(*wxRED);
2407 int i_table = ps52plib->m_chartSymbols.FindColorTable(map_name.c_str());
2408 ret = ps52plib->m_chartSymbols.GetwxColor(name.c_str(), i_table);
2415 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2416 if (cc) cc->SetShowGrid(enable);
2422 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2423 if (cc) cc->SetShowOutlines(enable);
2429 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2430 if (cc) cc->SetShowDepthUnits(enable);
2436 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2437 if (cc) cc->SetShowAIS(enable);
2443 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2444 if (cc) cc->ShowTides(enable);
2450 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2451 if (cc) cc->ShowCurrents(enable);
2457 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2458 if (cc) cc->SetShowENCText(enable);
2464 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2465 if (cc) cc->SetShowENCDepth(enable);
2471 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2472 if (cc) cc->SetShowENCBuoyLabels(enable);
2478 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2479 if (cc) cc->SetShowENCLights(enable);
2485 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2486 if (cc) cc->SetShowENCLightDesc(enable);
2491 int valSet = STANDARD;
2494 valSet = DISPLAYBASE;
2503 valSet = MARINERS_STANDARD;
2510 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2511 if (cc) cc->SetENCDisplayCategory(valSet);
2515 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2517 return ((
PI_DisCat)cc->GetENCDisplayCategory());
2519 return PI_DisCat::PI_STANDARD;
2523 int newMode = NORTH_UP_MODE;
2525 newMode = COURSE_UP_MODE;
2527 newMode = HEAD_UP_MODE;
2530 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2531 if (cc) cc->SetUpMode(newMode);
2536 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2537 if (cc)
return ((
PI_NavMode)cc->GetUpMode());
2539 return PI_NavMode::PI_NORTH_UP_MODE;
2544 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2545 if (cc)
return (cc->GetShowGrid());
2552 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2553 if (cc)
return (cc->GetShowOutlines());
2560 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2561 if (cc)
return (cc->GetShowDepthUnits());
2568 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2569 if (cc)
return (cc->GetShowAIS());
2576 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2577 if (cc)
return (cc->GetbShowTide());
2584 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2585 if (cc)
return (cc->GetbShowCurrent());
2592 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2593 if (cc)
return (cc->GetShowENCText());
2600 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2601 if (cc)
return (cc->GetShowENCDepth());
2608 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2609 if (cc)
return (cc->GetShowENCBuoyLabels());
2616 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2617 if (cc)
return (cc->GetShowENCLights());
2622bool GetShowENCLightDesc(
int CanvasIndex) {
2624 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2625 if (cc)
return (cc->GetbShowCurrent());
2636 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2637 if (cc) cc->ToggleLookahead();
2643 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2644 if (cc)
return (cc->GetLookahead());
2649extern bool g_bTrackActive;
2651 if (!g_bTrackActive && enable)
2653 else if (g_bTrackActive && !enable)
2659 gFrame->SetAndApplyColorScheme((ColorScheme)cs);
2666 if (win) win->Refresh(eraseBackground);
2670 if (g_canvasConfig == 1) {
2675 gFrame->CreateCanvasLayout();
2676 gFrame->DoChartUpdate();
2681 gFrame->CreateCanvasLayout();
2682 gFrame->DoChartUpdate();
2693 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2700 g_disable_main_toolbar = !enable;
2701 if (g_MainToolbar) g_MainToolbar->RefreshToolbar();
2705 if (gFrame) gFrame->ScheduleSettingsDialog();
2710 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2712 bool bfollow = cc->GetbFollow();
2713 cc->ResetOwnshipOffset();
2717 cc->JumpToPosition(gLat, gLon, cc->
GetVPScale());
2724 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2726 if (cc->GetbFollow() != enable_follow) cc->TogglebFollow();
2733 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2734 if (cc)
return cc->GetbFollow();
2741 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2742 if (cc) cc->SetShowFocusBar(enable);
2747 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2748 if (cc)
return (cc->GetShowFocusBar());
2762 pConfig->LoadMyConfigRaw(
false);
2765 pConfig->LoadCanvasConfigs(
false);
2766 auto& config_array = ConfigMgr::Get().GetCanvasConfigArray();
2767 for (
auto pcc : config_array) {
2768 if (pcc && pcc->canvas) {
2769 pcc->canvas->ApplyCanvasConfig(pcc);
2770 pcc->canvas->Refresh();
2780 g_CanvasHideNotificationIcon = !enable;
ChartCanvas - Main chart display and interaction component.
float GetVPScale()
Return the ViewPort scale factor, in physical pixels per meter.
void ZoomCanvasSimple(double factor)
Perform an immediate zoom operation without smooth transitions.
Manages the chart database and provides access to chart data.
bool LoadBinary(const wxString &filename, ArrayOfCDI &dir_array_check)
Load the chart database from a binary file.
Wrapper class for plugin-based charts.
wxFont * FindOrCreateFont(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &facename=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
Creates or finds a matching font in the font cache.
wxColour GetFontColor(const wxString &TextElement) const
Gets the text color for a UI element.
bool AddAuxKey(wxString key)
Adds new plugin-defined font configuration key.
bool SetFontColor(const wxString &TextElement, const wxColour color) const
Sets the text color for a UI element.
wxFont * GetFont(const wxString &TextElement, int requested_font_size=0)
Gets a font object for a UI element.
static wxString GetUUID(void)
Return a unique RFC4122 version 4 compliant GUID string.
Extended OpenGL-optimized chart base class with additional querying capabilities.
virtual ListOfPI_S57Obj * GetLightsObjRuleListVisibleAtLatLon(float lat, float lon, PlugIn_ViewPort *VPoint)
Gets list of visible light objects at specified position.
Basic data for a loaded plugin, trivially copyable.
AIS target information accessible to plugins.
double HDG
Heading in degrees true.
int ROTAIS
Rate of turn as indicated in AIS message.
unsigned char ShipType
Ship type as per ITU-R M.1371.
double Lat
Latitude in decimal degrees.
int MMSI
Maritime Mobile Service Identity number.
bool bCPA_Valid
True if CPA calculation is valid.
double Brg
Bearing to target in degrees true.
double Lon
Longitude in decimal degrees.
double CPA
Closest Point of Approach in nautical miles.
int Class
AIS class (Class A: 0, Class B: 1)
double SOG
Speed over ground in knots.
double Range_NM
Range to target in nautical miles.
int NavStatus
Navigational status (0-15 as per ITU-R M.1371)
int IMO
IMO ship identification number.
double TCPA
Time to Closest Point of Approach in minutes.
double COG
Course over ground in degrees.
plugin_ais_alarm_type alarm_state
Current alarm state for this target.
Extended position fix information.
int nSats
Number of satellites used in the fix.
double Var
Magnetic variation in degrees, typically from RMC message.
double Cog
Course over ground in degrees.
double Lat
Latitude in decimal degrees.
double Hdm
Heading magnetic in degrees.
time_t FixTime
UTC time of fix.
double Lon
Longitude in decimal degrees.
double Sog
Speed over ground in knots.
double Hdt
Heading true in degrees.
Extended route class for managing complex route features.
wxString m_Description
Optional route description/notes.
wxString m_EndString
Description of route end point.
Plugin_WaypointExList * pWaypointList
List of waypoints making up this route in order.
wxString m_NameString
User-visible name of the route.
bool m_isVisible
True if route should be displayed.
wxString m_GUID
Globally unique identifier.
bool m_isActive
True if this is the active route.
wxString m_StartString
Description of route start point.
Plugin route class for managing ordered waypoint collections.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Name/description of ending point.
wxString m_NameString
Route name.
Plugin_WaypointList * pWaypointList
List of waypoints making up this route in order.
wxString m_StartString
Name/description of starting point.
Plugin track class for managing recorded track data.
Plugin_WaypointList * pWaypointList
List of waypoints making up this track in chronological order.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of track end point/time.
wxString m_StartString
Description of track start point/time.
wxString m_NameString
Display name of the track.
Contains view parameters and status information for a chart display viewport.
double view_scale_ppm
Display scale in pixels per meter.
wxRect rv_rect
Rectangle defining the rendered view area.
int pix_width
Viewport width in pixels.
double lon_max
Maximum longitude of the viewport.
double clon
Center longitude of the viewport in decimal degrees.
double lat_max
Maximum latitude of the viewport.
int pix_height
Viewport height in pixels.
double clat
Center latitude of the viewport in decimal degrees.
double skew
Display skew angle in radians.
double rotation
Display rotation angle in radians.
bool bValid
True if this viewport is valid and can be used for rendering.
double lon_min
Minimum longitude of the viewport.
double lat_min
Minimum latitude of the viewport.
int m_projection_type
Chart projection type (PROJECTION_MERCATOR, etc.)
bool b_quilt
True if the viewport is in quilt mode (showing multiple charts)
float chart_scale
Conventional chart displayed scale (e.g., 1:50000)
Extended waypoint class with additional navigation features.
bool GetFSStatus()
Gets "free-standing" status of waypoint.
wxDateTime m_CreateTime
Creation timestamp.
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.
void InitDefaults()
Initializes waypoint properties to default values.
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.
int GetRouteMembershipCount()
Gets number of routes containing this waypoint.
bool IsActive
Active state (e.g. destination)
bool IsVisible
Visibility state on chart.
Plugin waypoint class providing core waypoint/mark functionality.
double m_lon
Longitude in decimal degrees.
wxString m_IconName
Icon identifier.
wxString m_MarkDescription
Optional description.
wxString m_GUID
Globally unique identifier.
bool m_IsVisible
Visibility state.
PlugIn_Waypoint()
Default constructor - creates waypoint at 0,0.
wxDateTime m_CreateTime
Creation timestamp.
wxString m_MarkName
Display name.
double m_lat
Latitude in decimal degrees.
Plugin_HyperlinkList * m_HyperlinkList
List of associated hyperlinks.
Class representing a hyperlink associated with a waypoint or route.
wxString Link
The actual URL or file path.
wxString DescrText
User-visible description of the link.
wxString Type
Link type identifier (e.g., "Website", "Chart", "Image")
Represents a waypoint or mark within the navigation system.
bool m_bIsolatedMark
Flag indicating if the waypoint is a standalone mark.
Represents a navigational route in the navigation system.
wxString m_RouteStartString
Name or description of the route's starting point.
wxString m_RouteDescription
Additional descriptive information about the route.
RoutePointList * pRoutePointList
Ordered list of waypoints (RoutePoints) that make up this route.
wxString m_RouteEndString
Name or description of the route's ending point.
bool m_btemp
Flag indicating if this is a temporary route.
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.
bool DeleteRoute(Route *pRoute, NavObjectChanges *nav_obj_changes)
Manages a set of ShapeBaseChart objects at different resolutions.
Represents a single point in a track.
wxDateTime GetCreateTime(void)
Retrieves the creation timestamp of a track point as a wxDateTime object.
void SetCreateTime(wxDateTime dt)
Sets the creation timestamp for a track point.
Represents a track, which is a series of connected track points.
ViewPort - Core geographic projection and coordinate transformation engine.
double view_scale_ppm
Requested view scale in physical pixels per meter (ppm), before applying projections.
double ref_scale
The nominal scale of the "reference chart" for this view.
int pix_height
Height of the viewport in physical pixels.
void SetBoxes(void)
Computes the bounding box coordinates for the current viewport.
double rotation
Rotation angle of the viewport in radians.
int pix_width
Width of the viewport in physical pixels.
wxPoint2DDouble GetDoublePixFromLL(double lat, double lon)
Convert latitude and longitude on the ViewPort to physical pixel coordinates with double precision.
double skew
Angular distortion (shear transform) applied to the viewport in radians.
void GetLLFromPix(const wxPoint &p, double *lat, double *lon)
Convert physical pixel coordinates on the ViewPort to latitude and longitude.
double clon
Center longitude of the viewport in degrees.
double clat
Center latitude of the viewport in degrees.
wxPoint GetPixFromLL(double lat, double lon)
Convert latitude and longitude on the ViewPort to physical pixel coordinates.
double chart_scale
Chart scale denominator (e.g., 50000 for a 1:50000 scale).
Device context class that can use either wxDC or OpenGL for drawing.
Base class for OpenCPN plugins.
Raw messages layer, supports sending and recieving navmsg messages.
wxFont * GetOCPNScaledFont(wxString item, int default_size)
Retrieves a font from FontMgr, optionally scaled for physical readability.
wxFont GetOCPNGUIScaledFont(wxString item)
Retrieves a font optimized for touch and high-resolution interfaces.
General purpose GUI support.
Class NotificationManager.
PlugIn Object Definition/API.
@ OBJECTS_ALL
Return all objects including those in layers.
@ OBJECTS_ONLY_LAYERS
Return only objects that are in layers.
@ OBJECTS_NO_LAYERS
Exclude objects that are in layers.
plugin_ais_alarm_type
Enumeration of AIS alarm states.
enum _PI_DisCat PI_DisCat
Display categories for S52 chart features.
PI_ColorScheme
Enumeration of color schemes.
@ PI_COURSE_UP_MODE
Course Up Mode - Current course over ground at the top.
@ PI_HEAD_UP_MODE
Head Up Mode - Current vessel heading at the top.
@ PI_OTHER
Other - additional features for detailed navigation.
@ PI_DISPLAYBASE
Display Base - features that must always be shown.
@ PI_STANDARD
Standard - default features for safe navigation.
@ PI_MARINERS_STANDARD
Mariner specified standard features.
enum _PI_NavMode PI_NavMode
Navigation mode options for chart display orientation.
enum _OBJECT_LAYER_REQ OBJECT_LAYER_REQ
Filter options for object queries.
OptionsParentPI
Enum defining parent pages in OpenCPN options dialog where plugins can add panels.
@ PI_OPTIONS_PARENT_DISPLAY
Display settings section.
@ PI_OPTIONS_PARENT_UI
User Interface section.
@ PI_OPTIONS_PARENT_SHIPS
Ships section.
@ PI_OPTIONS_PARENT_CHARTS
Charts section.
@ PI_OPTIONS_PARENT_PLUGINS
Plugins section.
@ PI_OPTIONS_PARENT_CONNECTIONS
Connections section.
void EnableNotificationCanvasIcon(bool enable)
Plugin Notification Framework GUI support.
void SetCanvasContextMenuItemGrey(int item, bool grey)
Sets menu item enabled/disabled state.
bool UpdateSingleWaypoint(PlugIn_Waypoint *pwaypoint)
Updates a single waypoint.
bool PlugInHasNormalizedViewPort(PlugIn_ViewPort *vp)
Checks if viewport has been normalized.
void PluginCenterOwnship(int CanvasIndex)
Center the chart view on the own ship position for a specific canvas.
void SetCanvasRotation(double rotation)
Sets chart display rotation angle.
wxString GetSelectedWaypointGUID_Plugin()
Gets GUID of currently selected waypoint.
int GetChartbarHeight(void)
Gets height of chart bar in pixels.
void RemovePlugInTool(int tool_id)
Removes a tool from OpenCPN's toolbar.
void SetCanvasProjection(int projection)
Sets chart projection type.
wxString * GetpSharedDataLocation(void)
Gets shared application data location.
double toUsrTemp_Plugin(double cel_temp, int unit)
Converts Celsius to user's preferred temperature unit.
wxWindow * PluginGetFocusCanvas()
Gets the currently focused chart canvas.
int AddChartToDBInPlace(wxString &full_path, bool b_RefreshCanvas)
Adds a chart to the database without full rebuild.
void fromSM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Simple Mercator coordinates to geographic.
wxWindow * GetOCPNCanvasWindow()
Gets OpenCPN's main canvas window.
bool GetEnableLatLonGrid(int CanvasIndex)
Gets latitude/longitude grid visibility state.
bool UpdatePlugInRouteEx(PlugIn_Route_Ex *proute)
Updates an existing extended route.
void SetCanvasContextMenuItemViz(int item, bool viz)
Temporarily changes context menu item visibility.
int PlatformDirSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir)
Shows platform-optimized directory selector dialog.
bool GetTouchMode()
Gets touch interface mode state.
int GetCanvasCount()
Gets total number of chart canvases.
ArrayOfPlugIn_AIS_Targets * GetAISTargetArray(void)
Gets array of AIS targets.
wxString getUsrWindSpeedUnit_Plugin(int unit)
Gets display string for user's preferred wind speed unit.
void SetCanvasMenuItemViz(int item, bool viz, const char *name)
Temporarily changes context menu item visibility.
void PlugInMultMatrixViewport(PlugIn_ViewPort *vp, float lat, float lon)
Applies viewport transformation matrix.
wxFont * OCPNGetFont(wxString TextElement, int default_size)
Gets a font for UI elements.
bool GetEnableMainToolbar()
Check if the main toolbar is enabled.
bool GetEnableENCTextDisplay(int CanvasIndex)
Gets ENC text label visibility.
bool UpdateSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint)
Updates an existing extended waypoint.
wxArrayString GetTrackGUIDArray(void)
Gets array of track GUIDs.
wxString getUsrDistanceUnit_Plugin(int unit)
Gets display string for user's preferred distance unit.
bool DeletePlugInTrack(wxString &GUID)
Deletes a track.
bool DeletePlugInRoute(wxString &GUID)
Deletes a route.
void EnableSplitScreenLayout(bool enable)
Enable or disable the split-screen layout.
double toUsrWindSpeed_Plugin(double kts_speed, int unit)
Converts knots to user's preferred wind speed unit.
bool GetEnableLightsDisplay(int CanvasIndex)
Gets light icon visibility.
wxFont GetOCPNGUIScaledFont_PlugIn(wxString item)
Gets a uniquely scaled font copy for responsive UI elements.
wxBitmap GetBitmapFromSVGFile(wxString filename, unsigned int width, unsigned int height)
Creates bitmap from SVG file.
wxFont * FindOrCreateFont_PlugIn(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline, const wxString &facename, wxFontEncoding encoding)
Creates or finds a font in the font cache.
int GetGlobalWatchdogTimoutSeconds()
Comm Global Watchdog Query
wxColour GetFontColour_PlugIn(wxString TextElement)
Gets color configured for a UI text element.
void EnableChartBar(bool enable, int CanvasIndex)
Controls visibility of chart info bar.
void PositionBearingDistanceMercator_Plugin(double lat, double lon, double brg, double dist, double *dlat, double *dlon)
Calculates destination point given start point, bearing and distance.
double toUsrDistance_Plugin(double nm_distance, int unit)
Converts nautical miles to user's preferred distance unit.
void SetENCDisplayCategory(PI_DisCat cat, int CanvasIndex)
Sets ENC (Electronic Navigation Chart) feature display category.
void toSM_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Simple Mercator projection.
PI_DisCat GetENCDisplayCategory(int CanvasIndex)
Gets current ENC display category.
void EnableTouchMode(bool enable)
Enables/disables touch interface mode.
void EnableCurrentStationsDisplay(bool enable, int CanvasIndex)
Controls current station icon display.
void EnableChartOutlines(bool enable, int CanvasIndex)
Controls chart outline display.
void EnableMUIBar(bool enable, int CanvasIndex)
Controls visibility of MUI (Mobile/Touch User Interface) bar.
double OCPN_GetDisplayContentScaleFactor()
Gets content scaling factor for current display.
double DistGreatCircle_Plugin(double slat, double slon, double dlat, double dlon)
Calculates great circle distance between two points.
void EnableLookaheadMode(bool enable, int CanvasIndex)
Enables/disables look-ahead mode for a canvas.
bool PluginGetFollowMode(int CanvasIndex)
Get the current follow mode status for a specific canvas.
wxArrayString GetRouteGUIDArray(void)
Gets array of route GUIDs.
wxScrolledWindow * AddOptionsPage(OptionsParentPI parent, wxString title)
Adds a new preferences page to OpenCPN options dialog.
void EnableLightsDisplay(bool enable, int CanvasIndex)
Controls light icon display.
void PlugInHandleAutopilotRoute(bool enable)
Controls autopilot route handling.
wxString getUsrDepthUnit_Plugin(int unit)
Gets display string for user's preferred depth unit.
void RemoveCanvasMenuItem(int item, const char *name)
Removes a context menu item completely.
void JumpToPosition(double lat, double lon, double scale)
Centers chart display on specified position at given scale.
int InsertPlugInToolSVG(wxString label, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled, wxItemKind kind, wxString shortHelp, wxString longHelp, wxObject *clientData, int position, int tool_sel, opencpn_plugin *pplugin)
Adds a tool using SVG graphics.
bool GetEnableCurrentStationsDisplay(int CanvasIndex)
Gets current station icon visibility.
wxDialog * GetActiveOptionsDialog()
Gets pointer to active options dialog.
wxString getUsrSpeedUnit_Plugin(int unit)
Gets display string for user's preferred speed unit.
std::unique_ptr< PlugIn_Waypoint > GetWaypoint_Plugin(const wxString &GUID)
Gets waypoint details by GUID.
bool GetEnableLookaheadMode(int CanvasIndex)
Gets look-ahead mode state for a canvas.
void EnableTideStationsDisplay(bool enable, int CanvasIndex)
Controls tide station icon display.
bool GetEnableChartBar(int CanvasIndex)
Gets chart bar visibility state.
wxBitmap GetIcon_PlugIn(const wxString &name)
Gets icon bitmap by name.
wxArrayString GetIconNameArray(void)
Gets array of available waypoint icons.
bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1, double lat2, double lon2)
Checks if a great circle route crosses land.
void SetNavigationMode(PI_NavMode mode, int CanvasIndex)
Sets the navigation mode for a specific chart canvas.
bool GetEnableStatusBar()
Gets status bar visibility state.
bool GetEnableDepthUnitDisplay(int CanvasIndex)
Gets depth unit display state.
int InsertPlugInTool(wxString label, wxBitmap *bitmap, wxBitmap *bmpRollover, wxItemKind kind, wxString shortHelp, wxString longHelp, wxObject *clientData, int position, int tool_sel, opencpn_plugin *pplugin)
Adds a tool to OpenCPN's toolbar.
void EnableENCDepthSoundingsDisplay(bool enable, int CanvasIndex)
Controls ENC depth sounding display.
void PlugInAISDrawGL(wxGLCanvas *glcanvas, const PlugIn_ViewPort &vp)
Renders AIS targets on a secondary OpenGL canvas.
double GetCanvasTilt()
Gets current canvas tilt angle.
void AddChartDirectory(wxString &path)
Adds a chart directory to OpenCPN's chart database.
double fromDMM_PlugIn(wxString sdms)
Parse a formatted coordinate string to get decimal degrees.
double toUsrDepth_Plugin(double m_depth, int unit)
Converts meters to user's preferred depth unit.
bool GetActiveRoutepointGPX(char *buffer, unsigned int buffer_length)
Gets GPX representation of active route waypoint.
double PlugInGetDisplaySizeMM()
Gets physical display size in millimeters.
bool UpdatePlugInRoute(PlugIn_Route *proute)
Updates an existing route.
void SetToolbarToolBitmaps(int item, wxBitmap *bitmap, wxBitmap *bmpRollover)
Updates toolbar tool bitmaps.
void EnableBuoyLightLabelsDisplay(bool enable, int CanvasIndex)
Controls buoy/light name label display.
wxString GetActiveWaypointGUID(void)
Gets GUID of currently active waypoint.
void ConfigFlushAndReload()
Flush configuration changes to disk and reload settings.
void EnableAisTargetDisplay(bool enable, int CanvasIndex)
Controls AIS target display.
int PlatformFileSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir, wxString suggestedName, wxString wildcard)
Shows platform-optimized file selector dialog.
bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta, int canvasIndex)
Checks if chart should pan when cursor near edge.
double fromUsrDepth_Plugin(double usr_depth, int unit)
Converts from user's preferred depth unit to meters.
bool AddPlugInRoute(PlugIn_Route *proute, bool b_permanent)
Adds a new route.
wxString GetNewGUID(void)
Generates a new globally unique identifier (GUID).
double fromDMM_Plugin(wxString sdms)
Converts degrees/decimal minutes string to decimal degrees.
void EnableENCTextDisplay(bool enable, int CanvasIndex)
Controls ENC text label display.
int GetCanvasIndexUnderMouse(void)
Gets index of chart canvas under mouse cursor.
void EnableTenHertzUpdate(bool enable)
Enable or disable 10 Hz update rate.
wxRect GetMasterToolbarRect()
Gets bounding rectangle of master toolbar.
void toTM_Plugin(float lat, float lon, float lat0, float lon0, double *x, double *y)
Converts geographic coordinates to Transverse Mercator projection.
void CanvasJumpToPosition(wxWindow *canvas, double lat, double lon, double scale)
Centers specified canvas on given position at given scale.
bool GetGlobalColor(wxString colorName, wxColour *pcolour)
Gets a global color value.
double fromUsrSpeed_Plugin(double usr_speed, int unit)
Converts from user's preferred speed unit to knots.
void GetDoubleCanvasPixLL(PlugIn_ViewPort *vp, wxPoint2DDouble *pp, double lat, double lon)
Converts lat/lon to canvas pixels with double precision.
std::unique_ptr< PlugIn_Track > GetTrack_Plugin(const wxString &GUID)
Gets track details by GUID.
bool PlugInPlaySoundEx(wxString &sound_file, int deviceIndex)
Start playing a sound file asynchronously.
void EnableCompassGPSIcon(bool enable, int CanvasIndex)
Controls visibility of compass/GPS status icon.
wxString GetActiveRouteGUID(void)
Gets GUID of currently active route.
void EnableDepthUnitDisplay(bool enable, int CanvasIndex)
Controls depth unit display.
bool GetEnableTideStationsDisplay(int CanvasIndex)
Gets tide station icon visibility.
bool PlugInSetFontColor(const wxString TextElement, const wxColour color)
Sets text color for a UI element.
wxWindow * GetCanvasUnderMouse(void)
Gets canvas window under mouse cursor.
std::unique_ptr< PlugIn_Waypoint_Ex > GetWaypointEx_Plugin(const wxString &GUID)
Gets extended waypoint by GUID.
bool GetTrackingMode()
Get the current tracking mode status.
bool GetEnableChartOutlines(int CanvasIndex)
Gets chart outline visibility state.
void GetCanvasPixLL(PlugIn_ViewPort *vp, wxPoint *pp, double lat, double lon)
Converts lat/lon to canvas physical pixel coordinates.
wxColor GetGlobalColorD(std::string map_name, std::string name)
Gets a color from the global color scheme.
bool GetEnableCompassGPSIcon(int CanvasIndex)
Gets compass icon visibility state.
void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex)
Sets mouse cursor for specific canvas.
void EnableMenu(bool enable)
Shows/hides the main menu bar.
void DimeWindow(wxWindow *win)
Applies system color scheme to window.
bool GetEnableAisTargetDisplay(int CanvasIndex)
Gets AIS target display state.
std::vector< std::string > GetPriorityMaps()
Comm Priority query support methods
double GetOCPNGUIToolScaleFactor_PlugIn()
Gets current global GUI scaling factor.
void SetToolbarToolBitmapsSVG(int item, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled)
Updates SVG graphics for toolbar tool.
wxString getUsrTempUnit_Plugin(int unit)
Gets display string for user's preferred temperature unit.
bool AddSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypointex, bool b_permanent)
Adds a waypoint with extended properties.
wxArrayString GetWaypointGUIDArray(void)
Gets array of all waypoint/marks GUIDs.
int AddCanvasContextMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin)
Adds item to chart canvas context menu.
wxString GetActiveStyleName()
Gets name of currently active style sheet.
wxArrayString GetChartDBDirArrayString()
Gets chart database directory list.
void SetCursor_PlugIn(wxCursor *pCursor)
Sets mouse cursor.
bool GetEnableTenHertzUpdate()
Check if 10 Hz update rate is enabled.
wxString GetLocaleCanonicalName()
Gets system locale canonical name.
wxWindow * PluginGetOverlayRenderCanvas()
Gets the canvas currently designated for overlay rendering.
bool AddPersistentFontKey(wxString TextElement)
Registers a new font configuration element.
bool AddPlugInTrack(PlugIn_Track *ptrack, bool b_permanent)
Adds a new track.
bool UpdateChartDBInplace(wxArrayString dir_array, bool b_force_update, bool b_ProgressDialog)
Updates chart database in place.
void RequestWindowRefresh(wxWindow *win, bool eraseBackground)
Requests window refresh.
void EnableLatLonGrid(bool enable, int CanvasIndex)
Controls latitude/longitude grid display.
void SetAppColorScheme(PI_ColorScheme cs)
Set the application color scheme.
bool DeleteSingleWaypoint(wxString &GUID)
Deletes a single waypoint.
void RemoveCanvasContextMenuItem(int item)
Removes a context menu item completely.
bool DecodeSingleVDOMessage(const wxString &str, PlugIn_Position_Fix_Ex *pos, wxString *accumulator)
Decodes a single VDO (Own Ship AIS) message.
bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key, wxString description)
Adds a custom waypoint icon.
bool CheckEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta)
Checks if chart should pan when cursor near edge.
double toUsrSpeed_Plugin(double kts_speed, int unit)
Converts knots to user's preferred speed unit.
std::unique_ptr< PlugIn_Route_Ex > GetRouteEx_Plugin(const wxString &GUID)
Gets extended route by GUID.
std::vector< std::string > GetActivePriorityIdentifiers()
Gets list of active priority identifiers.
bool GetEnableENCDepthSoundingsDisplay(int CanvasIndex)
Gets ENC depth sounding visibility.
void SetToolbarItemState(int item, bool toggle)
Sets toolbar item toggle state.
bool DeleteOptionsPage(wxScrolledWindow *page)
Removes a previously added options page.
void EnableLightDescriptionsDisplay(bool enable, int CanvasIndex)
Controls light description text display.
float GetOCPNChartScaleFactor_Plugin()
Gets chart rendering scale factor.
PI_NavMode GetNavigationMode(int CanvasIndex)
Gets current navigation mode for a canvas.
int AddCanvasMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin, const char *name)
Adds item to canvas context menu.
int RemoveChartFromDBInPlace(wxString &full_path)
Removes a chart from database without full rebuild.
void PlugInNormalizeViewport(PlugIn_ViewPort *vp, float lat, float lon)
Normalizes viewport parameters.
PI_ColorScheme GetAppColorScheme()
Get the current application color scheme.
void ExitOCPN()
Exits OpenCPN application.
wxWindow * GetCanvasByIndex(int canvasIndex)
Gets chart canvas window by index.
void fromTM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Transverse Mercator coordinates to geographic.
double OCPN_GetWinDIPScaleFactor()
Gets Windows-specific DPI scaling factor.
void PushNMEABuffer(wxString buf)
Pushes NMEA sentence to the system.
void SetEnableMainToolbar(bool enable)
Show or hide the main toolbar.
void SetFullScreen(bool set_full_screen_on)
Sets full screen mode.
bool GetEnableMenu()
Gets menu bar visibility state.
void SetCanvasMenuItemGrey(int item, bool grey, const char *name)
Sets menu item enabled/disabled state.
bool GetEnableBuoyLightLabelsDisplay(int CanvasIndex)
Gets buoy/light label visibility.
double fromUsrWindSpeed_Plugin(double usr_wspeed, int unit)
Converts from user's preferred wind speed unit to knots.
bool GetEnableCanvasFocusBar(int CanvasIndex)
Gets focus indicator visibility state.
wxXmlDocument GetChartDatabaseEntryXML(int dbIndex, bool b_getGeom)
Gets chart database entry as XML.
wxAuiManager * GetFrameAuiManager(void)
Gets main frame AUI manager.
void SendPluginMessage(wxString message_id, wxString message_body)
Sends message to other plugins.
bool AddPlugInRouteEx(PlugIn_Route_Ex *proute, bool b_permanent)
Adds a route with extended features.
void fromSM_ECC_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Elliptical Simple Mercator coordinates to geographic.
void EnableStatusBar(bool enable)
Shows/hides the status bar.
void RequestRefresh(wxWindow *win)
Requests window refresh.
void PluginZoomCanvas(int CanvasIndex, double factor)
Zoom a specific chart canvas by the given factor.
int GetLatLonFormat()
Gets currently selected latitude/longitude display format.
bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint, bool b_permanent)
Adds a single waypoint.
bool IsTouchInterface_PlugIn(void)
Checks if touch interface mode is enabled.
bool GetSingleWaypoint(wxString GUID, PlugIn_Waypoint *pwaypoint)
Gets waypoint data by GUID.
void SetToolbarToolViz(int item, bool viz)
Temporarily changes toolbar tool visibility.
double fromUsrTemp_Plugin(double usr_temp, int unit)
Converts from user's preferred temperature unit to Celsius.
void SetCanvasTilt(double tilt)
Gets current canvas tilt angle.
std::unique_ptr< PlugIn_Route > GetRoute_Plugin(const wxString &GUID)
Gets route details by GUID.
bool GetEnableMUIBar(int CanvasIndex)
Gets MUI bar visibility state.
bool AddLocaleCatalog(wxString catalog)
Adds a locale catalog for translations.
bool GetFullScreen()
Gets full screen state.
void SetTrackingMode(bool enable)
Enable or disable tracking mode.
wxString g_locale
Global locale setting for OpenCPN UI.
void PluginSetFollowMode(int CanvasIndex, bool enable_follow)
Set follow mode for a specific canvas.
void ShowGlobalSettingsDialog()
Display the global settings dialog.
void toSM_ECC_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Elliptical Simple Mercator projection.
bool UpdatePlugInTrack(PlugIn_Track *ptrack)
Updates an existing track.
double fromUsrDistance_Plugin(double usr_distance, int unit)
Converts from user's preferred distance unit to nautical miles.
wxString GetSelectedTrackGUID_Plugin()
Gets GUID of currently selected track.
wxFileConfig * GetOCPNConfigObject(void)
Gets OpenCPN's configuration object.
void DistanceBearingMercator_Plugin(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist)
Calculates bearing and distance between two points.
void SetGlobalColor(std::string table, std::string name, wxColor color)
Sets a color in the global color scheme.
void ZeroXTE()
Resets cross track error to zero.
void PlugInPlaySound(wxString &sound_file)
Plays a sound file asynchronously.
void GetCanvasLLPix(PlugIn_ViewPort *vp, wxPoint p, double *plat, double *plon)
Converts canvas physical pixel coordinates to lat/lon.
void EnableCanvasFocusBar(bool enable, int CanvasIndex)
Controls visibility of canvas focus indicator.
wxString GetSelectedRouteGUID_Plugin()
Gets GUID of currently selected route.
double g_display_size_mm
The width of the physical screen in millimeters.
void ForceChartDBUpdate()
Forces an update of the chart database.
bool GetSingleWaypointEx(wxString GUID, PlugIn_Waypoint_Ex *pwaypoint)
Gets extended waypoint data by GUID.
bool ShuttingDown(void)
Checks if OpenCPN is in shutdown process.
void ForceChartDBRebuild()
Forces complete rebuild of chart database.
Tools to send data to plugins.
A generic position and navigation data structure.
double kCog
Course over ground in degrees.
double kHdt
True heading in degrees.
double kLat
Latitude in decimal degrees.
double kSog
Speed over ground in knots.
double kLon
Longitude in decimal degrees.