OpenCPN Partial API docs
Loading...
Searching...
No Matches
Route Class Reference

Represents a navigational route in the navigation system. More...

#include <route.h>

Inheritance diagram for Route:

Public Member Functions

virtual int GetnPoints (void)
 
wxString IsPointNameValid (RoutePoint *pRP, const wxString &name) const
 
void AddPoint (RoutePoint *pNewPoint, bool b_rename_in_sequence=true, bool b_deferBoxCalc=false)
 
void InsertPointAndSegment (RoutePoint *pNewPoint, int insert_after, bool b_rename_in_sequence=true, bool b_deferBoxCalc=false)
 
void AddPointAndSegment (RoutePoint *pNewPoint, bool b_rename_in_sequence=true, bool b_deferBoxCalc=false)
 
RoutePointGetPoint (int nPoint)
 
RoutePointGetPoint (const wxString &guid)
 
int GetIndexOf (RoutePoint *prp)
 
RoutePointInsertPointBefore (RoutePoint *pRP, double rlat, double rlon, bool bRenamePoints=false)
 
RoutePointInsertPointAfter (RoutePoint *pRP, double rlat, double rlon, bool bRenamePoints=false)
 
RoutePointGetLastPoint ()
 
void DeletePoint (RoutePoint *rp, bool bRenamePoints=false)
 
void RemovePoint (RoutePoint *rp, bool bRenamePoints=false)
 
void DeSelectRoute ()
 
void FinalizeForRendering ()
 
void UpdateSegmentDistance (RoutePoint *prp0, RoutePoint *prp, double planspeed=-1.0)
 Updates the navigation data for a single route segment between two waypoints.
 
void UpdateSegmentDistances (double planspeed=-1.0)
 
LLBBox & GetBBox ()
 
void SetHiLite (int width)
 
void Reverse (bool bRenamePoints=false)
 
void RebuildGUIDList (void)
 
void RenameRoutePoints ()
 
void ReloadRoutePointIcons ()
 
wxString GetNewMarkSequenced (void)
 
void AssembleRoute ()
 
bool IsEqualTo (Route *ptargetroute)
 
void CloneRoute (Route *psourceroute, int start_nPoint, int end_nPoint, const wxString &suffix, const bool duplicate_first_point=false)
 
void ClearHighlights (void)
 
void SetVisible (bool visible=true, bool includeWpts=true)
 
void SetListed (bool visible=true)
 
bool IsVisible ()
 
bool IsListed ()
 
bool IsActive ()
 
bool IsSelected ()
 
bool ContainsSharedWP ()
 
void SetSharedWPViz (bool sharedWPVIZ)
 
bool GetSharedWPViz ()
 
double GetRouteArrivalRadius (void)
 
void SetRouteArrivalRadius (double radius)
 
void SetDepartureDate (const wxDateTime &dt)
 Set the departure time of the route.
 
wxString GetName () const
 
wxString GetTo () const
 
wxString GetGUID () const
 
void ShowWaypointNames (bool bshow)
 
bool AreWaypointNamesVisible ()
 

Public Attributes

int m_ConfigRouteNum
 
bool m_bRtIsSelected
 
bool m_bRtIsActive
 
RoutePointm_pRouteActivePoint
 
bool m_bIsBeingCreated
 
bool m_bIsBeingEdited
 
double m_route_length
 
double m_route_time
 
wxString m_RouteNameString
 
wxString m_RouteStartString
 
wxString m_RouteEndString
 
wxString m_RouteDescription
 
bool m_bDeleteOnArrival
 
wxString m_GUID
 
bool m_bIsInLayer
 
int m_LayerID
 
int m_width
 
wxPenStyle m_style
 
int m_lastMousePointIndex
 
bool m_NextLegGreatCircle
 
double m_PlannedSpeed
 
wxDateTime m_PlannedDeparture
 The departure time of the route, in UTC.
 
