24 #ifndef _ROUTEPOINT_H__
25 #define _ROUTEPOINT_H__
29 #include <wx/bitmap.h>
30 #include <wx/colour.h>
31 #include <wx/datetime.h>
32 #include <wx/string.h>
34 #include "model/hyperlink.h"
38 #define MAX_INT_VAL 2147483647
41 #define SCAMIN_MIN 800
43 #define ETA_FORMAT_STR "%x %H:%M"
47 extern wxColour g_colourWaypointRangeRingsColour;
49 extern int g_LayerIdx;
51 extern wxRect g_blink_rect;
57 RoutePoint(
double lat,
double lon,
const wxString &icon_ident,
58 const wxString &name,
const wxString &pGUID = wxEmptyString,
59 bool bAddToList =
true);
72 void ReLoadIcon() { m_IconIsDirty =
true; }
74 void SetPosition(
double lat,
double lon);
75 double GetLatitude() {
return m_lat; };
76 double GetLongitude() {
return m_lon; };
77 LLBBox &GetBBox() {
return m_wpBBox; }
80 bool IsVisible() {
return m_bIsVisible; }
81 bool IsListed() {
return m_bIsListed; }
82 bool IsNameShown() {
return m_bShowName; }
84 bool IsShared() {
return m_bsharedMark; }
85 void SetShared(
bool bshared) { m_bsharedMark = bshared; }
87 bool IsSharedInVisibleRoute(
void);
89 bool IsVisibleSelectable(
double scale_val,
bool boverrideViz =
false);
90 void SetVisible(
bool viz =
true) { m_bIsVisible = viz; }
91 void SetListed(
bool viz =
true) { m_bIsListed = viz; }
92 void SetNameShown(
bool viz =
true) { m_bShowName = viz; }
93 bool GetNameShown() {
return m_bShowName; }
94 virtual wxString GetName(
void) {
return m_MarkName; }
95 wxString GetDescription(
void) {
return m_MarkDescription; }
97 wxDateTime GetCreateTime(
void);
98 void SetCreateTime(wxDateTime dt);
100 wxString GetIconName(
void) {
return m_IconName; }
101 void SetIconName(wxString name) { m_IconName = name; }
103 void *GetSelectNode(
void) {
return m_SelectNode; }
104 void SetSelectNode(
void *node) { m_SelectNode = node; }
106 void *GetManagerListNode(
void) {
return m_ManagerNode; }
107 void SetManagerListNode(
void *node) { m_ManagerNode = node; }
109 void SetName(
const wxString &name);
110 void CalculateNameExtents(
void);
112 void SetCourse(
double course) { m_routeprop_course = course; };
113 double GetCourse() {
return m_routeprop_course; };
114 void SetDistance(
double distance) { m_routeprop_distance = distance; };
115 double GetDistance() {
return m_routeprop_distance; };
117 void SetWaypointArrivalRadius(
double dArrivalDistance) {
118 m_WaypointArrivalRadius = dArrivalDistance;
120 void SetWaypointArrivalRadius(wxString wxArrivalDistance) {
121 wxArrivalDistance.ToDouble(&m_WaypointArrivalRadius);
123 double GetWaypointArrivalRadius();
124 bool GetShowWaypointRangeRings(
void) {
return m_bShowWaypointRangeRings; };
125 int GetWaypointRangeRingsNumber(
void);
126 float GetWaypointRangeRingsStep(
void);
127 int GetWaypointRangeRingsStepUnits(
void);
128 void SetShowWaypointRangeRings(
bool b_showWaypointRangeRings) {
129 m_bShowWaypointRangeRings = b_showWaypointRangeRings;
131 void SetWaypointRangeRingsNumber(
int i_WaypointRangeRingsNumber) {
132 m_iWaypointRangeRingsNumber = i_WaypointRangeRingsNumber;
134 void SetWaypointRangeRingsStep(
float f_WaypointRangeRingsStep) {
135 m_fWaypointRangeRingsStep = f_WaypointRangeRingsStep;
137 void SetWaypointRangeRingsStepUnits(
int i_WaypointRangeRingsStepUnits) {
138 m_iWaypointRangeRingsStepUnits = i_WaypointRangeRingsStepUnits;
140 void SetWaypointRangeRingsColour(wxColour wxc_WaypointRangeRingsColour) {
141 m_wxcWaypointRangeRingsColour = wxc_WaypointRangeRingsColour;
143 void SetScaMin(wxString str);
144 void SetScaMin(
long val);
145 long GetScaMin() {
return m_ScaMin; };
146 void SetScaMax(wxString str);
147 void SetScaMax(
long val);
148 long GetScaMax() {
return m_ScaMax; };
149 bool GetUseSca() {
return b_UseScamin; };
150 void SetUseSca(
bool value) { b_UseScamin = value; };
151 bool IsDragHandleEnabled() {
return m_bDrawDragHandle; }
152 void SetPlannedSpeed(
double spd);
153 double GetPlannedSpeed();
155 wxDateTime GetManualETD();
156 void SetETD(
const wxDateTime &etd);
157 bool SetETD(
const wxString &ts);
160 void SetETE(wxLongLong secs);
166 wxDateTime m_seg_etd;
167 wxDateTime m_seg_eta;
168 wxLongLong m_seg_ete = 0;
169 bool m_manual_etd{
false};
171 bool m_bPtIsSelected;
172 bool m_bRPIsBeingEdited;
175 bool m_bIsolatedMark;
181 wxString m_MarkDescription;
184 wxString m_TideStation;
187 wxColour m_FontColor;
189 wxSize m_NameExtents;
193 bool m_bShowName, m_bShowNameData;
194 wxRect CurrentRect_in_DC;
195 int m_NameLocationOffsetX;
196 int m_NameLocationOffsetY;
200 double m_routeprop_course;
202 double m_routeprop_distance;
207 bool m_bShowWaypointRangeRings;
208 int m_iWaypointRangeRingsNumber;
210 float m_fWaypointRangeRingsStep;
211 int m_iWaypointRangeRingsStepUnits;
212 wxColour m_wxcWaypointRangeRingsColour;
214 unsigned int m_iTextTexture;
215 int m_iTextTextureWidth, m_iTextTextureHeight;
218 double m_wpBBox_view_scale_ppm, m_wpBBox_rotation;
220 bool m_pos_on_screen;
221 wxPoint2DDouble m_screen_pos;
223 double m_WaypointArrivalRadius;
224 HyperlinkList *m_HyperlinkList;
226 wxString m_timestring;
228 wxDateTime m_CreateTimeX;
239 float m_IconScaleFactor;
240 wxBitmap m_ScaledBMP;
242 bool m_bDrawDragHandle;
244 int m_drag_line_length_man, m_drag_icon_offset;
245 double m_dragHandleLat, m_dragHandleLon;
246 int m_draggingOffsetx, m_draggingOffsety;
250 double m_PlannedSpeed;
255 unsigned int m_dragIconTexture;
256 int m_dragIconTextureWidth, m_dragIconTextureHeight;
static std::function< void(unsigned, const unsigned *)> delete_gl_textures
Horrible Hack (tm).