OpenCPN Partial API docs
|
Represents a waypoint or mark within the navigation system. More...
#include <route_point.h>
Public Member Functions | |
RoutePoint (double lat, double lon, const wxString &icon_ident, const wxString &name, const wxString &pGUID=wxEmptyString, bool bAddToList=true) | |
RoutePoint (RoutePoint *orig) | |
void | ReLoadIcon () |
void | SetPosition (double lat, double lon) |
double | GetLatitude () |
double | GetLongitude () |
LLBBox & | GetBBox () |
bool | IsSame (RoutePoint *pOtherRP) |
bool | IsVisible () |
bool | IsListed () |
bool | IsNameShown () |
bool | IsNameDynamic () |
bool | IsShared () |
void | SetShared (bool bshared) |
bool | IsSharedInVisibleRoute (void) |
bool | IsVisibleSelectable (double scale_val, bool boverrideViz=false) |
void | SetVisible (bool viz=true) |
void | SetListed (bool viz=true) |
void | SetNameShown (bool viz=true) |
bool | GetNameShown () |
virtual wxString | GetName (void) |
wxString | GetDescription (void) |
wxDateTime | GetCreateTime (void) |
void | SetCreateTime (wxDateTime dt) |
wxString | GetIconName (void) |
void | SetIconName (wxString name) |
void * | GetSelectNode (void) |
void | SetSelectNode (void *node) |
void * | GetManagerListNode (void) |
void | SetManagerListNode (void *node) |
void | SetName (const wxString &name) |
void | CalculateNameExtents (void) |
void | SetCourse (double course) |
double | GetCourse () |
void | SetDistance (double distance) |
double | GetDistance () |
void | SetWaypointArrivalRadius (double dArrivalDistance) |
void | SetWaypointArrivalRadius (wxString wxArrivalDistance) |
double | GetWaypointArrivalRadius () |
bool | GetShowWaypointRangeRings (void) |
int | GetWaypointRangeRingsNumber (void) |
float | GetWaypointRangeRingsStep (void) |
int | GetWaypointRangeRingsStepUnits (void) |
void | SetShowWaypointRangeRings (bool b_showWaypointRangeRings) |
void | SetWaypointRangeRingsNumber (int i_WaypointRangeRingsNumber) |
void | SetWaypointRangeRingsStep (float f_WaypointRangeRingsStep) |
void | SetWaypointRangeRingsStepUnits (int i_WaypointRangeRingsStepUnits) |
void | SetWaypointRangeRingsColour (wxColour wxc_WaypointRangeRingsColour) |
void | SetScaMin (wxString str) |
void | SetScaMin (long val) |
long | GetScaMin () |
void | SetScaMax (wxString str) |
void | SetScaMax (long val) |
long | GetScaMax () |
bool | GetUseSca () |
void | SetUseSca (bool value) |
bool | IsDragHandleEnabled () |
void | SetPlannedSpeed (double spd) |
double | GetPlannedSpeed () |
wxDateTime | GetETD () |
Retrieves the Estimated Time of Departure for this waypoint, in UTC. | |
wxDateTime | GetManualETD () |
Retrieves the manually set Estimated Time of Departure for this waypoint, in UTC. | |
void | SetETD (const wxDateTime &etd) |
Sets the Estimated Time of Departure for this waypoint, in UTC. | |
bool | SetETD (const wxString &ts) |
Sets the Estimated Time of Departure from a string. | |
wxDateTime | GetETA () |
Retrieves the Estimated Time of Arrival for this waypoint, in UTC. | |
wxString | GetETE () |
Retrieves the Estimated Time En route as a formatted string. | |
void | SetETE (wxLongLong secs) |
Public Attributes | |
double | m_lat |
double | m_lon |
double | m_seg_len |
double | m_seg_vmg |
Planned speed for traveling FROM this waypoint TO the next waypoint. | |
wxDateTime | m_seg_etd |
Estimated Time of Departure from this waypoint, in UTC. | |
wxDateTime | m_seg_eta |
Estimated Time of Arrival at this waypoint, in UTC. | |
wxLongLong | m_seg_ete = 0 |
Estimated Time Enroute for the leg leading to this waypoint. | |
bool | m_manual_etd {false} |
Flag indicating whether the ETD has been manually set by the user. | |
bool | m_bPtIsSelected |
bool | m_bRPIsBeingEdited |
bool | m_bIsInRoute |
bool | m_bIsolatedMark |
Flag indicating if the waypoint is a standalone mark. | |
bool | m_bIsVisible |
bool | m_bIsListed |
bool | m_bIsActive |
bool | m_IconIsDirty |
wxString | m_MarkDescription |
wxString | m_GUID |
wxString | m_TideStation |
wxFont * | m_pMarkFont |
wxColour | m_FontColor |
wxSize | m_NameExtents |
bool | m_bBlink |
bool | m_bShowName |
bool | m_bShowNameData |
wxRect | CurrentRect_in_DC |
int | m_NameLocationOffsetX |
int | m_NameLocationOffsetY |
bool | m_bIsInLayer |
int | m_LayerID |
double | m_routeprop_course |
double | m_routeprop_distance |
bool | m_btemp |
bool | m_bShowWaypointRangeRings |
int | m_iWaypointRangeRingsNumber |
float | m_fWaypointRangeRingsStep |
int | m_iWaypointRangeRingsStepUnits |
wxColour | m_wxcWaypointRangeRingsColour |
unsigned int | m_iTextTexture |
int | m_iTextTextureWidth |
int | m_iTextTextureHeight |
LLBBox | m_wpBBox |
double | m_wpBBox_view_scale_ppm |
double | m_wpBBox_rotation |
bool | m_pos_on_screen |
wxPoint2DDouble | m_screen_pos |
double | m_WaypointArrivalRadius |
HyperlinkList * | m_HyperlinkList |
wxString | m_timestring |
wxDateTime | m_CreateTimeX |
Static Public Attributes | |
static std::function< void(unsigned, const unsigned *) | delete_gl_textures ) |
Horrible Hack (tm). | |
Friends | |
class | RoutePointGui |
Represents a waypoint or mark within the navigation system.
RoutePoint represents both standalone marks and waypoints that are part of routes or tracks. A RoutePoint contains geographical coordinates, display properties, and various navigation-related attributes.
RoutePoints can exist in several states:
The class manages visual properties like icons, visibility, and range rings, as well as navigation data like arrival radius, planned speed, and ETAs.
Definition at line 68 of file route_point.h.
RoutePoint::RoutePoint | ( | double | lat, |
double | lon, | ||
const wxString & | icon_ident, | ||
const wxString & | name, | ||
const wxString & | pGUID = wxEmptyString, | ||
bool | bAddToList = true ) |
Definition at line 175 of file route_point.cpp.
RoutePoint::RoutePoint | ( | RoutePoint * | orig | ) |
Definition at line 119 of file route_point.cpp.
RoutePoint::RoutePoint | ( | ) |
Definition at line 53 of file route_point.cpp.
|
virtual |
Definition at line 261 of file route_point.cpp.
void RoutePoint::CalculateNameExtents | ( | void | ) |
Definition at line 290 of file route_point.cpp.
|
inline |
Definition at line 92 of file route_point.h.
|
inline |
Definition at line 129 of file route_point.h.
wxDateTime RoutePoint::GetCreateTime | ( | void | ) |
Definition at line 272 of file route_point.cpp.
|
inline |
Definition at line 111 of file route_point.h.
|
inline |
Definition at line 131 of file route_point.h.
wxDateTime RoutePoint::GetETA | ( | ) |
Retrieves the Estimated Time of Arrival for this waypoint, in UTC.
This function returns the stored Estimated Time of Arrival (ETA) if it's valid. The ETA is typically calculated based on route planning data such as distances and planned speeds.
For the first waypoint in a route, the ETA represents when the vessel is expected to reach this waypoint from its current position or a designated starting point. It is calculated based on:
For subsequent waypoints, it represents when the vessel is expected to arrive after leaving the previous waypoint.
The relationship between waypoints creates a timing chain: The ETA at one waypoint determines the default ETD from that waypoint, which then affects the ETA at the next waypoint, and so on through the route.
Definition at line 515 of file route_point.cpp.
wxDateTime RoutePoint::GetETD | ( | ) |
Retrieves the Estimated Time of Departure for this waypoint, in UTC.
This function returns the waypoint's ETD (Estimated Time of Departure), considering both explicitly set ETD values and values embedded in the waypoint description.
Definition at line 463 of file route_point.cpp.
wxString RoutePoint::GetETE | ( | ) |
Retrieves the Estimated Time En route as a formatted string.
This function returns the Estimated Time En route (ETE) for this waypoint as a formatted time delta string. The ETE represents the expected travel time to reach this waypoint from the previous point in a route.
Definition at line 522 of file route_point.cpp.
|
inline |
Definition at line 116 of file route_point.h.
|
inline |
Definition at line 90 of file route_point.h.
|
inline |
Definition at line 91 of file route_point.h.
|
inline |
Definition at line 122 of file route_point.h.
wxDateTime RoutePoint::GetManualETD | ( | ) |
Retrieves the manually set Estimated Time of Departure for this waypoint, in UTC.
This function returns the manually set ETD (Estimated Time of Departure) value only if the ETD was explicitly set by a user rather than calculated automatically. If the ETD is not manually set or if the ETD is invalid, the function returns an invalid datetime value.
The function checks two conditions:
Definition at line 508 of file route_point.cpp.
|
inlinevirtual |
Definition at line 110 of file route_point.h.
|
inline |
Definition at line 109 of file route_point.h.
double RoutePoint::GetPlannedSpeed | ( | ) |
Definition at line 446 of file route_point.cpp.
|
inline |
Definition at line 164 of file route_point.h.
|
inline |
Definition at line 161 of file route_point.h.
|
inline |
Definition at line 119 of file route_point.h.
|
inline |
Definition at line 140 of file route_point.h.
|
inline |
Definition at line 165 of file route_point.h.
double RoutePoint::GetWaypointArrivalRadius | ( | ) |
Definition at line 389 of file route_point.cpp.
int RoutePoint::GetWaypointRangeRingsNumber | ( | void | ) |
Definition at line 397 of file route_point.cpp.
float RoutePoint::GetWaypointRangeRingsStep | ( | void | ) |
Definition at line 404 of file route_point.cpp.
int RoutePoint::GetWaypointRangeRingsStepUnits | ( | void | ) |
Definition at line 411 of file route_point.cpp.
|
inline |
Definition at line 167 of file route_point.h.
|
inline |
Definition at line 96 of file route_point.h.
bool RoutePoint::IsNameDynamic | ( | ) |
Check if the name is dynamic for resequencing purposes. If the name is part of a route, and has 3 numeric characters, then it is dynamic and can be resequenced.
Definition at line 368 of file route_point.cpp.
|
inline |
Definition at line 97 of file route_point.h.
bool RoutePoint::IsSame | ( | RoutePoint * | pOtherRP | ) |
Definition at line 352 of file route_point.cpp.
|
inline |
Definition at line 100 of file route_point.h.
bool RoutePoint::IsSharedInVisibleRoute | ( | void | ) |
Definition at line 324 of file route_point.cpp.
|
inline |
Definition at line 95 of file route_point.h.
bool RoutePoint::IsVisibleSelectable | ( | double | scale_val, |
bool | boverrideViz = false ) |
Definition at line 306 of file route_point.cpp.
|
inline |
Definition at line 87 of file route_point.h.
|
inline |
Definition at line 128 of file route_point.h.
void RoutePoint::SetCreateTime | ( | wxDateTime | dt | ) |
Definition at line 279 of file route_point.cpp.
|
inline |
Definition at line 130 of file route_point.h.
void RoutePoint::SetETD | ( | const wxDateTime & | etd | ) |
Sets the Estimated Time of Departure for this waypoint, in UTC.
This function sets the ETD (Estimated Time of Departure) for the waypoint and marks it as manually set by setting the m_manual_etd flag to true.
etd | The wxDateTime object representing the estimated time of departure. |
Definition at line 531 of file route_point.cpp.
bool RoutePoint::SetETD | ( | const wxString & | ts | ) |
Sets the Estimated Time of Departure from a string.
This function attempts to parse a datetime string and set it as the ETD value. If successful, it marks the ETD as manually set. If the input string is empty, it clears the ETD value and resets the manual flag.
The function tries two parsing methods:
ts | String containing the datetime to set as ETD. |
Definition at line 536 of file route_point.cpp.
void RoutePoint::SetETE | ( | wxLongLong | secs | ) |
Definition at line 529 of file route_point.cpp.
|
inline |
Definition at line 117 of file route_point.h.
|
inline |
Definition at line 107 of file route_point.h.
|
inline |
Definition at line 123 of file route_point.h.
void RoutePoint::SetName | ( | const wxString & | name | ) |
Definition at line 281 of file route_point.cpp.
|
inline |
Definition at line 108 of file route_point.h.
void RoutePoint::SetPlannedSpeed | ( | double | spd | ) |
Definition at line 442 of file route_point.cpp.
void RoutePoint::SetPosition | ( | double | lat, |
double | lon ) |
Definition at line 347 of file route_point.cpp.
void RoutePoint::SetScaMax | ( | long | val | ) |
Definition at line 431 of file route_point.cpp.
void RoutePoint::SetScaMax | ( | wxString | str | ) |
Definition at line 436 of file route_point.cpp.
void RoutePoint::SetScaMin | ( | long | val | ) |
Definition at line 418 of file route_point.cpp.
void RoutePoint::SetScaMin | ( | wxString | str | ) |
Definition at line 425 of file route_point.cpp.
|
inline |
Definition at line 120 of file route_point.h.
|
inline |
Definition at line 101 of file route_point.h.
|
inline |
Definition at line 144 of file route_point.h.
|
inline |
Definition at line 166 of file route_point.h.
|
inline |
Definition at line 106 of file route_point.h.
|
inline |
Definition at line 133 of file route_point.h.
|
inline |
Definition at line 136 of file route_point.h.
|
inline |
Definition at line 156 of file route_point.h.
|
inline |
Definition at line 147 of file route_point.h.
|
inline |
Definition at line 150 of file route_point.h.
|
inline |
Definition at line 153 of file route_point.h.
|
friend |
Definition at line 69 of file route_point.h.
wxRect RoutePoint::CurrentRect_in_DC |
Definition at line 377 of file route_point.h.
|
static |
Horrible Hack (tm).
The destructor needs to call glDeleteTextures, but this is not visible for RoutePoint. This is basically a global, initially doing nothing but at an "early stage" initiated do do the actual glDeleteTextures call.
Definition at line 50 of file route_point.h.
bool RoutePoint::m_bBlink |
Definition at line 375 of file route_point.h.
bool RoutePoint::m_bIsActive |
Definition at line 363 of file route_point.h.
bool RoutePoint::m_bIsInLayer |
Definition at line 380 of file route_point.h.
bool RoutePoint::m_bIsInRoute |
Definition at line 357 of file route_point.h.
bool RoutePoint::m_bIsListed |
Definition at line 362 of file route_point.h.
bool RoutePoint::m_bIsolatedMark |
Flag indicating if the waypoint is a standalone mark.
Definition at line 359 of file route_point.h.
bool RoutePoint::m_bIsVisible |
Definition at line 361 of file route_point.h.
bool RoutePoint::m_bPtIsSelected |
Definition at line 354 of file route_point.h.
bool RoutePoint::m_bRPIsBeingEdited |
Definition at line 355 of file route_point.h.
bool RoutePoint::m_bShowName |
Definition at line 376 of file route_point.h.
bool RoutePoint::m_bShowNameData |
Definition at line 376 of file route_point.h.
bool RoutePoint::m_bShowWaypointRangeRings |
Definition at line 390 of file route_point.h.
bool RoutePoint::m_btemp |
Definition at line 388 of file route_point.h.
wxDateTime RoutePoint::m_CreateTimeX |
Definition at line 411 of file route_point.h.
wxColour RoutePoint::m_FontColor |
Definition at line 371 of file route_point.h.
float RoutePoint::m_fWaypointRangeRingsStep |
Definition at line 393 of file route_point.h.
wxString RoutePoint::m_GUID |
Definition at line 366 of file route_point.h.
HyperlinkList* RoutePoint::m_HyperlinkList |
Definition at line 407 of file route_point.h.
bool RoutePoint::m_IconIsDirty |
Definition at line 364 of file route_point.h.
unsigned int RoutePoint::m_iTextTexture |
Definition at line 397 of file route_point.h.
int RoutePoint::m_iTextTextureHeight |
Definition at line 398 of file route_point.h.
int RoutePoint::m_iTextTextureWidth |
Definition at line 398 of file route_point.h.
int RoutePoint::m_iWaypointRangeRingsNumber |
Definition at line 391 of file route_point.h.
int RoutePoint::m_iWaypointRangeRingsStepUnits |
Definition at line 394 of file route_point.h.
double RoutePoint::m_lat |
Definition at line 267 of file route_point.h.
int RoutePoint::m_LayerID |
Definition at line 381 of file route_point.h.
double RoutePoint::m_lon |
Definition at line 267 of file route_point.h.
bool RoutePoint::m_manual_etd {false} |
Flag indicating whether the ETD has been manually set by the user.
When true, this flag indicates that the m_seg_etd value was explicitly set by the user rather than being calculated automatically by the navigation system. This affects how the ETD is treated in route calculations and UI display.
Definition at line 352 of file route_point.h.
wxString RoutePoint::m_MarkDescription |
Definition at line 365 of file route_point.h.
wxSize RoutePoint::m_NameExtents |
Definition at line 373 of file route_point.h.
int RoutePoint::m_NameLocationOffsetX |
Definition at line 378 of file route_point.h.
int RoutePoint::m_NameLocationOffsetY |
Definition at line 379 of file route_point.h.
wxFont* RoutePoint::m_pMarkFont |
Definition at line 370 of file route_point.h.
bool RoutePoint::m_pos_on_screen |
Definition at line 403 of file route_point.h.
double RoutePoint::m_routeprop_course |
Definition at line 383 of file route_point.h.
double RoutePoint::m_routeprop_distance |
Definition at line 385 of file route_point.h.
wxPoint2DDouble RoutePoint::m_screen_pos |
Definition at line 404 of file route_point.h.
wxDateTime RoutePoint::m_seg_eta |
Estimated Time of Arrival at this waypoint, in UTC.
For waypoints in a route, this represents when the vessel is expected to arrive at this waypoint based on the ETD and planned speed from the previous waypoint.
For the first waypoint in a route:
The relationship between waypoints creates a timing chain: The ETA at one waypoint determines the default ETD from that waypoint, which then affects the ETA at the next waypoint, and so on through the route.
Definition at line 327 of file route_point.h.
wxDateTime RoutePoint::m_seg_etd |
Estimated Time of Departure from this waypoint, in UTC.
For normal waypoints in a route, this represents when the vessel is expected to depart from this waypoint toward the next waypoint. By default, it is set to the same value as the ETA (m_seg_eta) to this waypoint, creating a continuous timing chain through the route.
For the first waypoint in a route:
This value can be manually set by the user (indicated by m_manual_etd flag), in which case it takes precedence over the automatically calculated value.
Definition at line 305 of file route_point.h.
wxLongLong RoutePoint::m_seg_ete = 0 |
Estimated Time Enroute for the leg leading to this waypoint.
This value represents the expected travel time (in seconds) from the previous waypoint to this one. It is calculated based on:
For the first waypoint in a route during active navigation, this represents the estimated time from the vessel's current position to the first waypoint.
The formula used is: ETE = (distance in nautical miles / speed in knots) * 3600
Definition at line 343 of file route_point.h.
double RoutePoint::m_seg_len |
Definition at line 268 of file route_point.h.
double RoutePoint::m_seg_vmg |
Planned speed for traveling FROM this waypoint TO the next waypoint.
This value represents the Velocity Made Good (VMG) expected when traveling from this waypoint to the next waypoint in a route. It is used to calculate the ETE (Estimated Time Enroute) for this leg, and consequently the ETA (Estimated Time of Arrival) at the next waypoint.
If this value is not explicitly set (or is less than 0.1), the route's default planned speed will be used instead. The unit is knots (nautical miles per hour).
For the last waypoint in a route, this value has no navigational significance.
Definition at line 286 of file route_point.h.
wxString RoutePoint::m_TideStation |
Definition at line 368 of file route_point.h.
wxString RoutePoint::m_timestring |
Definition at line 409 of file route_point.h.
double RoutePoint::m_WaypointArrivalRadius |
Definition at line 406 of file route_point.h.
LLBBox RoutePoint::m_wpBBox |
Definition at line 400 of file route_point.h.
double RoutePoint::m_wpBBox_rotation |
Definition at line 401 of file route_point.h.
double RoutePoint::m_wpBBox_view_scale_ppm |
Definition at line 401 of file route_point.h.
wxColour RoutePoint::m_wxcWaypointRangeRingsColour |
Definition at line 395 of file route_point.h.