wxString m_TimeDisplayFormat
 
RoutePointList * pRoutePointList
 
wxRect active_pt_rect
 
wxString m_Colour
 
bool m_btemp
 
int m_hiliteWidth
 
HyperlinkList * m_HyperlinkList
 

Friends

class RouteGui
 

Detailed Description

Represents a navigational route in the navigation system.

The Route class manages an ordered list of RoutePoints that define a navigational path between waypoints. It provides functionality for route creation, manipulation, and navigation calculations such as distances, bearings, and estimated times.

A Route can be:

  • Active or inactive for navigation
  • Visible or hidden on the chart
  • Temporary or persistent
  • Part of a layer or standalone

The class supports various route operations like adding, inserting, or removing waypoints, calculating segment distances, and handling waypoint sharing between multiple routes. It also maintains navigation-related attributes like planned speeds, departure times, and style attributes for rendering.

Definition at line 96 of file route.h.

Constructor & Destructor Documentation

◆ Route()

Route::Route ( )

Definition at line 59 of file route.cpp.

◆ ~Route()

Route::~Route ( )

Definition at line 100 of file route.cpp.

Member Function Documentation

◆ AddPoint()

void Route::AddPoint ( RoutePoint * pNewPoint,
bool b_rename_in_sequence = true,
bool b_deferBoxCalc = false )

Definition at line 157 of file route.cpp.

◆ AddPointAndSegment()

void Route::AddPointAndSegment ( RoutePoint * pNewPoint,
bool b_rename_in_sequence = true,
bool b_deferBoxCalc = false )

Definition at line 181 of file route.cpp.

◆ AreWaypointNamesVisible()

bool Route::AreWaypointNamesVisible ( )

Definition at line 663 of file route.cpp.

◆ AssembleRoute()

void Route::AssembleRoute ( void )

Definition at line 650 of file route.cpp.

◆ ClearHighlights()

void Route::ClearHighlights ( void )

Definition at line 293 of file route.cpp.

◆ CloneRoute()

void Route::CloneRoute ( Route * psourceroute,
int start_nPoint,
int end_nPoint,
const wxString & suffix,
const bool duplicate_first_point = false )

Definition at line 109 of file route.cpp.

◆ ContainsSharedWP()

bool Route::ContainsSharedWP ( )

Definition at line 282 of file route.cpp.

◆ DeletePoint()

void Route::DeletePoint ( RoutePoint * rp,
bool bRenamePoints = false )

Definition at line 365 of file route.cpp.

◆ DeSelectRoute()

void Route::DeSelectRoute ( )

Definition at line 422 of file route.cpp.

◆ FinalizeForRendering()

void Route::FinalizeForRendering ( )

Definition at line 446 of file route.cpp.

◆ GetBBox()

LLBBox & Route::GetBBox ( void )

Definition at line 448 of file route.cpp.

◆ GetGUID()

wxString Route::GetGUID ( ) const
inline

Definition at line 187 of file route.h.

◆ GetIndexOf()

int Route::GetIndexOf ( RoutePoint * prp)

Definition at line 357 of file route.cpp.

◆ GetLastPoint()

RoutePoint * Route::GetLastPoint ( )

Definition at line 351 of file route.cpp.

◆ GetName()

wxString Route::GetName ( ) const
inline

Definition at line 185 of file route.h.

◆ GetNewMarkSequenced()

wxString Route::GetNewMarkSequenced ( void )

Definition at line 343 of file route.cpp.

◆ GetnPoints()

virtual int Route::GetnPoints ( void )
inlinevirtual

Definition at line 103 of file route.h.

◆ GetPoint() [1/2]

RoutePoint * Route::GetPoint ( const wxString & guid)

Definition at line 249 of file route.cpp.

◆ GetPoint() [2/2]

RoutePoint * Route::GetPoint ( int nPoint)

Definition at line 232 of file route.cpp.

