33#include <wx/dynarray.h>
34#include <wx/imaglist.h>
39#include "nav_object_database.h"
41#include "ocpn_types.h"
42#include "observable_evtvar.h"
44#include "route_point.h"
51#define PI 3.1415926535897931160E0
54extern bool g_bPluginHandleAutopilotRoute;
58class markicon_bitmap_list_type;
59class markicon_key_list_type;
60class markicon_description_list_type;
62WX_DEFINE_SORTED_ARRAY(
MarkIcon *, SortedArrayOfMarkIcon);
63WX_DEFINE_ARRAY(
MarkIcon *, ArrayOfMarkIcon);
67 std::function<void(
Route*)> SetRouteAndUpdate;
69 std::function<void(
Route*)> Hide;
71 SetRouteAndUpdate([&](
Route* r) {}),
73 Hide([&](
Route* r) {})
87 std::function<
void()> RouteMgrDlgUpdateListCtrl);
94 bool IsRouteValid(
Route *pRoute);
96 Route *FindRouteByGUID(
const wxString &guid);
97 Track *FindTrackByGUID(
const wxString &guid);
100 wxArrayPtrVoid *GetRouteArrayContaining(
RoutePoint *pWP);
101 bool DoesRouteContainSharedPoints(
Route *pRoute);
102 void RemovePointFromRoute(
RoutePoint *point,
Route *route,
int route_state);
104 bool ActivateRoute(
Route *pRouteToActivate,
RoutePoint *pStartPoint = NULL);
108 double cog,
double sog);
110 bool UpdateAutopilot();
111 bool DeactivateRoute(
bool b_arrival =
false);
112 bool IsAnyRouteActive(
void) {
return (pActiveRoute != NULL); }
114 Route *GetpActiveRoute() {
return pActiveRoute; }
115 RoutePoint *GetpActivePoint() {
return pActivePoint; }
116 double GetCurrentRngToActivePoint() {
return CurrentRngToActivePoint; }
117 double GetCurrentBrgToActivePoint() {
return CurrentBrgToActivePoint; }
118 double GetCurrentRngToActiveNormalArrival() {
119 return CurrentRangeToActiveNormalCrossing;
121 double GetCurrentXTEToActivePoint() {
return CurrentXTEToActivePoint; }
122 void ZeroCurrentXTEToActivePoint();
123 double GetCurrentSegmentCourse() {
return CurrentSegmentCourse; }
124 int GetXTEDir() {
return XTEDir; }
126 void SetColorScheme(ColorScheme cs,
double displayDPmm);
127 wxPen *GetRoutePen(
void) {
return m_pRoutePen; }
128 wxPen *GetTrackPen(
void) {
return m_pTrackPen; }
129 wxPen *GetSelectedRoutePen(
void) {
return m_pSelectedRoutePen; }
130 wxPen *GetActiveRoutePen(
void) {
return m_pActiveRoutePen; }
131 wxPen *GetActiveRoutePointPen(
void) {
return m_pActiveRoutePointPen; }
132 wxPen *GetRoutePointPen(
void) {
return m_pRoutePointPen; }
133 wxBrush *GetRouteBrush(
void) {
return m_pRouteBrush; }
134 wxBrush *GetSelectedRouteBrush(
void) {
return m_pSelectedRouteBrush; }
135 wxBrush *GetActiveRouteBrush(
void) {
return m_pActiveRouteBrush; }
136 wxBrush *GetActiveRoutePointBrush(
void) {
return m_pActiveRoutePointBrush; }
137 wxBrush *GetRoutePointBrush(
void) {
return m_pRoutePointBrush; }
139 wxString GetRouteReverseMessage(
void);
140 wxString GetRouteResequenceMessage(
void);
157 double RouteBrgToActivePoint;
158 double CurrentSegmentBeginLat;
159 double CurrentSegmentBeginLon;
160 double CurrentRngToActivePoint;
161 double CurrentBrgToActivePoint;
162 double CurrentXTEToActivePoint;
163 double CourseToRouteSegment;
164 double CurrentRangeToActiveNormalCrossing;
167 double CurrentSegmentCourse;
172 wxPen *m_pSelectedRoutePen;
173 wxPen *m_pActiveRoutePen;
174 wxPen *m_pActiveRoutePointPen;
175 wxPen *m_pRoutePointPen;
176 wxBrush *m_pRouteBrush;
177 wxBrush *m_pSelectedRouteBrush;
178 wxBrush *m_pActiveRouteBrush;
179 wxBrush *m_pActiveRoutePointBrush;
180 wxBrush *m_pRoutePointBrush;
184 double m_arrival_min;
187 std::function<void()> m_route_mgr_dlg_update_list_ctrl;
201 wxBitmap *GetIconBitmap(
const wxString &icon_key);
202 bool GetIconPrescaled(
const wxString &icon_key);
203 unsigned int GetIconTexture(
const wxBitmap *pmb,
int &glw,
int &glh);
204 int GetIconIndex(
const wxBitmap *pbm);
205 int GetIconImageListIndex(
const wxBitmap *pbm);
206 int GetXIconImageListIndex(
const wxBitmap *pbm);
207 int GetFIconImageListIndex(
const wxBitmap *pbm);
208 int GetNumIcons(
void) {
return m_pIconArray->Count(); }
210 RoutePoint *GetNearbyWaypoint(
double lat,
double lon,
double radius_meters);
211 RoutePoint *GetOtherNearbyWaypoint(
double lat,
double lon,
212 double radius_meters,
213 const wxString &guid);
215 bool SharedWptsExist();
216 void DeleteAllWaypoints(
bool b_delete_used);
217 RoutePoint *FindRoutePointByGUID(
const wxString &guid);
218 void DestroyWaypoint(
RoutePoint *pRp,
bool b_update_changeset =
true);
219 void ClearRoutePointFonts(
void);
221 bool DoesIconExist(
const wxString &icon_key)
const;
222 wxBitmap GetIconBitmapForList(
int index,
int height);
223 wxString *GetIconDescription(
int index);
224 wxString *GetIconKey(
int index);
225 wxString GetIconDescription(wxString icon_key);
227 wxImageList *Getpmarkicon_image_list(
int nominal_height);
231 RoutePointList *GetWaypointList(
void) {
return m_pWayPointList; }
235 wxImage CreateDimImage(wxImage &image,
double factor);
237 RoutePointList *m_pWayPointList;
238 wxBitmap *CreateDimBitmap(wxBitmap *pBitmap,
double factor);
240 wxImageList *pmarkicon_image_list;
242 int m_markicon_image_list_base_count;
243 ArrayOfMarkIcon *m_pIconArray;
246 double m_iconListScale;
248 SortedArrayOfMarkIcon *m_pLegacyIconArray;
249 SortedArrayOfMarkIcon *m_pExtendedIconArray;
251 int m_bitmapSizeForList;
252 int m_iconListHeight;
Generic event handling between between two parties like MVC Model and Controller using a shared Event...
bool ActivateRoutePoint(Route *pA, RoutePoint *pRP)
bool ActivateNextPoint(Route *pr, bool skipped)
bool DeleteRoute(Route *pRoute, NavObjectChanges *nav_obj_changes)
EventVar json_msg
Notified with message targeting all plugins.
EventVar json_leg_info
Notified with a shared_ptr<ActiveLegDat>, leg info to all plugins.