OpenCPN Partial API docs
Loading...
Searching...
No Matches
ocpn_plugin.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 - 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 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 **************************************************************************/
19
25#ifndef _PLUGIN_H_
26#define _PLUGIN_H_
27
28#ifndef DECL_EXP
29#if defined(__WXMSW__) || defined(__CYGWIN__)
30#define DECL_EXP __declspec(dllexport)
31#elif defined __GNUC__ && __GNUC__ >= 4
32#define DECL_EXP __attribute__((visibility("default")))
33#elif defined __WXOSX__
34#define DECL_EXP __attribute__((visibility("default")))
35#else
36#define DECL_EXP
37#endif
38#endif
39
40#if defined(__WXMSW__) && defined(MAKING_PLUGIN)
41#define DECL_IMP __declspec(dllimport)
42#else
43#define DECL_IMP
44#endif
45
46#include <wx/xml/xml.h>
47#include <wx/dcmemory.h>
48#include <wx/dialog.h>
49#include <wx/event.h>
50#include <wx/menuitem.h>
51#include <wx/gdicmn.h>
52
53#ifdef ocpnUSE_SVG
54#include <wx/bitmap.h>
55#endif // ocpnUSE_SVG
56
57#include <memory>
58#include <vector>
59#include <unordered_map>
60
61class wxGLContext;
62
63// This is the most modern API Version number
64// It is expected that the API will remain downward compatible, meaning that
65// PlugIns conforming to API Version less than the most modern will also
66// be correctly supported.
67#define API_VERSION_MAJOR 1
68#define API_VERSION_MINOR 19
69
70// Fwd Definitions
71class wxFileConfig;
72class wxNotebook;
73class wxFont;
74class wxAuiManager;
75class wxScrolledWindow;
76class wxGLCanvas;
77
78//---------------------------------------------------------------------------------------------------------
79//
80// Bitfield PlugIn Capabilites flag definition
81//
82//---------------------------------------------------------------------------------------------------------
86#define WANTS_OVERLAY_CALLBACK 0x00000001
90#define WANTS_CURSOR_LATLON 0x00000002
100#define WANTS_TOOLBAR_CALLBACK 0x00000004
106#define INSTALLS_TOOLBAR_TOOL 0x00000008
109#define WANTS_CONFIG 0x00000010
112#define INSTALLS_TOOLBOX_PAGE 0x00000020
115#define INSTALLS_CONTEXTMENU_ITEMS 0x00000040
118#define WANTS_NMEA_SENTENCES 0x00000080
122#define WANTS_NMEA_EVENTS 0x00000100
125#define WANTS_AIS_SENTENCES 0x00000200
128#define USES_AUI_MANAGER 0x00000400
131#define WANTS_PREFERENCES 0x00000800
134#define INSTALLS_PLUGIN_CHART 0x00001000
137#define WANTS_ONPAINT_VIEWPORT 0x00002000
140#define WANTS_PLUGIN_MESSAGING 0x00004000
141#define WANTS_OPENGL_OVERLAY_CALLBACK 0x00008000
142#define WANTS_DYNAMIC_OPENGL_OVERLAY_CALLBACK 0x00010000
145#define WANTS_LATE_INIT 0x00020000
148#define INSTALLS_PLUGIN_CHART_GL 0x00040000
151#define WANTS_MOUSE_EVENTS 0x00080000
154#define WANTS_VECTOR_CHART_OBJECT_INFO 0x00100000
157#define WANTS_KEYBOARD_EVENTS 0x00200000
160#define WANTS_PRESHUTDOWN_HOOK 0x00400000
161
162//---------------------------------------------------------------------------------------------------------
163//
164// Overlay priorities
165//
166//---------------------------------------------------------------------------------------------------------
167#define OVERLAY_LEGACY 0
168#define OVERLAY_OVER_SHIPS 64
169#define OVERLAY_OVER_EMBOSS 96
170#define OVERLAY_OVER_UI 128
171
172//----------------------------------------------------------------------------------------------------------
173// Some PlugIn API interface object class definitions
174//----------------------------------------------------------------------------------------------------------
189
194public:
195 double clat;
196 double clon;
198 double skew;
199 double rotation;
200
202
205 wxRect rv_rect;
206 bool b_quilt;
209
210 double lat_min;
211 double lat_max;
212 double lon_min;
213 double lon_max;
214
215 bool
217};
218
223public:
224 double Lat;
225 double Lon;
226 double Cog;
227 double Sog;
228 double Var;
229 time_t FixTime;
230 int nSats;
231};
243public:
250 double Lat;
251
258 double Lon;
259
261 double Cog;
262
267 double Sog;
268
270 double Var;
271
276 double Hdm;
277
283 double Hdt;
284
290 time_t FixTime;
291
298 int nSats;
299};
300
305public:
306 double Xte;
308 double Btw;
309 double Dtw;
310 wxString wp_name;
311 bool arrival;
313};
314
323
328public:
329 int MMSI;
330 int Class;
332 double SOG;
333 double COG;
334 double HDG;
335 double Lon;
336 double Lat;
337 int ROTAIS;
338 char CallSign[8];
339 char ShipName[21];
340 unsigned char ShipType;
341 int IMO;
342
343 double Range_NM;
344 double Brg;
345
346 // Per target collision parameters
348 double TCPA;
349 double CPA;
350
352};
353
368
378
388
411
415typedef struct _ExtentPI {
416 double SLAT;
417 double WLON;
418 double NLAT;
419 double ELON;
421
422// PlugInChartBase::Init() init_flags constants
425#define PI_FULL_INIT 0
428#define PI_HEADER_ONLY 1
430#define PI_THUMB_ONLY 2
431
445class DECL_EXP PlugInChartBase : public wxObject {
446public:
447 // These methods Must be overriden in any derived class
449 virtual ~PlugInChartBase();
450
471 virtual wxString GetFileSearchMask(void);
472
497 virtual int Init(const wxString &full_path, int init_flags);
517 virtual void SetColorScheme(int cs, bool bApplyImmediate);
518
539 virtual double GetNormalScaleMin(double canvas_scale_factor,
540 bool b_allow_overzoom);
558 virtual double GetNormalScaleMax(double canvas_scale_factor,
559 int canvas_width);
574 virtual double GetNearestPreferredScalePPM(double target_scale_ppm);
575
593 virtual bool GetChartExtent(ExtentPI *pext);
594
621 virtual wxBitmap &RenderRegionView(const PlugIn_ViewPort &VPoint,
622 const wxRegion &Region);
623
638 virtual bool AdjustVP(PlugIn_ViewPort &vp_last, PlugIn_ViewPort &vp_proposed);
639
655 virtual void GetValidCanvasRegion(const PlugIn_ViewPort &VPoint,
656 wxRegion *pValidRegion);
657
675 virtual int GetCOVREntries() { return 0; }
691 virtual int GetCOVRTablePoints(int iTable) { return 0; }
705 virtual int GetCOVRTablenPoints(int iTable) { return 0; }
726 virtual float *GetCOVRTableHead(int iTable) { return (float *)NULL; }
727
750 virtual wxBitmap *GetThumbnail(int tnx, int tny, int cs);
751
752 // Accessors, need not be overridden in derived class if the member
753 // variables are maintained
754
768 virtual wxString GetFullPath() const { return m_FullPath; }
769
791 virtual ChartTypeEnumPI GetChartType() { return m_ChartType; }
805 virtual ChartFamilyEnumPI GetChartFamily() { return m_ChartFamily; }
825 virtual OcpnProjTypePI GetChartProjection() { return m_projection; }
838 virtual wxString GetName() { return m_Name; }
849 virtual wxString GetDescription() { return m_Description; }
861 virtual wxString GetID() { return m_ID; }
875 virtual wxString GetSE() { return m_SE; }
891 virtual wxString GetDepthUnits() { return m_DepthUnits; }
908 virtual wxString GetSoundingsDatum() { return m_SoundingsDatum; }
924 virtual wxString GetDatumString() { return m_datum_str; }
938 virtual wxString GetExtraInfo() { return m_ExtraInfo; }
951 virtual wxString GetPubDate() { return m_PubYear; }
965 virtual double GetChartErrorFactor() { return m_Chart_Error_Factor; }
981 virtual ChartDepthUnitTypePI GetDepthUnitId() { return m_depth_unit_id; }
996 virtual bool IsReadyToRender() { return m_bReadyToRender; }
1009 virtual int GetNativeScale() { return m_Chart_Scale; };
1022 virtual double GetChartSkew() { return m_Chart_Skew; }
1035 virtual wxDateTime GetEditionDate(void) { return m_EdDate; }
1036
1037 // Methods pertaining to CHART_FAMILY_RASTER type PlugIn charts only
1038
1057 virtual void ComputeSourceRectangle(const PlugIn_ViewPort &vp,
1058 wxRect *pSourceRect);
1059
1074 virtual double GetRasterScaleFactor();
1095 virtual bool GetChartBits(wxRect &source, unsigned char *pPix, int sub_samp);
1107 virtual int GetSize_X();
1119 virtual int GetSize_Y();
1134 virtual void latlong_to_chartpix(double lat, double lon, double &pixx,
1135 double &pixy);
1150 virtual void chartpix_to_latlong(double pixx, double pixy, double *plat,
1151 double *plon);
1152
1153protected:
1154 ChartTypeEnumPI m_ChartType;
1155 ChartFamilyEnumPI m_ChartFamily;
1156
1157 wxString m_FullPath;
1158 OcpnProjTypePI m_projection;
1159 int m_Chart_Scale;
1160 double m_Chart_Skew;
1161
1162 wxDateTime m_EdDate;
1163 bool m_bReadyToRender;
1164
1165 wxString m_Name;
1166 wxString m_Description;
1167 wxString m_ID;
1168 wxString m_SE;
1169 wxString m_SoundingsDatum;
1170 wxString m_datum_str;
1171 wxString m_PubYear;
1172 wxString m_DepthUnits;
1173 wxString m_ExtraInfo;
1174
1175 ChartDepthUnitTypePI m_depth_unit_id;
1176
1177 double m_Chart_Error_Factor;
1178};
1179
1180// Declare an array of PlugIn_AIS_Targets
1181WX_DEFINE_ARRAY_PTR(PlugIn_AIS_Target *, ArrayOfPlugIn_AIS_Targets);
1182
1197class DECL_EXP opencpn_plugin {
1198public:
1199 opencpn_plugin(void *pmgr) {}
1200 virtual ~opencpn_plugin();
1201
1202 // Public API to the PlugIn class
1203
1204 // This group of methods is required, and will be called by the opencpn
1205 // host opencpn PlugIns must implement this group
1206
1221 virtual int Init(void);
1230 virtual bool DeInit(void);
1231
1244 virtual int GetAPIVersionMajor();
1257 virtual int GetAPIVersionMinor();
1269 virtual int GetPlugInVersionMajor();
1281 virtual int GetPlugInVersionMinor();
1294 virtual wxBitmap *GetPlugInBitmap();
1295
1296 // These three methods should produce valid, meaningful strings always
1297 // ---EVEN IF--- the PlugIn has not (yet) been initialized.
1298 // They are used by the PlugInManager GUI
1299
1311 virtual wxString GetCommonName();
1323 virtual wxString GetShortDescription();
1337 virtual wxString GetLongDescription();
1338
1339 // This group is optional.
1340 // PlugIns may override any of these methods as required
1341
1353 virtual void SetDefaults(void);
1354
1368 virtual int GetToolbarToolCount(void);
1381 virtual int GetToolboxPanelCount(void);
1395 virtual void SetupToolboxPanel(int page_sel, wxNotebook *pnotebook);
1411 virtual void OnCloseToolboxPanel(int page_sel, int ok_apply_cancel);
1425 virtual void ShowPreferencesDialog(wxWindow *parent);
1426
1452 virtual bool RenderOverlay(wxMemoryDC *pmdc, PlugIn_ViewPort *vp);
1465 virtual void SetCursorLatLon(double lat, double lon);
1484 virtual void SetCurrentViewPort(PlugIn_ViewPort &vp);
1485
1504 virtual void SetPositionFix(PlugIn_Position_Fix &pfix);
1518 virtual void SetNMEASentence(wxString &sentence);
1535 virtual void SetAISSentence(wxString &sentence);
1536
1546 virtual void ProcessParentResize(int x, int y);
1558 virtual void SetColorScheme(PI_ColorScheme cs);
1559
1568 virtual void OnToolbarToolCallback(int id);
1577 virtual void OnContextMenuItemCallback(int id);
1585 virtual void UpdateAuiStatus(void);
1586
1598 virtual wxArrayString GetDynamicChartClassNameArray(void);
1599};
1600
1601// the types of the class factories used to create PlugIn instances
1602typedef opencpn_plugin *create_t(void *);
1603typedef void destroy_t(opencpn_plugin *);
1604
1605#ifdef __clang__
1606#pragma clang diagnostic push
1607#pragma clang diagnostic ignored "-Woverloaded-virtual"
1608#endif
1609
1610class DECL_EXP opencpn_plugin_16 : public opencpn_plugin {
1611public:
1612 opencpn_plugin_16(void *pmgr);
1613 virtual ~opencpn_plugin_16();
1614
1616
1634 virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
1649 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
1650};
1651
1652class DECL_EXP opencpn_plugin_17 : public opencpn_plugin {
1653public:
1654 opencpn_plugin_17(void *pmgr);
1655 virtual ~opencpn_plugin_17();
1656
1658
1659 virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
1660 virtual bool RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp);
1661
1662 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
1663};
1664
1665class DECL_EXP opencpn_plugin_18 : public opencpn_plugin {
1666public:
1667 opencpn_plugin_18(void *pmgr);
1668 virtual ~opencpn_plugin_18();
1669
1671
1672 virtual bool RenderOverlay(wxDC &dc, PlugIn_ViewPort *vp);
1694 virtual bool RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp);
1695 virtual void SetPluginMessage(wxString &message_id, wxString &message_body);
1710 virtual void SetPositionFixEx(PlugIn_Position_Fix_Ex &pfix);
1711};
1712
1713#ifdef __clang__
1714#pragma clang diagnostic pop
1715#endif
1716
1717class DECL_EXP opencpn_plugin_19 : public opencpn_plugin_18 {
1718public:
1719 opencpn_plugin_19(void *pmgr);
1720 virtual ~opencpn_plugin_19();
1721
1728 virtual void OnSetupOptions(void);
1729};
1730
1731class DECL_EXP opencpn_plugin_110 : public opencpn_plugin_19 {
1732public:
1733 opencpn_plugin_110(void *pmgr);
1734 virtual ~opencpn_plugin_110();
1735
1736 virtual void LateInit(void); // If WANTS_LATE_INIT is returned by Init()
1737};
1738
1740public:
1741 opencpn_plugin_111(void *pmgr);
1742 virtual ~opencpn_plugin_111();
1743};
1744
1746public:
1747 opencpn_plugin_112(void *pmgr);
1748 virtual ~opencpn_plugin_112();
1749
1759 virtual bool MouseEventHook(wxMouseEvent &event);
1774 virtual void SendVectorChartObjectInfo(wxString &chart, wxString &feature,
1775 wxString &objname, double lat,
1776 double lon, double scale,
1777 int nativescale);
1778};
1779
1781public:
1782 opencpn_plugin_113(void *pmgr);
1783 virtual ~opencpn_plugin_113();
1784
1794 virtual bool KeyboardEventHook(wxKeyEvent &event);
1802 virtual void OnToolbarToolDownCallback(int id);
1810 virtual void OnToolbarToolUpCallback(int id);
1811};
1812
1814public:
1815 opencpn_plugin_114(void *pmgr);
1816 virtual ~opencpn_plugin_114();
1817};
1818
1820public:
1821 opencpn_plugin_115(void *pmgr);
1822 virtual ~opencpn_plugin_115();
1823};
1824
1826public:
1827 opencpn_plugin_116(void *pmgr);
1828 virtual ~opencpn_plugin_116();
1841 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
1842 PlugIn_ViewPort *vp, int canvasIndex);
1855 virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp,
1856 int canvasIndex);
1865 virtual void PrepareContextMenu(int canvasIndex);
1866};
1867
1869public:
1870 opencpn_plugin_117(void *pmgr);
1877 virtual int GetPlugInVersionPatch();
1878
1880 virtual int GetPlugInVersionPost();
1881
1883 virtual const char *GetPlugInVersionPre();
1884
1886 virtual const char *GetPlugInVersionBuild();
1887
1888 /*Provide active leg data to plugins*/
1889 virtual void SetActiveLegInfo(Plugin_Active_Leg_Info &leg_info);
1890};
1891
1893public:
1894 opencpn_plugin_118(void *pmgr);
1895
1898
1907#ifdef _MSC_VER
1908 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
1909 PlugIn_ViewPort *vp, int canvasIndex,
1910 int priority = -1);
1911#else
1912 virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext,
1913 PlugIn_ViewPort *vp, int canvasIndex,
1914 int priority);
1915
1916 bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp,
1917 int canvas_ix) override {
1918 return RenderGLOverlayMultiCanvas(pcontext, vp, canvas_ix, -1);
1919 }
1920#endif
1921
1930#ifdef _MSC_VER
1931 virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp,
1932 int canvasIndex, int priority = -1);
1933#else
1934 virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp,
1935 int canvas_ix, int priority);
1937 int canvas_ix) override {
1938 return RenderOverlayMultiCanvas(dc, vp, canvas_ix, -1);
1939 }
1940#endif
1941};
1942
1944public:
1945 opencpn_plugin_119(void *pmgr);
1946
1965 virtual void PreShutdownHook();
1966};
1967
1968//------------------------------------------------------------------
1969// Route and Waypoint PlugIn support
1970//
1971//------------------------------------------------------------------
1972
1984class DECL_EXP Plugin_Hyperlink {
1985public:
1986 wxString DescrText;
1987 wxString Link;
1988 wxString Type;
1989};
1990
1991WX_DECLARE_LIST(Plugin_Hyperlink, Plugin_HyperlinkList);
1992
2007class DECL_EXP PlugIn_Waypoint {
2008public:
2022 PlugIn_Waypoint(double lat, double lon, const wxString &icon_ident,
2023 const wxString &wp_name, const wxString &GUID = _T(""));
2025
2026 double m_lat;
2027 double m_lon;
2028 wxString m_GUID;
2029 wxString m_MarkName;
2031 wxDateTime m_CreateTime;
2033 wxString m_IconName;
2034
2035 Plugin_HyperlinkList *m_HyperlinkList;
2036};
2037
2038WX_DECLARE_LIST(PlugIn_Waypoint, Plugin_WaypointList);
2039
2046class DECL_EXP PlugIn_Route {
2047public:
2048 PlugIn_Route(void);
2049 ~PlugIn_Route(void);
2050
2051 wxString m_NameString;
2052 wxString m_StartString;
2053 wxString m_EndString;
2054 wxString m_GUID;
2055
2060 Plugin_WaypointList *pWaypointList;
2061};
2062
2076class DECL_EXP PlugIn_Track {
2077public:
2078 PlugIn_Track(void);
2079 ~PlugIn_Track(void);
2080
2081 wxString m_NameString;
2082 wxString m_StartString;
2083 wxString m_EndString;
2084 wxString m_GUID;
2085
2092 Plugin_WaypointList *pWaypointList;
2093};
2094
2095//----------------------------------------------------------------------------------------------------------
2096// The PlugIn CallBack API Definition
2097//
2098// The API back up to the PlugIn Manager
2099// PlugIns may call these static functions as necessary for system services
2100//
2101//----------------------------------------------------------------------------------------------------------
2102
2123extern "C" DECL_EXP int InsertPlugInTool(wxString label, wxBitmap *bitmap,
2124 wxBitmap *bmpRollover, wxItemKind kind,
2125 wxString shortHelp, wxString longHelp,
2126 wxObject *clientData, int position,
2127 int tool_sel, opencpn_plugin *pplugin);
2135extern "C" DECL_EXP void RemovePlugInTool(int tool_id);
2144extern "C" DECL_EXP void SetToolbarToolViz(int item, bool viz);
2153extern "C" DECL_EXP void SetToolbarItemState(int item, bool toggle);
2163extern "C" DECL_EXP void SetToolbarToolBitmaps(int item, wxBitmap *bitmap,
2164 wxBitmap *bmpRollover);
2183extern "C" DECL_EXP int InsertPlugInToolSVG(
2184 wxString label, wxString SVGfile, wxString SVGfileRollover,
2185 wxString SVGfileToggled, wxItemKind kind, wxString shortHelp,
2186 wxString longHelp, wxObject *clientData, int position, int tool_sel,
2187 opencpn_plugin *pplugin);
2198extern "C" DECL_EXP void SetToolbarToolBitmapsSVG(int item, wxString SVGfile,
2199 wxString SVGfileRollover,
2200 wxString SVGfileToggled);
2210extern "C" DECL_EXP int AddCanvasContextMenuItem(wxMenuItem *pitem,
2211 opencpn_plugin *pplugin);
2219extern "C" DECL_EXP void RemoveCanvasContextMenuItem(int item);
2228extern "C" DECL_EXP void SetCanvasContextMenuItemViz(int item, bool viz);
2237extern "C" DECL_EXP void SetCanvasContextMenuItemGrey(int item, bool grey);
2238
2248extern "C" DECL_EXP wxFileConfig *GetOCPNConfigObject(void);
2249
2257extern "C" DECL_EXP void RequestRefresh(wxWindow *);
2267extern "C" DECL_EXP bool GetGlobalColor(wxString colorName, wxColour *pcolour);
2268
2280extern "C" DECL_EXP void GetCanvasPixLL(PlugIn_ViewPort *vp, wxPoint *pp,
2281 double lat, double lon);
2293extern "C" DECL_EXP void GetCanvasLLPix(PlugIn_ViewPort *vp, wxPoint p,
2294 double *plat, double *plon);
2302extern "C" DECL_EXP wxWindow *GetOCPNCanvasWindow();
2303
2342extern "C" DECL_EXP wxFont *OCPNGetFont(wxString TextElement,
2343 int default_size = 0);
2344
2357extern "C" DECL_EXP wxString *GetpSharedDataLocation();
2366extern "C" DECL_EXP ArrayOfPlugIn_AIS_Targets *GetAISTargetArray(void);
2376extern "C" DECL_EXP wxAuiManager *GetFrameAuiManager(void);
2385extern "C" DECL_EXP bool AddLocaleCatalog(wxString catalog);
2386
2394extern "C" DECL_EXP void PushNMEABuffer(wxString str);
2395
2405extern DECL_EXP wxXmlDocument GetChartDatabaseEntryXML(int dbIndex,
2406 bool b_getGeom);
2417extern DECL_EXP bool UpdateChartDBInplace(wxArrayString dir_array,
2418 bool b_force_update,
2419 bool b_ProgressDialog);
2427extern DECL_EXP wxArrayString GetChartDBDirArrayString();
2428
2437extern "C" DECL_EXP void SendPluginMessage(wxString message_id,
2438 wxString message_body);
2446extern "C" DECL_EXP void DimeWindow(wxWindow *);
2447
2455extern "C" DECL_EXP void JumpToPosition(double lat, double lon, double scale);
2456
2457/* API 1.9 adds some common cartographic functions to avoid unnecessary code
2458 * duplication */
2459/* Study the original OpenCPN source (georef.c) for functional definitions */
2460
2472extern "C" DECL_EXP void PositionBearingDistanceMercator_Plugin(
2473 double lat, double lon, double brg, double dist, double *dlat,
2474 double *dlon);
2486extern "C" DECL_EXP void DistanceBearingMercator_Plugin(
2487 double lat0, double lon0, double lat1, double lon1, double *brg,
2488 double *dist);
2498extern "C" DECL_EXP double DistGreatCircle_Plugin(double slat, double slon,
2499 double dlat, double dlon);
2510extern "C" DECL_EXP void toTM_Plugin(float lat, float lon, float lat0,
2511 float lon0, double *x, double *y);
2522extern "C" DECL_EXP void fromTM_Plugin(double x, double y, double lat0,
2523 double lon0, double *lat, double *lon);
2534extern "C" DECL_EXP void toSM_Plugin(double lat, double lon, double lat0,
2535 double lon0, double *x, double *y);
2546extern "C" DECL_EXP void fromSM_Plugin(double x, double y, double lat0,
2547 double lon0, double *lat, double *lon);
2558extern "C" DECL_EXP void toSM_ECC_Plugin(double lat, double lon, double lat0,
2559 double lon0, double *x, double *y);
2570extern "C" DECL_EXP void fromSM_ECC_Plugin(double x, double y, double lat0,
2571 double lon0, double *lat,
2572 double *lon);
2583extern "C" DECL_EXP bool DecodeSingleVDOMessage(const wxString &str,
2585 wxString *acc);
2591extern "C" DECL_EXP int GetChartbarHeight(void);
2622extern "C" DECL_EXP bool GetActiveRoutepointGPX(char *buffer,
2623 unsigned int buffer_length);
2624
2625/* API 1.9 */
2626
2655
2670extern DECL_EXP wxScrolledWindow *AddOptionsPage(OptionsParentPI parent,
2671 wxString title);
2678extern DECL_EXP bool DeleteOptionsPage(wxScrolledWindow *page);
2679
2680/* API 1.10 */
2681
2682/* API 1.10 adds some common functions to avoid unnecessary code duplication */
2683/* Study the original OpenCPN source for functional definitions */
2694extern "C" DECL_EXP double toUsrDistance_Plugin(double nm_distance,
2695 int unit = -1);
2704extern "C" DECL_EXP double fromUsrDistance_Plugin(double usr_distance,
2705 int unit = -1);
2714extern "C" DECL_EXP double toUsrSpeed_Plugin(double kts_speed, int unit = -1);
2723extern "C" DECL_EXP double fromUsrSpeed_Plugin(double usr_speed, int unit = -1);
2732extern "C" DECL_EXP double toUsrTemp_Plugin(double cel_temp, int unit = -1);
2741extern "C" DECL_EXP double fromUsrTemp_Plugin(double usr_temp, int unit = -1);
2749extern DECL_EXP wxString getUsrDistanceUnit_Plugin(int unit = -1);
2757extern DECL_EXP wxString getUsrSpeedUnit_Plugin(int unit = -1);
2765extern DECL_EXP wxString getUsrTempUnit_Plugin(int unit = -1);
2766
2774extern DECL_EXP wxString getUsrWindSpeedUnit_Plugin(int unit = -1);
2775
2784extern DECL_EXP double toUsrWindSpeed_Plugin(double kts_wspeed, int unit = -1);
2785
2794extern DECL_EXP double fromUsrWindSpeed_Plugin(double usr_wspeed,
2795 int unit = -1);
2796
2804extern DECL_EXP wxString getUsrDepthUnit_Plugin(int unit = -1);
2805
2814extern DECL_EXP double toUsrDepth_Plugin(double m_depth, int unit = -1);
2815
2824extern DECL_EXP double fromUsrDepth_Plugin(double usr_depth, int unit = -1);
2825
2842extern DECL_EXP double fromDMM_PlugIn(wxString sdms);
2843
2858 DateTimeFormatOptions() = default;
2878 wxString format_string = "$weekday_short_date_time";
2894 wxString time_zone = wxEmptyString;
2899 double longitude = NAN;
2900
2901 int version = 1; // For future compatibility checks
2902
2922 format_string = fmt;
2923 return *this;
2924 }
2925
2944 DateTimeFormatOptions &SetTimezone(const wxString &tz) {
2945 time_zone = tz;
2946 return *this;
2947 }
2948
2967 longitude = lon;
2968 return *this;
2969 }
2970};
2971
2989extern DECL_EXP wxString toUsrDateTimeFormat_Plugin(
2990 const wxDateTime date_time,
2992
3004extern DECL_EXP wxString GetNewGUID();
3017extern "C" DECL_EXP bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1,
3018 double lat2, double lon2);
3025extern DECL_EXP void PlugInPlaySound(wxString &sound_file);
3026
3027// API 1.10 Route and Waypoint Support
3028
3037extern DECL_EXP wxBitmap *FindSystemWaypointIcon(wxString &icon_name);
3048extern DECL_EXP bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key,
3049 wxString description);
3059extern DECL_EXP bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint,
3060 bool b_permanent = true);
3069extern DECL_EXP bool DeleteSingleWaypoint(wxString &GUID);
3078extern DECL_EXP bool UpdateSingleWaypoint(PlugIn_Waypoint *pwaypoint);
3088extern DECL_EXP bool AddPlugInRoute(PlugIn_Route *proute,
3089 bool b_permanent = true);
3098extern DECL_EXP bool DeletePlugInRoute(wxString &GUID);
3108extern DECL_EXP bool UpdatePlugInRoute(PlugIn_Route *proute);
3109
3119extern DECL_EXP bool AddPlugInTrack(PlugIn_Track *ptrack,
3120 bool b_permanent = true);
3129extern DECL_EXP bool DeletePlugInTrack(wxString &GUID);
3139extern DECL_EXP bool UpdatePlugInTrack(PlugIn_Track *ptrack);
3140
3141/* API 1.11 */
3142
3143/* API 1.11 adds some more common functions to avoid unnecessary code
3144 * duplication */
3145
3154wxColour DECL_EXP GetBaseGlobalColor(wxString colorName);
3155
3169int DECL_EXP OCPNMessageBox_PlugIn(wxWindow *parent, const wxString &message,
3170 const wxString &caption = _T("Message"),
3171 int style = wxOK, int x = -1, int y = -1);
3172
3187extern DECL_EXP wxString toSDMM_PlugIn(int NEflag, double a,
3188 bool hi_precision = true);
3198extern "C" DECL_EXP wxString *GetpPrivateApplicationDataLocation();
3206extern DECL_EXP wxString GetOCPN_ExePath(void);
3215extern "C" DECL_EXP wxString *GetpPlugInLocation();
3224extern DECL_EXP wxString GetPlugInPath(opencpn_plugin *pplugin);
3225
3235extern "C" DECL_EXP int AddChartToDBInPlace(wxString &full_path,
3236 bool b_RefreshCanvas);
3243extern "C" DECL_EXP int RemoveChartFromDBInPlace(wxString &full_path);
3252extern DECL_EXP wxString GetLocaleCanonicalName();
3253
3268#define PLIB_CAPS_LINE_VBO 1
3272#define PLIB_CAPS_LINE_BUFFER 1 << 1
3276#define PLIB_CAPS_SINGLEGEO_BUFFER 1 << 2
3280#define PLIB_CAPS_OBJSEGLIST 1 << 3
3284#define PLIB_CAPS_OBJCATMUTATE 1 << 4
3285
3286class PI_S57Obj;
3287
3288WX_DECLARE_LIST(PI_S57Obj, ListOfPI_S57Obj);
3289
3290// ----------------------------------------------------------------------------
3291// PlugInChartBaseGL
3292// Derived from PlugInChartBase, add OpenGL Vector chart support
3293// ----------------------------------------------------------------------------
3294
3307class DECL_EXP PlugInChartBaseGL : public PlugInChartBase {
3308public:
3310 virtual ~PlugInChartBaseGL();
3311
3326 virtual int RenderRegionViewOnGL(const wxGLContext &glc,
3327 const PlugIn_ViewPort &VPoint,
3328 const wxRegion &Region, bool b_use_stencil);
3329
3342 virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(float lat, float lon,
3343 float select_radius,
3344 PlugIn_ViewPort *VPoint);
3354 virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list);
3360 virtual int GetNoCOVREntries();
3367 virtual int GetNoCOVRTablePoints(int iTable);
3374 virtual int GetNoCOVRTablenPoints(int iTable);
3381 virtual float *GetNoCOVRTableHead(int iTable);
3382};
3383
3384// ----------------------------------------------------------------------------
3385// PlugInChartBaseGLPlus2
3386// Derived from PlugInChartBaseGL, add additional chart management methods
3387// ----------------------------------------------------------------------------
3388
3398public:
3400 virtual ~PlugInChartBaseGLPlus2();
3401
3418 virtual ListOfPI_S57Obj *GetLightsObjRuleListVisibleAtLatLon(
3419 float lat, float lon, PlugIn_ViewPort *VPoint);
3420};
3421
3422// ----------------------------------------------------------------------------
3423// PlugInChartBaseExtended
3424// Derived from PlugInChartBase, add extended chart support methods
3425// ----------------------------------------------------------------------------
3426
3435public:
3437 virtual ~PlugInChartBaseExtended();
3438
3451 virtual int RenderRegionViewOnGL(const wxGLContext &glc,
3452 const PlugIn_ViewPort &VPoint,
3453 const wxRegion &Region, bool b_use_stencil);
3454
3465 virtual wxBitmap &RenderRegionViewOnDCNoText(const PlugIn_ViewPort &VPoint,
3466 const wxRegion &Region);
3477 virtual bool RenderRegionViewOnDCTextOnly(wxMemoryDC &dc,
3478 const PlugIn_ViewPort &VPoint,
3479 const wxRegion &Region);
3491 virtual int RenderRegionViewOnGLNoText(const wxGLContext &glc,
3492 const PlugIn_ViewPort &VPoint,
3493 const wxRegion &Region,
3494 bool b_use_stencil);
3495
3507 virtual int RenderRegionViewOnGLTextOnly(const wxGLContext &glc,
3508 const PlugIn_ViewPort &VPoint,
3509 const wxRegion &Region,
3510 bool b_use_stencil);
3511
3512 virtual ListOfPI_S57Obj *GetObjRuleListAtLatLon(float lat, float lon,
3513 float select_radius,
3514 PlugIn_ViewPort *VPoint);
3515 virtual wxString CreateObjDescriptions(ListOfPI_S57Obj *obj_list);
3516
3517 virtual int GetNoCOVREntries();
3518 virtual int GetNoCOVRTablePoints(int iTable);
3519 virtual int GetNoCOVRTablenPoints(int iTable);
3520 virtual float *GetNoCOVRTableHead(int iTable);
3527 virtual void ClearPLIBTextList();
3528};
3529
3530// ----------------------------------------------------------------------------
3531// PlugInChartBaseExtendedPlus2
3532// Derived from PlugInChartBaseExtended, add additional extended chart support
3533// methods
3534// ----------------------------------------------------------------------------
3535
3537public:
3540
3541 virtual ListOfPI_S57Obj *GetLightsObjRuleListVisibleAtLatLon(
3542 float lat, float lon, PlugIn_ViewPort *VPoint);
3543};
3544
3545class wxArrayOfS57attVal;
3546
3565
3589
3618
3632
3658
3666class DECL_EXP PI_S57Obj {
3667public:
3668 // Public Methods
3669 PI_S57Obj();
3670
3671public:
3672 // Instance Data
3673 char FeatureName[8];
3675
3677 wxArrayOfS57attVal *attVal;
3679
3680 int iOBJL;
3681 int Index;
3682
3683 double x;
3684 double y;
3685 double z;
3686 int npt;
3687 void *geoPt;
3688 double *geoPtz;
3689 double *geoPtMulti;
3690
3692
3693 double m_lat;
3694 double m_lon;
3695
3698
3699 double lat_min;
3700 double lat_max;
3701 double lon_min;
3702 double lon_max;
3703
3705
3707 int nRef;
3708
3709 bool bIsAton;
3711
3716
3718
3722
3723 // Coordinate transform coefficients
3724 double x_rate;
3725 double y_rate;
3726 double x_origin;
3727 double y_origin;
3728
3729 // OpenGL rendering parameters
3734
3738};
3739
3745wxString DECL_EXP PI_GetPLIBColorScheme();
3754int DECL_EXP PI_GetPLIBDepthUnitInt();
3762int DECL_EXP PI_GetPLIBSymbolStyle();
3770int DECL_EXP PI_GetPLIBBoundaryStyle();
3777int DECL_EXP PI_GetPLIBStateHash();
3783double DECL_EXP PI_GetPLIBMarinerSafetyContour();
3794bool DECL_EXP PI_GetObjectRenderBox(PI_S57Obj *pObj, double *lat_min,
3795 double *lat_max, double *lon_min,
3796 double *lon_max);
3802void DECL_EXP PI_UpdateContext(PI_S57Obj *pObj);
3803
3811bool DECL_EXP PI_PLIBObjectRenderCheck(PI_S57Obj *pObj, PlugIn_ViewPort *vp);
3844void DECL_EXP PI_PLIBSetLineFeaturePriority(PI_S57Obj *pObj, int prio);
3849void DECL_EXP PI_PLIBPrepareForNewRender(void);
3855void DECL_EXP PI_PLIBFreeContext(void *pContext);
3865void DECL_EXP PI_PLIBSetRenderCaps(unsigned int flags);
3875bool DECL_EXP PI_PLIBSetContext(PI_S57Obj *pObj);
3876
3891int DECL_EXP PI_PLIBRenderObjectToDC(wxDC *pdc, PI_S57Obj *pObj,
3892 PlugIn_ViewPort *vp);
3909int DECL_EXP PI_PLIBRenderAreaToDC(wxDC *pdc, PI_S57Obj *pObj,
3910 PlugIn_ViewPort *vp, wxRect rect,
3911 unsigned char *pixbuf);
3912
3927int DECL_EXP PI_PLIBRenderAreaToGL(const wxGLContext &glcc, PI_S57Obj *pObj,
3928 PlugIn_ViewPort *vp, wxRect &render_rect);
3929
3946int DECL_EXP PI_PLIBRenderObjectToGL(const wxGLContext &glcc, PI_S57Obj *pObj,
3947 PlugIn_ViewPort *vp, wxRect &render_rect);
3948
3949/* API 1.11 OpenGL Display List and vertex buffer object routines
3950
3951 Effectively these two routines cancel each other so all
3952 of the translation, scaling and rotation can be done by opengl.
3953
3954 Display lists need only be built infrequently, but used in each frame
3955 greatly accelerates the speed of rendering. This avoids costly calculations,
3956 and also allows the vertexes to be stored in graphics memory.
3957
3958 static int dl = 0;
3959 glPushMatrix();
3960 PlugInMultMatrixViewport(current_viewport);
3961 if(dl)
3962 glCallList(dl);
3963 else {
3964 dl = glGenLists(1);
3965 PlugInViewPort norm_viewport = current_viewport;
3966 NormalizeViewPort(norm_viewport);
3967 glNewList(dl, GL_COMPILE_AND_EXECUTE);
3968 ... // use norm_viewport with GetCanvasLLPix here
3969 glEndList();
3970 }
3971 glPopMatrix();
3972 ... // use current_viewport with GetCanvasLLPix again
3973*/
3974
3984extern DECL_EXP bool PlugInHasNormalizedViewPort(PlugIn_ViewPort *vp);
3999extern DECL_EXP void PlugInMultMatrixViewport(PlugIn_ViewPort *vp,
4000 float lat = 0, float lon = 0);
4015extern DECL_EXP void PlugInNormalizeViewport(PlugIn_ViewPort *vp, float lat = 0,
4016 float lon = 0);
4017
4018class wxPoint2DDouble;
4030extern "C" DECL_EXP void GetDoubleCanvasPixLL(PlugIn_ViewPort *vp,
4031 wxPoint2DDouble *pp, double lat,
4032 double lon);
4033
4034/* API 1.13 */
4035/* API 1.13 adds some more common functions to avoid unnecessary code
4036 * duplication */
4037
4046extern DECL_EXP double fromDMM_Plugin(wxString sdms);
4057extern DECL_EXP void SetCanvasRotation(double rotation);
4069extern DECL_EXP void SetCanvasProjection(int projection);
4079extern DECL_EXP bool GetSingleWaypoint(wxString GUID,
4080 PlugIn_Waypoint *pwaypoint);
4093extern DECL_EXP bool CheckEdgePan_PlugIn(int x, int y, bool dragging,
4094 int margin, int delta);
4103extern DECL_EXP wxBitmap GetIcon_PlugIn(const wxString &name);
4111extern DECL_EXP void SetCursor_PlugIn(wxCursor *pPlugin_Cursor = NULL);
4147extern DECL_EXP wxFont *GetOCPNScaledFont_PlugIn(wxString TextElement,
4148 int default_size = 0);
4162extern DECL_EXP wxFont GetOCPNGUIScaledFont_PlugIn(wxString item);
4178extern DECL_EXP double GetOCPNGUIToolScaleFactor_PlugIn(int GUIScaledFactor);
4193extern DECL_EXP double GetOCPNGUIToolScaleFactor_PlugIn();
4208extern DECL_EXP float GetOCPNChartScaleFactor_Plugin();
4216extern DECL_EXP wxColour GetFontColour_PlugIn(wxString TextElement);
4217
4228extern DECL_EXP double GetCanvasTilt();
4239extern DECL_EXP void SetCanvasTilt(double tilt);
4240
4246extern DECL_EXP bool PlugInPlaySoundEx(wxString &sound_file,
4247 int deviceIndex = -1);
4260extern DECL_EXP void AddChartDirectory(wxString &path);
4271extern DECL_EXP void ForceChartDBUpdate();
4283extern DECL_EXP void ForceChartDBRebuild();
4284
4290extern DECL_EXP wxString GetWritableDocumentsDir(void);
4296extern DECL_EXP wxDialog *GetActiveOptionsDialog();
4307extern DECL_EXP wxArrayString GetWaypointGUIDArray(void);
4313extern DECL_EXP wxArrayString GetIconNameArray(void);
4314
4325extern DECL_EXP bool AddPersistentFontKey(wxString TextElement);
4337extern DECL_EXP wxString GetActiveStyleName();
4338
4354extern DECL_EXP wxBitmap GetBitmapFromSVGFile(wxString filename,
4355 unsigned int width,
4356 unsigned int height);
4369extern DECL_EXP bool IsTouchInterface_PlugIn(void);
4370
4371/* Platform optimized File/Dir selector dialogs */
4390extern DECL_EXP int PlatformDirSelectorDialog(wxWindow *parent,
4391 wxString *file_spec,
4392 wxString Title, wxString initDir);
4414extern DECL_EXP int PlatformFileSelectorDialog(wxWindow *parent,
4415 wxString *file_spec,
4416 wxString Title, wxString initDir,
4417 wxString suggestedName,
4418 wxString wildcard);
4419
4420/* OpenCPN HTTP File Download PlugIn Interface */
4421
4422/* Various method Return Codes, etc */
4437
4450
4451// Style definitions for Synchronous file download modal dialogs, if
4452// desired. Abstracted from wxCURL package
4456 0x0002,
4459 OCPN_DLDS_SIZE = 0x0010,
4462 0x0020,
4463
4464 // styles related to the use of wxCurlConnectionSettingsDialog:
4465
4467 0x0040,
4472 0x0100,
4473
4474 OCPN_DLDS_CONN_SETTINGS_ALL = OCPN_DLDS_CONN_SETTINGS_AUTH |
4477
4478 OCPN_DLDS_SHOW_ALL = OCPN_DLDS_ELAPSED_TIME | OCPN_DLDS_ESTIMATED_TIME |
4481 OCPN_DLDS_CONN_SETTINGS_ALL,
4482
4484 OCPN_DLDS_CAN_START = 0x0400,
4487
4489 0x1000,
4490
4491 // by default all available features are enabled:
4492 OCPN_DLDS_DEFAULT_STYLE = OCPN_DLDS_CAN_START | OCPN_DLDS_CAN_PAUSE |
4493 OCPN_DLDS_CAN_ABORT | OCPN_DLDS_SHOW_ALL |
4495};
4496
4497#define ONLINE_CHECK_RETRY \
4498 30 // Recheck the Internet connection availability every ONLINE_CHECK_RETRY s
4499
4520extern DECL_EXP _OCPN_DLStatus OCPN_downloadFile(
4521 const wxString &url, const wxString &outputFile, const wxString &title,
4522 const wxString &message, const wxBitmap &bitmap, wxWindow *parent,
4523 long style, int timeout_secs);
4524
4542extern DECL_EXP _OCPN_DLStatus
4543OCPN_downloadFileBackground(const wxString &url, const wxString &outputFile,
4544 wxEvtHandler *handler, long *handle);
4545
4551extern DECL_EXP void OCPN_cancelDownloadFileBackground(long handle);
4552
4564extern DECL_EXP _OCPN_DLStatus OCPN_postDataHttp(const wxString &url,
4565 const wxString &parameters,
4566 wxString &result,
4567 int timeout_secs);
4568
4574extern DECL_EXP bool OCPN_isOnline();
4575
4576/* Supporting Event for Background downloading */
4577/* OCPN_downloadEvent Definition */
4578
4579/* PlugIn should be ready/able to handle this event after initiating a
4580 * background file transfer
4581 *
4582 * The event as received should be parsed primarily by the getDLEventCondition()
4583 * method. This will allow identification of download start, progress, and end
4584 * states.
4585 *
4586 * Other accessor methods contain status, byte counts, etc.
4587 *
4588 * A PlugIn may safely destroy its EvtHandler after receipt of an
4589 * OCPN_downloadEvent with getDLEventCondition == OCPN_DL_EVENT_TYPE_END
4590 */
4591
4592class DECL_EXP OCPN_downloadEvent : public wxEvent {
4593public:
4594 OCPN_downloadEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
4596
4597 // accessors
4598 _OCPN_DLStatus getDLEventStatus() { return m_stat; }
4599 OCPN_DLCondition getDLEventCondition() { return m_condition; }
4600
4601 void setDLEventStatus(_OCPN_DLStatus stat) { m_stat = stat; }
4602 void setDLEventCondition(OCPN_DLCondition cond) { m_condition = cond; }
4603
4604 void setTotal(long bytes) { m_totalBytes = bytes; }
4605 void setTransferred(long bytes) { m_sofarBytes = bytes; }
4606 long getTotal() { return m_totalBytes; }
4607 long getTransferred() { return m_sofarBytes; }
4608
4609 void setComplete(bool b_complete) { m_b_complete = b_complete; }
4610 bool getComplete() { return m_b_complete; }
4611
4612 // required for sending with wxPostEvent()
4613 wxEvent *Clone() const;
4614
4615private:
4616 OCPN_DLStatus m_stat;
4617 OCPN_DLCondition m_condition;
4618
4619 long m_totalBytes;
4620 long m_sofarBytes;
4621 bool m_b_complete;
4622};
4623
4624// extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DOWNLOAD_EVENT;
4625
4626#ifdef MAKING_PLUGIN
4627extern DECL_IMP wxEventType wxEVT_DOWNLOAD_EVENT;
4628#else
4629extern DECL_EXP wxEventType wxEVT_DOWNLOAD_EVENT;
4630#endif
4631
4632/* API 1.14 */
4633/* API 1.14 adds some more common functions to avoid unnecessary code
4634 * duplication */
4635
4636bool LaunchDefaultBrowser_Plugin(wxString url);
4637
4638// API 1.14 Extra canvas Support
4639
4655extern DECL_EXP void PlugInAISDrawGL(wxGLCanvas *glcanvas,
4656 const PlugIn_ViewPort &vp);
4666extern DECL_EXP bool PlugInSetFontColor(const wxString TextElement,
4667 const wxColour color);
4668
4669// API 1.15
4670
4685extern DECL_EXP double PlugInGetDisplaySizeMM();
4686
4699extern DECL_EXP wxFont *FindOrCreateFont_PlugIn(
4700 int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight,
4701 bool underline = false, const wxString &facename = wxEmptyString,
4702 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
4703
4735
4749extern DECL_EXP void PlugInHandleAutopilotRoute(bool enable);
4750
4751// API 1.16
4752//
4768extern DECL_EXP wxString GetPluginDataDir(const char *plugin_name);
4769
4775extern DECL_EXP bool ShuttingDown(void);
4776
4777// Support for MUI MultiCanvas model
4778
4801extern DECL_EXP wxWindow *PluginGetFocusCanvas();
4810extern DECL_EXP wxWindow *PluginGetOverlayRenderCanvas();
4811
4820extern "C" DECL_EXP void CanvasJumpToPosition(wxWindow *canvas, double lat,
4821 double lon, double scale);
4833extern "C" DECL_EXP int AddCanvasMenuItem(wxMenuItem *pitem,
4834 opencpn_plugin *pplugin,
4835 const char *name = "");
4844extern "C" DECL_EXP void RemoveCanvasMenuItem(int item, const char *name = "");
4854extern "C" DECL_EXP void SetCanvasMenuItemViz(int item, bool viz,
4855 const char *name = "");
4865extern "C" DECL_EXP void SetCanvasMenuItemGrey(int item, bool grey,
4866 const char *name = "");
4867
4868// Extract waypoints, routes and tracks
4874extern DECL_EXP wxString GetSelectedWaypointGUID_Plugin();
4880extern DECL_EXP wxString GetSelectedRouteGUID_Plugin();
4886extern DECL_EXP wxString GetSelectedTrackGUID_Plugin();
4887
4894extern DECL_EXP std::unique_ptr<PlugIn_Waypoint> GetWaypoint_Plugin(
4895 const wxString &);
4902extern DECL_EXP std::unique_ptr<PlugIn_Route> GetRoute_Plugin(const wxString &);
4909extern DECL_EXP std::unique_ptr<PlugIn_Track> GetTrack_Plugin(const wxString &);
4915extern DECL_EXP wxWindow *GetCanvasUnderMouse();
4929extern DECL_EXP int GetCanvasIndexUnderMouse();
4930// extern DECL_EXP std::vector<wxWindow *> GetCanvasArray();
4943extern DECL_EXP wxWindow *GetCanvasByIndex(int canvasIndex);
4954extern DECL_EXP int GetCanvasCount();
4969extern DECL_EXP bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging,
4970 int margin, int delta,
4971 int canvasIndex);
4980extern DECL_EXP void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex);
4981
4982// API 1.17
4983//
4984
4993extern DECL_EXP wxRect GetMasterToolbarRect();
4994
5014
5022extern DECL_EXP int GetLatLonFormat(void);
5023
5024// API 1.17
5025
5036extern "C" DECL_EXP void ZeroXTE();
5037
5061class DECL_EXP PlugIn_Waypoint_Ex {
5062public:
5064 PlugIn_Waypoint_Ex(double lat, double lon, const wxString &icon_ident,
5065 const wxString &wp_name, const wxString &GUID = "",
5066 const double ScaMin = 1e9, const bool bNameVisible = false,
5067 const int nRanges = 0, const double RangeDistance = 1.0,
5068 const wxColor RangeColor = wxColor(255, 0, 0));
5080 void InitDefaults();
5081
5093 bool GetFSStatus();
5094
5103 int GetRouteMembershipCount();
5104
5105 double m_lat;
5106 double m_lon;
5107 wxString m_GUID;
5108 wxString m_MarkName;
5110 wxDateTime m_CreateTime;
5113
5114 double scamin;
5117
5121
5122 wxString IconName;
5124
5130 Plugin_HyperlinkList *m_HyperlinkList;
5131};
5132
5133WX_DECLARE_LIST(PlugIn_Waypoint_Ex, Plugin_WaypointExList);
5134
5157class DECL_EXP PlugIn_Route_Ex {
5158public:
5159 PlugIn_Route_Ex(void);
5160 ~PlugIn_Route_Ex(void);
5161
5162 wxString m_NameString;
5163 wxString m_StartString;
5164 wxString m_EndString;
5165 wxString m_GUID;
5168 wxString m_Description;
5169
5175 Plugin_WaypointExList *pWaypointList;
5176};
5177
5185extern DECL_EXP wxArrayString GetRouteGUIDArray(void);
5193extern DECL_EXP wxArrayString GetTrackGUIDArray(void);
5194
5204extern DECL_EXP bool GetSingleWaypointEx(wxString GUID,
5205 PlugIn_Waypoint_Ex *pwaypoint);
5206
5216extern DECL_EXP bool AddSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint,
5217 bool b_permanent = true);
5226extern DECL_EXP bool UpdateSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint);
5227
5237extern DECL_EXP bool AddPlugInRouteEx(PlugIn_Route_Ex *proute,
5238 bool b_permanent = true);
5239
5248extern DECL_EXP bool UpdatePlugInRouteEx(PlugIn_Route_Ex *proute);
5249
5258extern DECL_EXP std::unique_ptr<PlugIn_Waypoint_Ex> GetWaypointEx_Plugin(
5259 const wxString &);
5268extern DECL_EXP std::unique_ptr<PlugIn_Route_Ex> GetRouteEx_Plugin(
5269 const wxString &);
5270
5276extern DECL_EXP wxString GetActiveWaypointGUID(void);
5282extern DECL_EXP wxString GetActiveRouteGUID(void);
5283
5284// API 1.18
5285
5300extern DECL_EXP double OCPN_GetDisplayContentScaleFactor();
5301
5316extern DECL_EXP double OCPN_GetWinDIPScaleFactor();
5317
5325extern DECL_EXP std::vector<std::string> GetPriorityMaps();
5333extern DECL_EXP std::vector<std::string> GetActivePriorityIdentifiers();
5334
5342extern DECL_EXP int GetGlobalWatchdogTimoutSeconds();
5343
5355
5356// FIXME (dave) Implement these
5373extern DECL_EXP wxArrayString GetRouteGUIDArray(OBJECT_LAYER_REQ req);
5389extern DECL_EXP wxArrayString GetTrackGUIDArray(OBJECT_LAYER_REQ req);
5407extern DECL_EXP wxArrayString GetWaypointGUIDArray(OBJECT_LAYER_REQ req);
5408
5411/* Listening to messages. */
5412class ObservableListener;
5413
5415class ObservedEvt;
5416
5417// This is a verbatim copy from observable_evt.h, don't define twice.
5418#ifndef OBSERVABLE_EVT_H
5419#define OBSERVABLE_EVT_H
5420
5421wxDECLARE_EVENT(obsNOTIFY, ObservedEvt);
5422
5437class ObservedEvt : public wxCommandEvent {
5438public:
5445 ObservedEvt(wxEventType commandType = obsNOTIFY, int id = 0)
5446 : wxCommandEvent(commandType, id) {}
5447 ObservedEvt(const ObservedEvt &event) : wxCommandEvent(event) {
5448 this->m_shared_ptr = event.m_shared_ptr;
5449 }
5457 wxEvent *Clone() const { return new ObservedEvt(*this); }
5463 std::shared_ptr<const void> GetSharedPtr() const { return m_shared_ptr; }
5469 void SetSharedPtr(std::shared_ptr<const void> p) { m_shared_ptr = p; }
5470
5471private:
5472 std::shared_ptr<const void> m_shared_ptr;
5473};
5474
5475#endif // OBSERVABLE_EVT_H
5476
5477class ObservableListener;
5478
5486 const uint64_t id;
5491 NMEA2000Id(int value) : id(static_cast<uint64_t>(value)) {};
5492};
5493
5504extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5505 NMEA2000Id id, wxEventType ev, wxEvtHandler *handler);
5506
5514 const std::string id;
5519 NMEA0183Id(const std::string &s) : id(s) {};
5520};
5521
5532extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5533 NMEA0183Id id, wxEventType ev, wxEvtHandler *handler);
5534
5542 const std::string id;
5547 SignalkId(const std::string &s) : id(s) {};
5548};
5549
5560extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5561 SignalkId id, wxEventType ev, wxEvtHandler *handler);
5562
5578extern DECL_EXP std::vector<uint8_t> GetN2000Payload(NMEA2000Id id,
5579 ObservedEvt ev);
5580
5597extern DECL_EXP std::shared_ptr<void> GetSignalkPayload(ObservedEvt ev);
5598
5603extern DECL_EXP std::string GetN2000Source(NMEA2000Id id, ObservedEvt ev);
5604
5606extern DECL_EXP std::string GetN0183Payload(NMEA0183Id id, ObservedEvt ev);
5607
5615 const int type;
5620 NavDataId() : type(0) {}
5621};
5622
5634extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5635 NavDataId id, wxEventType ev, wxEvtHandler *handler);
5636
5644 double lat;
5645 double lon;
5646 double sog;
5647 double cog;
5648 double var;
5649 double hdt;
5650 time_t time;
5651};
5652
5654extern DECL_EXP PluginNavdata GetEventNavdata(ObservedEvt ev);
5655
5657/*
5658 * Plugins may access comm ports for direct output.
5659 * The general program flow for a plugin may look something like this
5660 * pseudo-code:
5661 * 1. Plugin will query OCPN core for a list of active comm drivers.
5662 * 2. Plugin will inspect the list, and query OCPN core for driver
5663 * attributes.
5664 * 3. Plugin will select a comm driver with appropriate attributes for output.
5665 * 4. Plugin will register a list of PGNs expected to be transmitted
5666 * (N2K specific)
5667 * 5. Plugin may then send a payload buffer to a specific comm driver for
5668 * output as soon as possible.
5669 *
5670 * The mechanism for specifying a particular comm driver uses the notion of
5671 * "handles". Each active comm driver has an associated opaque handle, managed
5672 * by OCPN core. All references by a plugin to a driver are by means of its
5673 * handle. Handles should be considered to be "opaque", meaning that the exact
5674 * contents of the handle are of no specific value to the plugin, and only
5675 * have meaning to the OCPN core management of drivers.
5676 */
5677
5679typedef std::string DriverHandle;
5680
5703
5705extern DECL_EXP std::vector<DriverHandle> GetActiveDrivers();
5706
5721extern DECL_EXP const std::unordered_map<std::string, std::string>
5723
5724/* Writing to a specific driver */
5734extern DECL_EXP CommDriverResult WriteCommDriver(
5735 DriverHandle handle, const std::shared_ptr<std::vector<uint8_t>> &payload);
5736
5738extern DECL_EXP CommDriverResult WriteCommDriverN2K(
5739 DriverHandle handle, int PGN, int destinationCANAddress, int priority,
5740 const std::shared_ptr<std::vector<uint8_t>> &payload);
5741
5784extern DECL_EXP CommDriverResult RegisterTXPGNs(DriverHandle handle,
5785 std::vector<int> &pgn_list);
5786
5787// API 1.19
5788//
5789
5826
5829 const std::string id;
5830 PluginMsgId(const std::string &s) : id(s) {};
5831};
5832
5837extern DECL_EXP std::shared_ptr<ObservableListener> GetListener(
5838 PluginMsgId id, wxEventType ev, wxEvtHandler *handler);
5839
5844extern DECL_EXP std::string GetPluginMsgPayload(PluginMsgId id, ObservedEvt ev);
5845
5851extern DECL_EXP void ExitOCPN();
5852
5861extern "C" DECL_EXP void RequestWindowRefresh(wxWindow *win,
5862 bool eraseBackground);
5868extern DECL_EXP bool GetFullScreen();
5874extern DECL_EXP void SetFullScreen(bool full_screen_on);
5880extern DECL_EXP void EnableTouchMode(bool enable);
5886extern DECL_EXP bool GetTouchMode();
5894extern DECL_EXP void SetGlobalColor(std::string table, std::string name,
5895 wxColor color);
5903extern DECL_EXP wxColor GetGlobalColorD(std::string map_name, std::string name);
5909extern DECL_EXP void EnableStatusBar(bool enable);
5915extern DECL_EXP void EnableMenu(bool enable);
5921extern DECL_EXP bool GetEnableStatusBar();
5927extern DECL_EXP bool GetEnableMenu();
5928
5938extern DECL_EXP void SetNavigationMode(PI_NavMode mode, int CanvasIndex);
5945extern DECL_EXP PI_NavMode GetNavigationMode(int CanvasIndex);
5953extern DECL_EXP void EnableLookaheadMode(bool enable, int CanvasIndex);
5960extern DECL_EXP bool GetEnableLookaheadMode(int CanvasIndex);
5967extern DECL_EXP void EnableMUIBar(bool enable, int CanvasIndex);
5974extern DECL_EXP void EnableCompassGPSIcon(bool enable, int CanvasIndex);
5981extern DECL_EXP void EnableChartBar(bool enable, int CanvasIndex);
5988extern DECL_EXP bool GetEnableMUIBar(int CanvasIndex);
5995extern DECL_EXP bool GetEnableCompassGPSIcon(int CanvasIndex);
6002extern DECL_EXP bool GetEnableChartBar(int CanvasIndex);
6010extern DECL_EXP void EnableCanvasFocusBar(bool enable, int CanvasIndex);
6017extern DECL_EXP bool GetEnableCanvasFocusBar(int CanvasIndex);
6018
6019/*
6020 * Allow plugin control of "Chart Panel Options" dialog
6021 */
6022
6029extern DECL_EXP void EnableLatLonGrid(bool enable, int CanvasIndex);
6036extern DECL_EXP void EnableChartOutlines(bool enable, int CanvasIndex);
6043extern DECL_EXP void EnableDepthUnitDisplay(bool enable, int CanvasIndex);
6050extern DECL_EXP void EnableAisTargetDisplay(bool enable, int CanvasIndex);
6057extern DECL_EXP void EnableTideStationsDisplay(bool enable, int CanvasIndex);
6064extern DECL_EXP void EnableCurrentStationsDisplay(bool enable, int CanvasIndex);
6071extern DECL_EXP void EnableENCTextDisplay(bool enable, int CanvasIndex);
6078extern DECL_EXP void EnableENCDepthSoundingsDisplay(bool enable,
6079 int CanvasIndex);
6086extern DECL_EXP void EnableBuoyLightLabelsDisplay(bool enable, int CanvasIndex);
6093extern DECL_EXP void EnableLightsDisplay(bool enable, int CanvasIndex);
6100extern DECL_EXP void EnableLightDescriptionsDisplay(bool enable,
6101 int CanvasIndex);
6108extern DECL_EXP void SetENCDisplayCategory(PI_DisCat cat, int CanvasIndex);
6109
6116extern DECL_EXP bool GetEnableLatLonGrid(int CanvasIndex);
6123extern DECL_EXP bool GetEnableChartOutlines(int CanvasIndex);
6130extern DECL_EXP bool GetEnableDepthUnitDisplay(int CanvasIndex);
6137extern DECL_EXP bool GetEnableAisTargetDisplay(int CanvasIndex);
6144extern DECL_EXP bool GetEnableTideStationsDisplay(int CanvasIndex);
6151extern DECL_EXP bool GetEnableCurrentStationsDisplay(int CanvasIndex);
6158extern DECL_EXP bool GetEnableENCTextDisplay(int CanvasIndex);
6165extern DECL_EXP bool GetEnableENCDepthSoundingsDisplay(int CanvasIndex);
6172extern DECL_EXP bool GetEnableBuoyLightLabelsDisplay(int CanvasIndex);
6179extern DECL_EXP bool GetEnableLightsDisplay(int CanvasIndex);
6186extern DECL_EXP bool GetEnableLightDescriptionsDisplay(int CanvasIndex);
6197extern DECL_EXP PI_DisCat GetENCDisplayCategory(int CanvasIndex);
6206extern DECL_EXP void PluginSetFollowMode(int CanvasIndex, bool enable_follow);
6213extern DECL_EXP bool PluginGetFollowMode(int CanvasIndex);
6221extern DECL_EXP void SetTrackingMode(bool enable);
6227extern DECL_EXP bool GetTrackingMode();
6235extern DECL_EXP void SetAppColorScheme(PI_ColorScheme cs);
6241extern DECL_EXP PI_ColorScheme GetAppColorScheme();
6242
6251extern DECL_EXP void EnableSplitScreenLayout(bool enable = true);
6252
6253// ChartCanvas control utilities
6254
6262extern DECL_EXP void PluginZoomCanvas(int CanvasIndex, double factor);
6268extern DECL_EXP bool GetEnableMainToolbar();
6274extern DECL_EXP void SetEnableMainToolbar(bool enable);
6279extern DECL_EXP void ShowGlobalSettingsDialog();
6285extern DECL_EXP void PluginCenterOwnship(int CanvasIndex);
6293extern DECL_EXP bool GetEnableTenHertzUpdate();
6300extern DECL_EXP void EnableTenHertzUpdate(bool enable);
6306extern DECL_EXP void ConfigFlushAndReload();
6307
6308#endif //_PLUGIN_H_
Keeps listening over it's lifespan, removes itself on destruction.
Definition observable.h:131
Custom event class for OpenCPN's notification system.
ObservedEvt(wxEventType commandType=obsNOTIFY, int id=0)
Constructor.
void SetSharedPtr(std::shared_ptr< const void > p)
Sets the event's payload data.
wxEvent * Clone() const
Creates a cloned copy of this event.
std::shared_ptr< const void > GetSharedPtr() const
Gets the event's payload data.
Class representing an S-57 chart object.
int auxParm3
Auxiliary parameter 3.
PI_S57Obj * next
Linked list pointer.
PI_DisCat m_DisplayCat
Display category (base, standard, other)
double m_lon
Reference longitude.
double lon_max
Bounding box maximum longitude.
int Scamin
Minimum display scale.
int * m_lsindex_array
Array of line segment indices.
double x
X coordinate for point features.
int auxParm1
Auxiliary parameter 1.
void * m_chart_context
Parent chart context.
int m_n_lsindex
Number of line segments.
double lon_min
Bounding box minimum longitude.
PI_S57Obj * child
Child object list (for multipoint soundings)
double x_rate
X scale factor.
int npt
Number of points in geometry.
int auxParm2
Auxiliary parameter 2.
double lat_max
Bounding box maximum latitude.
int auxParm0
Auxiliary parameter 0.
int iOBJL
Object lookup index.
void * pPolyTessGeo
Tesselated polygon geometry.
double chart_ref_lon
Chart reference longitude.
bool bIsAssociable
True if object can have relationships.
int m_n_edge_max_points
Maximum points per edge.
void * geoPt
Geometry data for lines/areas.
double y
Y coordinate for point features.
int nRef
Reference count for memory management.
int n_attr
Number of attributes.
double * geoPtMulti
Lat/lon pairs for decomposed points.
double y_origin
Y origin offset.
PI_line_segment_element * m_ls_list
Line segment list.
int Index
Runtime object index.
void * S52_Context
S52 presentation data.
bool bIsClone
True if object is a clone.
char * att_array
Array of attribute types.
double * geoPtz
Z values for multipoint features.
double m_lat
Reference latitude.
int m_DPRI
Display priority.
bool m_bcategory_mutable
True if category can change.
bool bIsAton
True if object is an aid to navigation.
double chart_ref_lat
Chart reference latitude.
double z
Z coordinate (usually depth)
wxArrayOfS57attVal * attVal
Array of attribute values.
double y_rate
Y scale factor.
double lat_min
Bounding box minimum latitude.
double x_origin
X origin offset.
int Primitive_type
Geometry type (point, line, area)
Represents a line segment element for efficient vector chart rendering.
int priority
Drawing priority (higher draws on top)
int type
Line type identifier.
void * private0
Private data pointer for implementation use.
float lon_min
Minimum longitude of segment's bounding box.
float lat_min
Minimum latitude of segment's bounding box.
size_t vbo_offset
Offset into vertex buffer object for this segment.
float lat_max
Maximum latitude of segment's bounding box.
float lon_max
Maximum longitude of segment's bounding box.
PI_line_segment_element * next
Pointer to next segment in linked list.
size_t n_points
Number of points in this line segment.
Extended chart base class with separated text rendering.
Extended OpenGL-optimized chart base class with additional querying capabilities.
OpenGL-optimized chart base class for plugin chart types.
Base class for implementing custom chart types in OpenCPN plugins.
virtual ChartFamilyEnumPI GetChartFamily()
Returns the chart family classification.
virtual wxString GetID()
Returns a unique identifier for the chart.
virtual wxString GetDatumString()
Returns the horizontal geodetic datum of the chart.
virtual wxString GetName()
Returns the chart's name or title.
virtual wxDateTime GetEditionDate(void)
Returns the edition date of the chart.
virtual int GetCOVRTablenPoints(int iTable)
Alternative method to get the number of points in a coverage table entry.
virtual int GetCOVREntries()
Returns the number of coverage table entries for this chart.
virtual wxString GetSoundingsDatum()
Returns the vertical datum used for soundings in the chart.
virtual wxString GetExtraInfo()
Returns additional information about the chart.
virtual wxString GetDescription()
Returns a descriptive text about the chart.
virtual wxString GetFullPath() const
Returns the full file path of the chart.
virtual wxString GetSE()
Returns the chart's source edition identifier.
virtual bool IsReadyToRender()
Indicates whether the chart is ready for rendering.
virtual int GetNativeScale()
Returns the native scale of the chart.
virtual double GetChartSkew()
Returns the skew/rotation angle of the chart.
virtual wxString GetDepthUnits()
Returns the depth units used in the chart.
virtual float * GetCOVRTableHead(int iTable)
Returns a pointer to the coverage table data for a specific entry.
virtual double GetChartErrorFactor()
Returns the error factor for the chart.
virtual OcpnProjTypePI GetChartProjection()
Returns the projection type used by the chart.
virtual wxString GetPubDate()
Returns the publication date/year of the chart.
virtual ChartTypeEnumPI GetChartType()
Returns the chart type identifier.
virtual int GetCOVRTablePoints(int iTable)
Returns the number of points in a specific coverage table entry.
virtual ChartDepthUnitTypePI GetDepthUnitId()
Returns the depth unit type identifier.
AIS target information accessible to plugins.
char CallSign[8]
Call sign, includes NULL terminator.
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.
char ShipName[21]
Ship name, includes NULL terminator.
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.
Basic position fix information.
double Cog
Course over ground in degrees.
double Sog
Speed over ground in knots.
time_t FixTime
UTC time of fix as time_t value.
double Lat
Latitude in decimal degrees.
int nSats
Number of satellites used in the fix.
double Var
Magnetic variation in degrees, typically from RMC message.
double Lon
Longitude in decimal 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.
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.
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.
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.
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.
Information about the currently active route leg.
double Dtw
Distance to waypoint in nautical miles.
wxString wp_name
Name of destination waypoint for the active leg.
double Xte
Cross track error in nautical miles, negative values indicate left side of track.
double Btw
Bearing to waypoint in degrees true.
bool arrival
True when vessel is within the arrival circle of the destination waypoint.
virtual bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvasIndex)
Renders plugin overlay graphics with canvas selection.
virtual bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvasIndex)
Renders plugin overlay graphics in OpenGL mode with canvas selection.
bool RenderGLOverlayMultiCanvas(wxGLContext *pcontext, PlugIn_ViewPort *vp, int canvas_ix) override
Renders plugin overlay graphics in OpenGL mode with canvas selection.
bool RenderOverlayMultiCanvas(wxDC &dc, PlugIn_ViewPort *vp, int canvas_ix) override
Renders plugin overlay graphics with canvas selection.
Base class for OpenCPN plugins.
virtual bool RenderOverlay(wxMemoryDC *pmdc, PlugIn_ViewPort *vp)
Render plugin overlay graphics using standard device context.
DECL_EXP void RemovePlugInTool(int tool_id)
Removes a tool from OpenCPN's toolbar.
DECL_EXP void ForceChartDBUpdate()
Forces an update of the chart database.
DECL_EXP wxArrayString GetRouteGUIDArray(void)
Gets array of route GUIDs.
DECL_EXP CommDriverResult WriteCommDriverN2K(DriverHandle handle, int PGN, int destinationCANAddress, int priority, const std::shared_ptr< std::vector< uint8_t > > &payload)
Send a PGN message to an NMEA2000 address.
_OBJECT_LAYER_REQ
Filter options for object queries.
@ 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.
DECL_EXP void toSM_ECC_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Elliptical Simple Mercator projection.
DECL_EXP void EnableENCDepthSoundingsDisplay(bool enable, int CanvasIndex)
Controls ENC depth sounding display.
DECL_EXP void EnableChartBar(bool enable, int CanvasIndex)
Controls visibility of chart info bar.
DECL_EXP double fromDMM_Plugin(wxString sdms)
Converts degrees/decimal minutes string to decimal degrees.
DECL_EXP void SetCanvasMenuItemGrey(int item, bool grey, const char *name="")
Sets menu item enabled/disabled state.
DECL_EXP void EnableLatLonGrid(bool enable, int CanvasIndex)
Controls latitude/longitude grid display.
DECL_EXP void SetNavigationMode(PI_NavMode mode, int CanvasIndex)
Sets the navigation mode for a specific chart canvas.
DECL_EXP bool GetEnableENCDepthSoundingsDisplay(int CanvasIndex)
Gets ENC depth sounding visibility.
DECL_EXP void EnableENCTextDisplay(bool enable, int CanvasIndex)
Controls ENC text label display.
DECL_EXP wxXmlDocument GetChartDatabaseEntryXML(int dbIndex, bool b_getGeom)
Gets chart database entry as XML.
DECL_EXP void AddChartDirectory(wxString &path)
Adds a chart directory to OpenCPN's chart database.
DECL_EXP wxBitmap GetBitmapFromSVGFile(wxString filename, unsigned int width, unsigned int height)
Creates bitmap from SVG file.
DECL_EXP wxArrayString GetChartDBDirArrayString()
Gets chart database directory list.
DECL_EXP wxWindow * GetCanvasByIndex(int canvasIndex)
Gets chart canvas window by index.
DECL_EXP bool GetEnableCanvasFocusBar(int CanvasIndex)
Gets focus indicator visibility state.
DECL_EXP int GetCanvasIndexUnderMouse()
Gets index of chart canvas under mouse cursor.
DECL_EXP void DimeWindow(wxWindow *)
Applies system color scheme to window.
plugin_ais_alarm_type
Enumeration of AIS alarm states.
@ PI_AIS_ALARM_ACKNOWLEDGED
Alarm has been acknowledged by the user.
@ PI_AIS_NO_ALARM
No alarm condition exists.
@ PI_AIS_ALARM_SET
Alarm has been set but not acknowledged.
enum ChartDepthUnitTypePI _ChartDepthUnitTypePI
Enumeration of depth unit types used in charts.
DECL_EXP void EnableCanvasFocusBar(bool enable, int CanvasIndex)
Controls visibility of canvas focus indicator.
DECL_EXP void EnableTideStationsDisplay(bool enable, int CanvasIndex)
Controls tide station icon display.
enum _PI_DisCat PI_DisCat
Display categories for S52 chart features.
DECL_EXP void RemoveCanvasContextMenuItem(int item)
Removes a context menu item completely.
void DECL_EXP PI_PLIBSetRenderCaps(unsigned int flags)
Sets rendering capability flags.
DECL_EXP void fromSM_ECC_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Elliptical Simple Mercator coordinates to geographic.
DECL_EXP bool GetEnableChartBar(int CanvasIndex)
Gets chart bar visibility state.
DECL_EXP wxFont GetOCPNGUIScaledFont_PlugIn(wxString item)
Gets a uniquely scaled font copy for responsive UI elements.
DECL_EXP std::unique_ptr< PlugIn_Waypoint_Ex > GetWaypointEx_Plugin(const wxString &)
Gets extended waypoint by GUID.
DECL_EXP double DistGreatCircle_Plugin(double slat, double slon, double dlat, double dlon)
Calculates great circle distance between two points.
CommDriverResult
Error return values
@ RESULT_COMM_INVALID_PARMS
Invalid parameters provided to operation.
@ RESULT_COMM_REGISTER_GATEWAY_ERROR
Failed to register with gateway device.
@ RESULT_COMM_TX_ERROR
Error occurred during transmission.
@ RESULT_COMM_REGISTER_PGN_ERROR
Failed to register PGN parameters.
@ RESULT_COMM_NO_ERROR
Operation completed successfully.
@ RESULT_COMM_INVALID_HANDLE
Invalid or unknown driver handle specified.
DECL_EXP void RequestWindowRefresh(wxWindow *win, bool eraseBackground)
Requests window refresh.
DECL_EXP bool UpdateChartDBInplace(wxArrayString dir_array, bool b_force_update, bool b_ProgressDialog)
Updates chart database in place.
DECL_EXP wxString GetLocaleCanonicalName()
Gets system locale canonical name.
DECL_EXP bool GetEnableDepthUnitDisplay(int CanvasIndex)
Gets depth unit display state.
enum OptionsParentPI _OptionsParentPI
Enum defining parent pages in OpenCPN options dialog where plugins can add panels.
DECL_EXP void SetToolbarItemState(int item, bool toggle)
Sets toolbar item toggle state.
DECL_EXP bool UpdatePlugInRoute(PlugIn_Route *proute)
Updates an existing route.
DECL_EXP bool AddLocaleCatalog(wxString catalog)
Adds a locale catalog for translations.
int DECL_EXP PI_PLIBRenderObjectToDC(wxDC *pdc, PI_S57Obj *pObj, PlugIn_ViewPort *vp)
Renders an S57 object using standard device context.
DECL_EXP _OCPN_DLStatus OCPN_downloadFile(const wxString &url, const wxString &outputFile, const wxString &title, const wxString &message, const wxBitmap &bitmap, wxWindow *parent, long style, int timeout_secs)
Synchronously downloads a file with progress dialog.
void DECL_EXP PI_PLIBSetLineFeaturePriority(PI_S57Obj *pObj, int prio)
Sets rendering priority for line feature.
enum _PI_DisPrio PI_DisPrio
Display priority levels for S52 chart objects.
DECL_EXP void EnableCurrentStationsDisplay(bool enable, int CanvasIndex)
Controls current station icon display.
DECL_EXP wxArrayString GetIconNameArray(void)
Gets array of available waypoint icons.
DECL_EXP void toTM_Plugin(float lat, float lon, float lat0, float lon0, double *x, double *y)
Converts geographic coordinates to Transverse Mercator projection.
DECL_EXP bool GetGlobalColor(wxString colorName, wxColour *pcolour)
Gets a global color value.
DECL_EXP bool GetSingleWaypointEx(wxString GUID, PlugIn_Waypoint_Ex *pwaypoint)
Gets extended waypoint data by GUID.
DECL_EXP int PlatformFileSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir, wxString suggestedName, wxString wildcard)
Shows platform-optimized file selector dialog.
DECL_EXP PI_DisCat GetENCDisplayCategory(int CanvasIndex)
Gets current ENC display category.
void DECL_EXP PI_UpdateContext(PI_S57Obj *pObj)
Updates rendering context for S57 object.
DECL_EXP int AddCanvasContextMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin)
Adds item to chart canvas context menu.
DECL_EXP double fromUsrSpeed_Plugin(double usr_speed, int unit=-1)
Converts from user's preferred speed unit to knots.
DECL_EXP _OCPN_DLStatus OCPN_postDataHttp(const wxString &url, const wxString &parameters, wxString &result, int timeout_secs)
Performs HTTP POST request.
DECL_EXP wxString GetActiveRouteGUID(void)
Gets GUID of currently active route.
DECL_EXP void RequestRefresh(wxWindow *)
Requests window refresh.
void DECL_EXP PI_PLIBPrepareForNewRender(void)
Prepares PLIB for new rendering pass.
DECL_EXP PI_NavMode GetNavigationMode(int CanvasIndex)
Gets current navigation mode for a canvas.
DECL_EXP std::unique_ptr< PlugIn_Route_Ex > GetRouteEx_Plugin(const wxString &)
Gets extended route by GUID.
DECL_EXP void SetCanvasRotation(double rotation)
Sets chart display rotation angle.
DECL_EXP void PlugInMultMatrixViewport(PlugIn_ViewPort *vp, float lat=0, float lon=0)
Applies viewport transformation matrix.
DECL_EXP double toUsrDepth_Plugin(double m_depth, int unit=-1)
Converts meters to user's preferred depth unit.
int DECL_EXP PI_GetPLIBDepthUnitInt()
Gets configured depth unit for S52 display.
DECL_EXP wxArrayString GetWaypointGUIDArray(void)
Gets array of all waypoint/marks GUIDs.
DECL_EXP double toUsrTemp_Plugin(double cel_temp, int unit=-1)
Converts Celsius to user's preferred temperature unit.
DECL_EXP bool CheckEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta)
Checks if chart should pan when cursor near edge.
DECL_EXP wxString * GetpSharedDataLocation()
Gets shared application data location.
DECL_EXP double toUsrSpeed_Plugin(double kts_speed, int unit=-1)
Converts knots to user's preferred speed unit.
DECL_EXP bool GetEnableBuoyLightLabelsDisplay(int CanvasIndex)
Gets buoy/light label visibility.
_OCPN_DLCondition
Event types for HTTP file download operations.
@ OCPN_DL_EVENT_TYPE_UNKNOWN
Unknown event type.
@ OCPN_DL_EVENT_TYPE_PROGRESS
Download progress update.
@ OCPN_DL_EVENT_TYPE_END
Download has completed.
@ OCPN_DL_EVENT_TYPE_START
Download is starting.
DECL_EXP bool DeleteOptionsPage(wxScrolledWindow *page)
Removes a previously added options page.
DECL_EXP void EnableTenHertzUpdate(bool enable)
Enable or disable 10 Hz update rate.
DECL_EXP void EnableLightDescriptionsDisplay(bool enable, int CanvasIndex)
Controls light description text display.
DECL_EXP bool AddPlugInRouteEx(PlugIn_Route_Ex *proute, bool b_permanent=true)
Adds a route with extended features.
bool DECL_EXP PI_PLIBObjectRenderCheck(PI_S57Obj *pObj, PlugIn_ViewPort *vp)
Checks if object should be rendered.
DECL_EXP void GetCanvasPixLL(PlugIn_ViewPort *vp, wxPoint *pp, double lat, double lon)
Converts lat/lon to canvas physical pixel coordinates.
DECL_EXP bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1, double lat2, double lon2)
Checks if a great circle route crosses land.
ChartTypeEnumPI
Enumeration of chart types.
@ PI_CHART_TYPE_PLUGIN
Chart type provided by a plugin.
@ PI_CHART_TYPE_CM93COMP
CM93 Composite vector chart format.
@ PI_CHART_TYPE_CM93
CM93 vector chart format.
@ PI_CHART_TYPE_S57
S-57 vector chart format.
@ PI_CHART_TYPE_UNKNOWN
Chart type is unknown or undefined.
@ PI_CHART_TYPE_DONTCARE
Chart type is not important for the operation.
@ PI_CHART_TYPE_KAP
BSB/KAP raster chart format.
@ PI_CHART_TYPE_DUMMY
Dummy chart used when no actual chart is available.
@ PI_CHART_TYPE_GEO
GEO raster chart format.
DECL_EXP int GetChartbarHeight(void)
Gets height of chart bar in pixels.
DECL_EXP wxString GetNewGUID()
Generates a new globally unique identifier (GUID).
PI_ColorScheme
Enumeration of color schemes.
@ PI_GLOBAL_COLOR_SCHEME_DAY
Day color scheme, optimized for bright ambient light.
@ PI_GLOBAL_COLOR_SCHEME_NIGHT
Night color scheme, optimized for dark conditions with minimal impact on night vision.
@ PI_N_COLOR_SCHEMES
Number of color schemes, used for bounds checking.
@ PI_GLOBAL_COLOR_SCHEME_RGB
RGB color scheme, unmodified colors.
@ PI_GLOBAL_COLOR_SCHEME_DUSK
Dusk color scheme, optimized for low ambient light.
DECL_EXP wxString toSDMM_PlugIn(int NEflag, double a, bool hi_precision=true)
Convert decimal degrees to a formatted string.
DECL_EXP void SetEnableMainToolbar(bool enable)
Show or hide the main toolbar.
enum _OCPN_DLCondition OCPN_DLCondition
Event types for HTTP file download operations.
DECL_EXP wxString GetActiveStyleName()
Gets name of currently active style sheet.
DECL_EXP void EnableAisTargetDisplay(bool enable, int CanvasIndex)
Controls AIS target display.
DECL_EXP void ZeroXTE()
Resets cross track error to zero.
DECL_EXP void SetENCDisplayCategory(PI_DisCat cat, int CanvasIndex)
Sets ENC (Electronic Navigation Chart) feature display category.
DECL_EXP wxString GetOCPN_ExePath(void)
Gets OpenCPN executable path.
int DECL_EXP OCPNMessageBox_PlugIn(wxWindow *parent, const wxString &message, const wxString &caption=_T("Message"), int style=wxOK, int x=-1, int y=-1)
Shows a message box dialog.
DECL_EXP wxString * GetpPlugInLocation()
Gets plugins directory location.
DECL_EXP std::string GetN2000Source(NMEA2000Id id, ObservedEvt ev)
Return source identifier (iface) of a received n2000 message of type id in ev.
DECL_EXP int GetLatLonFormat(void)
Gets currently selected latitude/longitude display format.
DECL_EXP std::shared_ptr< void > GetSignalkPayload(ObservedEvt ev)
Get SignalK status payload after receiving a message.
DECL_EXP double OCPN_GetWinDIPScaleFactor()
Gets Windows-specific DPI scaling factor.
DECL_EXP std::shared_ptr< ObservableListener > GetListener(NMEA2000Id id, wxEventType ev, wxEvtHandler *handler)
Gets listener for NMEA 2000 messages.
DECL_EXP wxWindow * GetCanvasUnderMouse()
Gets canvas window under mouse cursor.
DECL_EXP void EnableBuoyLightLabelsDisplay(bool enable, int CanvasIndex)
Controls buoy/light name label display.
int DECL_EXP PI_PLIBRenderAreaToDC(wxDC *pdc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect rect, unsigned char *pixbuf)
Renders an S57 area object using standard device context.
DECL_EXP void SetGlobalColor(std::string table, std::string name, wxColor color)
Sets a color in the global color scheme.
DECL_EXP void PushNMEABuffer(wxString str)
Pushes NMEA sentence to the system.
DECL_EXP bool OCPN_isOnline()
Checks internet connectivity.
DECL_EXP void SetCanvasContextMenuItemGrey(int item, bool grey)
Sets menu item enabled/disabled state.
DECL_EXP std::unique_ptr< PlugIn_Waypoint > GetWaypoint_Plugin(const wxString &)
Gets waypoint details by GUID.
enum PI_InitReturn _PI_InitReturn
Return values for plugin initialization.
DECL_EXP void CanvasJumpToPosition(wxWindow *canvas, double lat, double lon, double scale)
Centers specified canvas on given position at given scale.
DECL_EXP double fromUsrTemp_Plugin(double usr_temp, int unit=-1)
Converts from user's preferred temperature unit to Celsius.
DECL_EXP bool GetEnableMenu()
Gets menu bar visibility state.
bool DECL_EXP PI_GetObjectRenderBox(PI_S57Obj *pObj, double *lat_min, double *lat_max, double *lon_min, double *lon_max)
Gets geographic bounding box of S57 object.
_OCPN_DLStatus
Status codes for HTTP file download operations.
@ OCPN_DL_NO_ERROR
Download completed successfully.
@ OCPN_DL_USER_TIMEOUT
Download timed out waiting for user action.
@ OCPN_DL_STARTED
Download has begun but not yet complete.
@ OCPN_DL_FAILED
Download failed (general error)
@ OCPN_DL_UNKNOWN
Unknown or uninitialized status.
@ OCPN_DL_ABORTED
Download was cancelled by user.
SDDMFORMAT
Coordinate format options for lat/lon display.
@ DEGREES_DECIMAL_MINUTES
Format like "50° 12.345' N".
@ DEGREES_MINUTES_SECONDS
Format like "50° 12' 34.5" N".
@ DECIMAL_DEGREES
Format like "50.12345° N".
@ END_SDDMFORMATS
Number of available formats.
DECL_EXP bool IsTouchInterface_PlugIn(void)
Checks if touch interface mode is enabled.
DECL_EXP wxString GetPlugInPath(opencpn_plugin *pplugin)
Gets the installation path for a specific plugin.
DECL_EXP double GetCanvasTilt()
Gets current canvas tilt angle.
DECL_EXP bool GetEnableAisTargetDisplay(int CanvasIndex)
Gets AIS target display state.
OCPN_DLDialogStyle
@ OCPN_DLDS_CONN_SETTINGS_AUTH
The dialog allows the user to change the authentication settings.
@ OCPN_DLDS_CAN_START
The transfer won't start automatically.
@ OCPN_DLDS_URL
The dialog shows the URL involved in the transfer.
@ OCPN_DLDS_AUTO_CLOSE
The dialog auto closes when transfer is complete.
@ OCPN_DLDS_CAN_ABORT
The transfer can be aborted by the user.
@ OCPN_DLDS_ESTIMATED_TIME
The dialog shows the estimated total time.
@ OCPN_DLDS_SIZE
The dialog shows the size of the resource to download/upload.
@ OCPN_DLDS_CONN_SETTINGS_PROXY
The dialog allows the user to change the proxy settings.
@ OCPN_DLDS_REMAINING_TIME
The dialog shows the remaining time.
@ OCPN_DLDS_SPEED
The dialog shows the transfer speed.
@ OCPN_DLDS_ELAPSED_TIME
The dialog shows the elapsed time.
@ OCPN_DLDS_CAN_PAUSE
The transfer can be paused.
@ OCPN_DLDS_CONN_SETTINGS_PORT
The dialog allows the user to change the port for the transfer.
DECL_EXP void RemoveCanvasMenuItem(int item, const char *name="")
Removes a context menu item completely.
DECL_EXP void EnableStatusBar(bool enable)
Shows/hides the status bar.
ChartFamilyEnumPI
Enumeration of chart families (broad categories).
@ PI_CHART_FAMILY_UNKNOWN
Chart family is unknown.
@ PI_CHART_FAMILY_VECTOR
Vector chart formats (S-57, CM93, etc.)
@ PI_CHART_FAMILY_RASTER
Raster chart formats (KAP, GEO, etc.)
@ PI_CHART_FAMILY_DONTCARE
Chart family is not important for the operation.
DECL_EXP void EnableChartOutlines(bool enable, int CanvasIndex)
Controls chart outline display.
DECL_EXP wxString GetWritableDocumentsDir(void)
Returns the platform-specific default documents directory.
DECL_EXP wxString GetSelectedTrackGUID_Plugin()
Gets GUID of currently selected track.
DECL_EXP bool GetEnableTenHertzUpdate()
Check if 10 Hz update rate is enabled.
DECL_EXP bool DeletePlugInRoute(wxString &GUID)
Deletes a route.
DECL_EXP void GetDoubleCanvasPixLL(PlugIn_ViewPort *vp, wxPoint2DDouble *pp, double lat, double lon)
Converts lat/lon to canvas pixels with double precision.
DECL_EXP bool GetFullScreen()
Gets full screen state.
DECL_EXP bool PluginGetFollowMode(int CanvasIndex)
Get the current follow mode status for a specific canvas.
DECL_EXP bool GetSingleWaypoint(wxString GUID, PlugIn_Waypoint *pwaypoint)
Gets waypoint data by GUID.
enum _PI_LUPname PI_LUPname
Name identifiers for S57 lookup table sets.
DECL_EXP double OCPN_GetDisplayContentScaleFactor()
Gets content scaling factor for current display.
DECL_EXP double fromUsrDepth_Plugin(double usr_depth, int unit=-1)
Converts from user's preferred depth unit to meters.
DECL_EXP bool UpdatePlugInTrack(PlugIn_Track *ptrack)
Updates an existing track.
DECL_EXP wxArrayString GetTrackGUIDArray(void)
Gets array of track GUIDs.
DECL_EXP bool GetEnableLightsDisplay(int CanvasIndex)
Gets light icon visibility.
int DECL_EXP PI_GetPLIBStateHash()
Gets hash value representing current PLIB state.
DECL_EXP double toUsrDistance_Plugin(double nm_distance, int unit=-1)
Converts nautical miles to user's preferred distance unit.
DECL_EXP bool GetActiveRoutepointGPX(char *buffer, unsigned int buffer_length)
Gets GPX representation of active route waypoint.
DECL_EXP wxBitmap * FindSystemWaypointIcon(wxString &icon_name)
Finds built-in system waypoint icon.
DECL_EXP void ExitOCPN()
Exits OpenCPN application.
DECL_EXP int PlugInGetMinAvailableGshhgQuality()
Gets minimum available GSHHS coastline data quality.
DECL_EXP bool GetEnableLookaheadMode(int CanvasIndex)
Gets look-ahead mode state for a canvas.
DECL_EXP wxString getUsrTempUnit_Plugin(int unit=-1)
Gets display string for user's preferred temperature unit.
DECL_EXP double fromDMM_PlugIn(wxString sdms)
Parse a formatted coordinate string to get decimal degrees.
DECL_EXP int PlugInGetMaxAvailableGshhgQuality()
Gets maximum available GSHHS coastline data quality.
ChartDepthUnitTypePI
Enumeration of depth unit types used in charts.
@ PI_DEPTH_UNIT_METERS
Depths shown in meters.
@ PI_DEPTH_UNIT_UNKNOWN
Depth unit is unknown or not specified.
@ PI_DEPTH_UNIT_FATHOMS
Depths shown in fathoms.
@ PI_DEPTH_UNIT_FEET
Depths shown in feet.
DECL_EXP bool PlugInHasNormalizedViewPort(PlugIn_ViewPort *vp)
Checks if viewport has been normalized.
DECL_EXP bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint, bool b_permanent=true)
Adds a single waypoint.
DECL_EXP double fromUsrWindSpeed_Plugin(double usr_wspeed, int unit=-1)
Converts from user's preferred wind speed unit to knots.
DECL_EXP bool PlugInSetFontColor(const wxString TextElement, const wxColour color)
Sets text color for a UI element.
DECL_EXP wxString getUsrWindSpeedUnit_Plugin(int unit=-1)
Gets display string for user's preferred wind speed unit.
DECL_EXP bool DeleteSingleWaypoint(wxString &GUID)
Deletes a single waypoint.
DECL_EXP bool ShuttingDown(void)
Checks if OpenCPN is in shutdown process.
DECL_EXP void EnableDepthUnitDisplay(bool enable, int CanvasIndex)
Controls depth unit display.
DECL_EXP void PlugInAISDrawGL(wxGLCanvas *glcanvas, const PlugIn_ViewPort &vp)
Renders AIS targets on a secondary OpenGL canvas.
DECL_EXP void PlugInHandleAutopilotRoute(bool enable)
Controls autopilot route handling.
DECL_EXP void EnableMUIBar(bool enable, int CanvasIndex)
Controls visibility of MUI (Mobile/Touch User Interface) bar.
DECL_EXP void JumpToPosition(double lat, double lon, double scale)
Centers chart display on specified position at given scale.
DECL_EXP CommDriverResult WriteCommDriver(DriverHandle handle, const std::shared_ptr< std::vector< uint8_t > > &payload)
Send a non-NMEA2000 message.
DECL_EXP int PlatformDirSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir)
Shows platform-optimized directory selector dialog.
DECL_EXP std::string GetN0183Payload(NMEA0183Id id, ObservedEvt ev)
Return payload in a received n0183 message of type id in ev.
wxString DECL_EXP PI_GetPLIBColorScheme()
Gets current color scheme used by S52 PLIB.
DECL_EXP void SetToolbarToolBitmaps(int item, wxBitmap *bitmap, wxBitmap *bmpRollover)
Updates toolbar tool bitmaps.
DECL_EXP bool GetTrackingMode()
Get the current tracking mode status.
std::string DriverHandle
Plugin API supporting direct access to comm drivers for output purposes.
PI_LUPname DECL_EXP PI_GetObjectLUPName(PI_S57Obj *pObj)
Gets Look-Up Table (LUP) name for object.
DECL_EXP bool AddPersistentFontKey(wxString TextElement)
Registers a new font configuration element.
enum _OCPN_DLStatus OCPN_DLStatus
Status codes for HTTP file download operations.
DECL_EXP wxAuiManager * GetFrameAuiManager(void)
Gets main frame AUI manager.
DECL_EXP void PlugInNormalizeViewport(PlugIn_ViewPort *vp, float lat=0, float lon=0)
Normalizes viewport parameters.
DECL_EXP wxString getUsrDistanceUnit_Plugin(int unit=-1)
Gets display string for user's preferred distance unit.
struct _ExtentPI ExtentPI
Geographic extent structure defining a bounding box.
DECL_EXP wxFileConfig * GetOCPNConfigObject(void)
Gets OpenCPN's configuration object.
DECL_EXP bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key, wxString description)
Adds a custom waypoint icon.
DECL_EXP wxString toUsrDateTimeFormat_Plugin(const wxDateTime date_time, const DateTimeFormatOptions &options=DateTimeFormatOptions())
Format a date/time to a localized string representation, conforming to the global date/time format an...
DECL_EXP wxRect GetMasterToolbarRect()
Gets bounding rectangle of master toolbar.
DECL_EXP wxWindow * PluginGetOverlayRenderCanvas()
Gets the canvas currently designated for overlay rendering.
DECL_EXP void EnableLookaheadMode(bool enable, int CanvasIndex)
Enables/disables look-ahead mode for a canvas.
DECL_EXP void OCPN_cancelDownloadFileBackground(long handle)
Cancels a background download.
DECL_EXP PI_ColorScheme GetAppColorScheme()
Get the current application color scheme.
DECL_EXP PluginNavdata GetEventNavdata(ObservedEvt ev)
Return BasicNavDataMsg decoded data available in ev.
DECL_EXP int AddChartToDBInPlace(wxString &full_path, bool b_RefreshCanvas)
Adds a chart to the database without full rebuild.
DECL_EXP void toSM_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Simple Mercator projection.
DECL_EXP wxString getUsrDepthUnit_Plugin(int unit=-1)
Gets display string for user's preferred depth unit.
DECL_EXP void EnableMenu(bool enable)
Shows/hides the main menu bar.
DECL_EXP wxFont * OCPNGetFont(wxString TextElement, int default_size=0)
Gets a font for UI elements.
DECL_EXP int GetGlobalWatchdogTimoutSeconds()
Gets global watchdog timeout value.
DECL_EXP void SetTrackingMode(bool enable)
Enable or disable tracking mode.
enum ChartTypeEnumPI _ChartTypeEnumPI
Enumeration of chart types.
enum OcpnProjTypePI _OcpnProjTypePI
Enumeration of chart projection types.
DECL_EXP bool GetEnableStatusBar()
Gets status bar visibility state.
DECL_EXP float GetOCPNChartScaleFactor_Plugin()
Gets chart rendering scale factor.
void DECL_EXP PI_PLIBFreeContext(void *pContext)
Frees S52 PLIB context.
DECL_EXP bool GetEnableChartOutlines(int CanvasIndex)
Gets chart outline visibility state.
DECL_EXP std::unique_ptr< PlugIn_Track > GetTrack_Plugin(const wxString &)
Gets track details by GUID.
DECL_EXP bool AddPlugInRoute(PlugIn_Route *proute, bool b_permanent=true)
Adds a new route.
DECL_EXP std::vector< uint8_t > GetN2000Payload(NMEA2000Id id, ObservedEvt ev)
Return N2K payload for a received n2000 message of type id in ev.
DECL_EXP wxColour GetFontColour_PlugIn(wxString TextElement)
Gets color configured for a UI text element.
DECL_EXP bool GetEnableMainToolbar()
Check if the main toolbar is enabled.
enum ChartFamilyEnumPI _ChartFamilyEnumPI
Enumeration of chart families (broad categories).
DECL_EXP wxFont * FindOrCreateFont_PlugIn(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &facename=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
Creates or finds a font in the font cache.
DECL_EXP void SetCanvasContextMenuItemViz(int item, bool viz)
Temporarily changes context menu item visibility.
DECL_EXP bool PlugInPlaySoundEx(wxString &sound_file, int deviceIndex=-1)
Start playing a sound file asynchronously.
DECL_EXP wxBitmap GetIcon_PlugIn(const wxString &name)
Gets icon bitmap by name.
DECL_EXP double toUsrWindSpeed_Plugin(double kts_wspeed, int unit=-1)
Converts knots to user's preferred wind speed unit.
DECL_EXP wxWindow * GetOCPNCanvasWindow()
Gets OpenCPN's main canvas window.
_PI_NavMode
Navigation mode options for chart display orientation.
@ PI_NORTH_UP_MODE
North Up Mode - True north is always at the top of the display.
@ 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.
DECL_EXP void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex)
Sets mouse cursor for specific canvas.
DECL_EXP const std::unordered_map< std::string, std::string > GetAttributes(DriverHandle handle)
Query a specific driver for attributes.
DECL_EXP 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.
DECL_EXP void ConfigFlushAndReload()
Flush configuration changes to disk and reload settings.
DECL_EXP bool AddSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint, bool b_permanent=true)
Adds a waypoint with extended properties.
DECL_EXP bool GetEnableLatLonGrid(int CanvasIndex)
Gets latitude/longitude grid visibility state.
_PI_DisPrio
Display priority levels for S52 chart objects.
@ PI_PRIO_AREA_2
Superimposed areas including water features.
@ PI_PRIO_NUM
Number of priority levels.
@ PI_PRIO_AREA_1
Superimposed areas.
@ PI_PRIO_MARINERS
VRM, EBL, own ship (highest priority)
@ PI_PRIO_SYMB_POINT
Point symbols including land features.
@ PI_PRIO_ROUTEING
Routeing lines (TSS, recommended tracks)
@ PI_PRIO_GROUP1
S57 group 1 filled areas (land, etc)
@ PI_PRIO_SYMB_AREA
Area symbols including traffic areas.
@ PI_PRIO_SYMB_LINE
Line symbols including restricted areas.
@ PI_PRIO_NODATA
No data fill area pattern (lowest priority)
@ PI_PRIO_HAZARDS
Hazards, buoys, beacons.
bool DECL_EXP PI_PLIBSetContext(PI_S57Obj *pObj)
Sets S52 PLIB rendering context for an object.
DECL_EXP bool UpdatePlugInRouteEx(PlugIn_Route_Ex *proute)
Updates an existing extended route.
DECL_EXP std::vector< DriverHandle > GetActiveDrivers()
Query OCPN core for a list of active drivers
DECL_EXP void SetCursor_PlugIn(wxCursor *pPlugin_Cursor=NULL)
Sets mouse cursor.
enum CommDriverResult _CommDriverResult
Error return values
DECL_EXP void PositionBearingDistanceMercator_Plugin(double lat, double lon, double brg, double dist, double *dlat, double *dlon)
Calculates destination point given start point, bearing and distance.
DECL_EXP std::unique_ptr< PlugIn_Route > GetRoute_Plugin(const wxString &)
Gets route details by GUID.
_PI_DisCat
Display categories for S52 chart features.
@ PI_DISP_CAT_NUM
Number of categories (for array sizing)
@ PI_OTHER
Other - additional features for detailed navigation.
@ PI_MARINERS_OTHER
Additional mariner specified features.
@ 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.
DECL_EXP bool DecodeSingleVDOMessage(const wxString &str, PlugIn_Position_Fix_Ex *pos, wxString *acc)
Decodes a single VDO (Own Ship AIS) message.
PI_DisPrio DECL_EXP PI_GetObjectDisplayPriority(PI_S57Obj *pObj)
Gets display priority for object.
DECL_EXP double PlugInGetDisplaySizeMM()
Gets physical display size in millimeters.
DECL_EXP std::string GetPluginMsgPayload(PluginMsgId id, ObservedEvt ev)
Retrieve the string in a plugin message, internal or received on the REST insterface.
DECL_EXP double fromUsrDistance_Plugin(double usr_distance, int unit=-1)
Converts from user's preferred distance unit to nautical miles.
DECL_EXP wxWindow * PluginGetFocusCanvas()
Gets the currently focused chart canvas.
int DECL_EXP PI_PLIBRenderAreaToGL(const wxGLContext &glcc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect &render_rect)
Renders an S57 area object using OpenGL.
DECL_EXP bool UpdateSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint)
Updates an existing extended waypoint.
DECL_EXP void SetFullScreen(bool full_screen_on)
Sets full screen mode.
DECL_EXP void PluginCenterOwnship(int CanvasIndex)
Center the chart view on the own ship position for a specific canvas.
DECL_EXP double GetOCPNGUIToolScaleFactor_PlugIn()
Gets current global GUI scaling factor.
DECL_EXP wxString GetSelectedRouteGUID_Plugin()
Gets GUID of currently selected route.
DECL_EXP void DistanceBearingMercator_Plugin(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist)
Calculates bearing and distance between two points.
DECL_EXP wxColor GetGlobalColorD(std::string map_name, std::string name)
Gets a color from the global color scheme.
enum _PI_NavMode PI_NavMode
Navigation mode options for chart display orientation.
DECL_EXP void ShowGlobalSettingsDialog()
Display the global settings dialog.
DECL_EXP void SetToolbarToolBitmapsSVG(int item, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled)
Updates SVG graphics for toolbar tool.
DECL_EXP void PlugInPlaySound(wxString &sound_file)
Plays a sound file asynchronously.
_PI_LUPname
Name identifiers for S57 lookup table sets.
@ PI_PLAIN_BOUNDARIES
Area objects with simple boundaries.
@ PI_PAPER_CHART
Point objects using traditional paper chart symbols.
@ PI_LINES
Line objects (e.g., depth contours, coastlines)
@ PI_LUPNAME_NUM
Total number of lookup table types.
@ PI_SIMPLIFIED
Point objects using simplified symbols.
@ PI_SYMBOLIZED_BOUNDARIES
Area objects with symbolized boundaries.
DECL_EXP std::vector< std::string > GetPriorityMaps()
Gets list of configured priority mapping schemes.
DECL_EXP ArrayOfPlugIn_AIS_Targets * GetAISTargetArray(void)
Gets array of AIS targets.
DECL_EXP void EnableSplitScreenLayout(bool enable=true)
Enable or disable the split-screen layout.
DECL_EXP bool UpdateSingleWaypoint(PlugIn_Waypoint *pwaypoint)
Updates a single waypoint.
DECL_EXP void SetCanvasProjection(int projection)
Sets chart projection type.
DECL_EXP bool AddPlugInTrack(PlugIn_Track *ptrack, bool b_permanent=true)
Adds a new track.
DECL_EXP 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.
DECL_EXP wxString getUsrSpeedUnit_Plugin(int unit=-1)
Gets display string for user's preferred speed unit.
wxColour DECL_EXP GetBaseGlobalColor(wxString colorName)
Gets a global system color.
DECL_EXP bool GetEnableENCTextDisplay(int CanvasIndex)
Gets ENC text label visibility.
DECL_EXP bool GetEnableCompassGPSIcon(int CanvasIndex)
Gets compass icon visibility state.
OcpnProjTypePI
Enumeration of chart projection types.
@ PI_PROJECTION_UNKNOWN
Projection type is unknown or undefined.
@ PI_PROJECTION_MERCATOR
Mercator projection, standard for navigation charts.
@ PI_PROJECTION_STEREOGRAPHIC
Stereographic projection, used for polar and specialty charts.
@ PI_PROJECTION_GNOMONIC
Gnomonic projection, in which great circles appear as straight lines.
@ PI_PROJECTION_POLAR
Polar projection, used for polar regions.
@ PI_PROJECTION_POLYCONIC
Polyconic projection, sometimes used for inland charts.
@ PI_PROJECTION_TRANSVERSE_MERCATOR
Transverse Mercator projection, used for some coastal charts.
@ PI_PROJECTION_ORTHOGRAPHIC
Orthographic projection, showing Earth as viewed from space.
@ PI_PROJECTION_EQUIRECTANGULAR
Equirectangular/Plate Carrée projection, simple lat/lon grid.
DECL_EXP bool GetEnableMUIBar(int CanvasIndex)
Gets MUI bar visibility state.
DECL_EXP bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta, int canvasIndex)
Checks if chart should pan when cursor near edge.
DECL_EXP void EnableTouchMode(bool enable)
Enables/disables touch interface mode.
DECL_EXP void PluginZoomCanvas(int CanvasIndex, double factor)
Zoom a specific chart canvas by the given factor.
DECL_EXP wxString GetActiveWaypointGUID(void)
Gets GUID of currently active waypoint.
DECL_EXP void GetCanvasLLPix(PlugIn_ViewPort *vp, wxPoint p, double *plat, double *plon)
Converts canvas physical pixel coordinates to lat/lon.
DECL_EXP bool GetEnableLightDescriptionsDisplay(int CanvasIndex)
Gets light description text visibility.
enum _OBJECT_LAYER_REQ OBJECT_LAYER_REQ
Filter options for object queries.
DECL_EXP CommDriverResult RegisterTXPGNs(DriverHandle handle, std::vector< int > &pgn_list)
Register PGNs that this application intends to transmit for some NMEA 2000 adapters like Actisense NG...
DECL_EXP void SendPluginMessage(wxString message_id, wxString message_body)
Sends message to other plugins.
DECL_EXP wxString * GetpPrivateApplicationDataLocation()
Gets private application data directory.
DECL_EXP wxDialog * GetActiveOptionsDialog()
Gets pointer to active options dialog.
DECL_EXP void SetAppColorScheme(PI_ColorScheme cs)
Set the application color scheme.
DECL_EXP bool DeletePlugInTrack(wxString &GUID)
Deletes a track.
DECL_EXP bool GetEnableCurrentStationsDisplay(int CanvasIndex)
Gets current station icon visibility.
DECL_EXP int AddCanvasMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin, const char *name="")
Adds item to canvas context menu.
int DECL_EXP PI_PLIBRenderObjectToGL(const wxGLContext &glcc, PI_S57Obj *pObj, PlugIn_ViewPort *vp, wxRect &render_rect)
Renders any S57 object using OpenGL.
DECL_EXP bool GetEnableTideStationsDisplay(int CanvasIndex)
Gets tide station icon visibility.
DECL_EXP void SetCanvasMenuItemViz(int item, bool viz, const char *name="")
Temporarily changes context menu item visibility.
DECL_EXP void SetCanvasTilt(double tilt)
Gets current canvas tilt angle.
DECL_EXP std::vector< std::string > GetActivePriorityIdentifiers()
Gets list of active priority identifiers.
DECL_EXP void fromSM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Simple Mercator coordinates to geographic.
DECL_EXP int GetCanvasCount()
Gets total number of chart canvases.
DECL_EXP void PluginSetFollowMode(int CanvasIndex, bool enable_follow)
Set follow mode for a specific canvas.
double DECL_EXP PI_GetPLIBMarinerSafetyContour()
Gets configured safety contour depth.
DECL_EXP void EnableLightsDisplay(bool enable, int CanvasIndex)
Controls light icon display.
PI_InitReturn
Return values for plugin initialization.
@ PI_INIT_OK
Initialization successful.
@ PI_INIT_FAIL_NOERROR
Init failed, request no explicit error message.
@ PI_INIT_FAIL_RETRY
Init failed, retry suggested.
@ PI_INIT_FAIL_REMOVE
Init failed, suggest remove from further use.
DECL_EXP void fromTM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Transverse Mercator coordinates to geographic.
PI_DisCat DECL_EXP PI_GetObjectDisplayCategory(PI_S57Obj *pObj)
Gets display category for object.
DECL_EXP int RemoveChartFromDBInPlace(wxString &full_path)
Removes a chart from database without full rebuild.
DECL_EXP _OCPN_DLStatus OCPN_downloadFileBackground(const wxString &url, const wxString &outputFile, wxEvtHandler *handler, long *handle)
Asynchronously downloads a file in the background.
DECL_EXP wxString GetPluginDataDir(const char *plugin_name)
Return the plugin data directory for a given directory name.
DECL_EXP wxScrolledWindow * AddOptionsPage(OptionsParentPI parent, wxString title)
Adds a new preferences page to OpenCPN options dialog.
DECL_EXP bool GetTouchMode()
Gets touch interface mode state.
DECL_EXP wxString GetSelectedWaypointGUID_Plugin()
Gets GUID of currently selected waypoint.
DECL_EXP void ForceChartDBRebuild()
Forces complete rebuild of chart database.
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.
DECL_EXP void SetToolbarToolViz(int item, bool viz)
Temporarily changes toolbar tool visibility.
int DECL_EXP PI_GetPLIBSymbolStyle()
Gets configured S52 symbol style.
DECL_EXP void EnableCompassGPSIcon(bool enable, int CanvasIndex)
Controls visibility of compass/GPS status icon.
int DECL_EXP PI_GetPLIBBoundaryStyle()
Gets configured S52 boundary style.
Configuration options for date and time formatting.
wxString format_string
The format string for date/time.
DateTimeFormatOptions & SetFormatString(const wxString &fmt)
Sets the date/time format pattern string.
DateTimeFormatOptions & SetTimezone(const wxString &tz)
Sets the timezone mode for date/time display.
wxString time_zone
The timezone to use when formatting the date/time.
DateTimeFormatOptions & SetLongitude(double lon)
Sets the reference longitude for Local Mean Time (LMT) calculations.
double longitude
The longitude to use when formatting the date/time in Local Mean Time (LMT).
Identifier for NMEA 0183 sentence types.
const std::string id
Sentence identifier.
NMEA0183Id(const std::string &s)
Creates identifier from sentence type.
Identifier for NMEA 2000 message types.
const uint64_t id
The PGN value.
NMEA2000Id(int value)
Creates identifier from PGN value.
Navigation data message identifier.
const int type
Message type identifier (currently only 0 supported)
NavDataId()
Default constructor.
Facade for NavAddrPluginMsg.
Basic navigation data structure.
double var
Magnetic variation in degrees.
double cog
Course over ground in degrees.
double lon
Longitude in decimal degrees.
double lat
Latitude in decimal degrees.
double sog
Speed over ground in knots.
double hdt
True heading in degrees.
time_t time
UTC timestamp of data.
Identifier for Signal K paths.
SignalkId(const std::string &s)
Creates identifier from Signal K path.
const std::string id
Signal K path.
Geographic extent structure defining a bounding box.
double NLAT
Northern latitude boundary in decimal degrees.
double WLON
Western longitude boundary in decimal degrees.
double SLAT
Southern latitude boundary in decimal degrees.
double ELON
Eastern longitude boundary in decimal degrees.