◆ GetRouteArrivalRadius()

double Route::GetRouteArrivalRadius ( void )
inline

Definition at line 174 of file route.h.

◆ GetSharedWPViz()

bool Route::GetSharedWPViz ( )
inline

Definition at line 172 of file route.h.

◆ GetTo()

wxString Route::GetTo ( ) const
inline

Definition at line 186 of file route.h.

◆ InsertPointAfter()

RoutePoint * Route::InsertPointAfter ( RoutePoint * pRP,
double rlat,
double rlon,
bool bRenamePoints = false )

Definition at line 322 of file route.cpp.

◆ InsertPointAndSegment()

void Route::InsertPointAndSegment ( RoutePoint * pNewPoint,
int insert_after,
bool b_rename_in_sequence = true,
bool b_deferBoxCalc = false )

Definition at line 204 of file route.cpp.

◆ InsertPointBefore()

RoutePoint * Route::InsertPointBefore ( RoutePoint * pRP,
double rlat,
double rlon,
bool bRenamePoints = false )

Definition at line 304 of file route.cpp.

◆ IsActive()

bool Route::IsActive ( )
inline

Definition at line 167 of file route.h.

◆ IsEqualTo()

bool Route::IsEqualTo ( Route * ptargetroute)

Definition at line 709 of file route.cpp.

◆ IsListed()

bool Route::IsListed ( )
inline

Definition at line 166 of file route.h.

◆ IsPointNameValid()

wxString Route::IsPointNameValid ( RoutePoint * pRP,
const wxString & name ) const

Definition at line 135 of file route.cpp.

◆ IsSelected()

bool Route::IsSelected ( )
inline

Definition at line 168 of file route.h.

◆ IsVisible()

bool Route::IsVisible ( )
inline

Definition at line 165 of file route.h.

◆ ReloadRoutePointIcons()

void Route::ReloadRoutePointIcons ( )

Definition at line 434 of file route.cpp.

◆ RemovePoint()

void Route::RemovePoint ( RoutePoint * rp,
bool bRenamePoints = false )

Definition at line 391 of file route.cpp.

◆ RenameRoutePoints()

void Route::RenameRoutePoints ( void )

Definition at line 677 of file route.cpp.

◆ Reverse()

void Route::Reverse ( bool bRenamePoints = false)

Definition at line 591 of file route.cpp.

◆ SetDepartureDate()

void Route::SetDepartureDate ( const wxDateTime & dt)
inline

Set the departure time of the route.

Parameters
dtThe departure date and time to set, in UTC.

Definition at line 181 of file route.h.

◆ SetHiLite()

void Route::SetHiLite ( int width)
inline

Definition at line 150 of file route.h.

◆ SetListed()

void Route::SetListed ( bool visible = true)

Definition at line 648 of file route.cpp.

◆ SetRouteArrivalRadius()

void Route::SetRouteArrivalRadius ( double radius)
inline

Definition at line 175 of file route.h.

◆ SetSharedWPViz()

void Route::SetSharedWPViz ( bool sharedWPVIZ)
inline

Definition at line 171 of file route.h.

◆ SetVisible()

void Route::SetVisible ( bool visible = true,
bool includeWpts = true )

Definition at line 628 of file route.cpp.

◆ ShowWaypointNames()

void Route::ShowWaypointNames ( bool bshow)

Definition at line 652 of file route.cpp.

◆ UpdateSegmentDistance()

void Route::UpdateSegmentDistance ( RoutePoint * prp0,
RoutePoint * prp,
double planspeed = -1.0 )

Updates the navigation data for a single route segment between two waypoints.

This function calculates and updates the following data for a route segment:

  • Distance between the two waypoints (stored in the destination waypoint)
  • Course from the source to destination waypoint
  • Contribution to the total route length
  • Segment VMG (Velocity Made Good) based on planned speed
  • ETE (Estimated Time Enroute) for the segment
  • ETD (Estimated Time of Departure) from the source waypoint
  • ETA (Estimated Time of Arrival) at the destination waypoint
