24#ifndef _ROUTEPOINT_H__
25#define _ROUTEPOINT_H__
31#include <wx/datetime.h>
34#include "model/hyperlink.h"
38#define MAX_INT_VAL 2147483647
43#define ETA_FORMAT_STR "%x %H:%M"
47extern wxColour g_colourWaypointRangeRingsColour;
51extern wxRect g_blink_rect;
74 RoutePoint(
double lat,
double lon,
const wxString &icon_ident,
75 const wxString &name,
const wxString &pGUID = wxEmptyString,
76 bool bAddToList =
true);
91 void SetPosition(
double lat,
double lon);
92 double GetLatitude() {
return m_lat; };
93 double GetLongitude() {
return m_lon; };
94 LLBBox &GetBBox() {
return m_wpBBox; }
102 bool IsShared() {
return m_bsharedMark; }
103 void SetShared(
bool bshared) { m_bsharedMark = bshared; }
105 bool IsSharedInVisibleRoute(
void);
107 bool IsVisibleSelectable(
double scale_val,
bool boverrideViz =
false);
108 void SetVisible(
bool viz =
true) {
m_bIsVisible = viz; }
109 void SetListed(
bool viz =
true) {
m_bIsListed = viz; }
110 void SetNameShown(
bool viz =
true) {
m_bShowName = viz; }
112 virtual wxString GetName(
void) {
return m_MarkName; }
120 wxString GetIconName(
void) {
return m_IconName; }
121 void SetIconName(wxString name) { m_IconName = name; }
123 void *GetSelectNode(
void) {
return m_SelectNode; }
124 void SetSelectNode(
void *node) { m_SelectNode = node; }
126 void *GetManagerListNode(
void) {
return m_ManagerNode; }
127 void SetManagerListNode(
void *node) { m_ManagerNode = node; }
129 void SetName(
const wxString &name);
130 void CalculateNameExtents(
void);
137 void SetWaypointArrivalRadius(
double dArrivalDistance) {
140 void SetWaypointArrivalRadius(wxString wxArrivalDistance) {
143 double GetWaypointArrivalRadius();
145 int GetWaypointRangeRingsNumber(
void);
146 float GetWaypointRangeRingsStep(
void);
147 int GetWaypointRangeRingsStepUnits(
void);
148 void SetShowWaypointRangeRings(
bool b_showWaypointRangeRings) {
151 void SetWaypointRangeRingsNumber(
int i_WaypointRangeRingsNumber) {
154 void SetWaypointRangeRingsStep(
float f_WaypointRangeRingsStep) {
157 void SetWaypointRangeRingsStepUnits(
int i_WaypointRangeRingsStepUnits) {
160 void SetWaypointRangeRingsColour(wxColour wxc_WaypointRangeRingsColour) {
163 void SetTideStation(wxString TideStation) {
m_TideStation = TideStation; };
164 void SetScaMin(wxString str);
165 void SetScaMin(
long val);
166 long GetScaMin() {
return m_ScaMin; };
167 void SetScaMax(wxString str);
168 void SetScaMax(
long val);
169 long GetScaMax() {
return m_ScaMax; };
170 bool GetUseSca() {
return b_UseScamin; };
171 void SetUseSca(
bool value) { b_UseScamin = value; };
172 bool IsDragHandleEnabled() {
return m_bDrawDragHandle; }
173 void SetPlannedSpeed(
double spd);
226 void SetETD(
const wxDateTime &etd);
246 bool SetETD(
const wxString &ts);
284 void SetETE(wxLongLong secs);
526 double m_wpBBox_view_scale_ppm, m_wpBBox_rotation;
566 float m_IconScaleFactor;
567 wxBitmap m_ScaledBMP;
569 bool m_bDrawDragHandle;
571 int m_drag_line_length_man, m_drag_icon_offset;
572 double m_dragHandleLat, m_dragHandleLon;
573 int m_draggingOffsetx, m_draggingOffsety;
602 double m_PlannedSpeed;
609 unsigned int m_dragIconTexture;
610 int m_dragIconTextureWidth, m_dragIconTextureHeight;
Represents a waypoint or mark within the navigation system.
HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
wxColour m_wxcWaypointRangeRingsColour
Color for the range rings display.
wxString m_MarkDescription
Description text for the waypoint.
LLBBox m_wpBBox
Bounding box for the waypoint.
int m_iWaypointRangeRingsNumber
Number of range rings to display around the waypoint.
int m_NameLocationOffsetX
Horizontal offset for waypoint name placement relative to the icon.
void SetCreateTime(wxDateTime dt)
Sets the create time of this RoutePoint in UTC.
static std::function< void(unsigned, const unsigned *)> delete_gl_textures
Horrible Hack (tm).
bool m_bRPIsBeingEdited
Flag indicating if this waypoint is currently being edited.
wxRect CurrentRect_in_DC
Current rectangle occupied by the waypoint in the display.
unsigned int m_iTextTexture
Texture identifier for rendered text.
wxString m_GUID
Globally Unique Identifier for the waypoint.
wxDateTime GetETD()
Retrieves the Estimated Time of Departure for this waypoint, in UTC.
wxDateTime m_CreateTimeX
Creation timestamp for the waypoint, in UTC.
int m_NameLocationOffsetY
Vertical offset for waypoint name placement relative to the icon.
bool m_bIsolatedMark
Flag indicating if the waypoint is a standalone mark.
double m_routeprop_distance
Distance from this waypoint to the next waypoint, in nautical miles.
bool m_bShowNameData
Flag indicating if waypoint data should be shown with the name.
bool m_pos_on_screen
Flag indicating if the waypoint is currently visible on screen.
bool m_bIsActive
Flag indicating if this waypoint is active for navigation.
wxDateTime GetManualETD()
Retrieves the manually set Estimated Time of Departure for this waypoint, in UTC.
int m_iTextTextureHeight
Height of the text texture in pixels.
wxDateTime m_seg_etd
Estimated Time of Departure from this waypoint, in UTC.
bool m_bIsInRoute
Flag indicating if this waypoint is part of a route.
bool m_IconIsDirty
Flag indicating if the waypoint icon needs to be reloaded or redrawn.
wxFont * m_pMarkFont
Font used for rendering the waypoint name.
double m_routeprop_course
Course from this waypoint to the next waypoint, in degrees.
double m_seg_len
Length of the leg from previous waypoint to this waypoint in nautical miles.
bool m_bShowName
Flag indicating if the waypoint name should be shown.
wxString GetETE()
Retrieves the Estimated Time En route as a formatted string.
wxString m_timestring
String representation of the waypoint creation time.
bool m_bBlink
Flag indicating if the waypoint should blink when displayed.
double GetPlannedSpeed()
Return the planned speed associated with this waypoint.
bool m_bPtIsSelected
Flag indicating if this waypoint is currently selected.
bool m_bIsVisible
Flag indicating if the waypoint should be drawn on the chart.
bool m_bIsInLayer
Flag indicating if the waypoint belongs to a layer.
double m_WaypointArrivalRadius
Arrival radius in nautical miles.
int m_iTextTextureWidth
Width of the text texture in pixels.
bool m_btemp
Flag indicating if this is a temporary waypoint.
bool m_manual_etd
Flag indicating whether the ETD has been manually set by the user.
wxColour m_FontColor
Color used for rendering the waypoint name.
double m_seg_vmg
Planned speed for traveling FROM this waypoint TO the next waypoint.
wxSize m_NameExtents
Size of the waypoint name text when rendered.
wxDateTime m_seg_eta
Estimated Time of Arrival at this waypoint, in UTC.
int m_LayerID
Layer identifier if the waypoint belongs to a layer.
int m_iWaypointRangeRingsStepUnits
Units for the range rings step (0=nm, 1=km).
wxDateTime GetCreateTime(void)
Returns the Create Time of this RoutePoint in UTC.
float m_fWaypointRangeRingsStep
Distance between consecutive range rings.
wxLongLong m_seg_ete
Estimated Time Enroute for the leg leading to this waypoint.
wxPoint2DDouble m_screen_pos
Cached screen position of the waypoint for drawing arrows and points.
wxString m_TideStation
Associated tide station identifier.
bool m_bShowWaypointRangeRings
Flag indicating if range rings should be shown around the waypoint.
void SetETD(const wxDateTime &etd)
Sets the Estimated Time of Departure for this waypoint, in UTC.
wxDateTime GetETA()
Retrieves the Estimated Time of Arrival for this waypoint, in UTC.
bool m_bIsListed
Flag indicating if the waypoint should appear in the Route Manager dialog's waypoint list.