Parameters
prp0Pointer to the source waypoint (departure point)
prpPointer to the destination waypoint (arrival point)
planspeedDefault planned speed in knots, used if the destination waypoint doesn't specify its own speed

Definition at line 505 of file route.cpp.

◆ UpdateSegmentDistances()

void Route::UpdateSegmentDistances ( double planspeed = -1.0)

Definition at line 563 of file route.cpp.

Friends And Related Symbol Documentation

◆ RouteGui

friend class RouteGui
friend

Definition at line 97 of file route.h.

Member Data Documentation

◆ active_pt_rect

wxRect Route::active_pt_rect

Definition at line 218 of file route.h.

◆ m_bDeleteOnArrival

bool Route::m_bDeleteOnArrival

Definition at line 203 of file route.h.

◆ m_bIsBeingCreated

bool Route::m_bIsBeingCreated

Definition at line 195 of file route.h.

◆ m_bIsBeingEdited

bool Route::m_bIsBeingEdited

Definition at line 196 of file route.h.

◆ m_bIsInLayer

bool Route::m_bIsInLayer

Definition at line 205 of file route.h.

◆ m_bRtIsActive

bool Route::m_bRtIsActive

Definition at line 193 of file route.h.

◆ m_bRtIsSelected

bool Route::m_bRtIsSelected

Definition at line 192 of file route.h.

◆ m_btemp

bool Route::m_btemp

Definition at line 220 of file route.h.

◆ m_Colour

wxString Route::m_Colour

Definition at line 219 of file route.h.

◆ m_ConfigRouteNum

int Route::m_ConfigRouteNum

Definition at line 191 of file route.h.

◆ m_GUID

wxString Route::m_GUID

Definition at line 204 of file route.h.

◆ m_hiliteWidth

int Route::m_hiliteWidth

Definition at line 221 of file route.h.

◆ m_HyperlinkList

HyperlinkList* Route::m_HyperlinkList

Definition at line 222 of file route.h.

◆ m_lastMousePointIndex

int Route::m_lastMousePointIndex

Definition at line 209 of file route.h.

◆ m_LayerID

int Route::m_LayerID

Definition at line 206 of file route.h.

◆ m_NextLegGreatCircle

bool Route::m_NextLegGreatCircle

Definition at line 210 of file route.h.

◆ m_PlannedDeparture

wxDateTime Route::m_PlannedDeparture

The departure time of the route, in UTC.

Definition at line 213 of file route.h.

◆ m_PlannedSpeed

double Route::m_PlannedSpeed

Definition at line 211 of file route.h.

◆ m_pRouteActivePoint

RoutePoint* Route::m_pRouteActivePoint

Definition at line 194 of file route.h.

◆ m_route_length

double Route::m_route_length

Definition at line 197 of file route.h.

◆ m_route_time

double Route::m_route_time

Definition at line 198 of file route.h.

◆ m_RouteDescription

wxString Route::m_RouteDescription

Definition at line 202 of file route.h.

◆ m_RouteEndString

wxString Route::m_RouteEndString

Definition at line 201 of file route.h.

◆ m_RouteNameString

wxString Route::m_RouteNameString

Definition at line 199 of file route.h.

◆ m_RouteStartString

wxString Route::m_RouteStartString

Definition at line 200 of file route.h.

◆ m_style

wxPenStyle Route::m_style

Definition at line 208 of file route.h.

◆ m_TimeDisplayFormat

wxString Route::m_TimeDisplayFormat

Definition at line 214 of file route.h.

◆ m_width

int Route::m_width

Definition at line 207 of file route.h.

◆ pRoutePointList

RoutePointList* Route::pRoutePointList

Definition at line 216 of file route.h.


The documentation for this class was generated from the following files: