FlightGear next
flightgear::Waypt Class Referenceabstract

Abstract base class for waypoints (and things that are treated similarly by navigation systems). More...

#include <route.hxx>

Inherits SGReferenced.

Inherited by flightgear::ATCVectors, flightgear::BasicWaypt, flightgear::DMEIntercept, flightgear::Discontinuity, flightgear::HeadingToAltitude, flightgear::NavaidWaypoint, flightgear::RadialIntercept, flightgear::RunwayWaypt, and flightgear::Via.

Public Member Functions

virtual ~Waypt ()
 
RouteBaseowner () const
 
virtual SGGeod position () const =0
 
virtual FGPositionedsource () const
 The Positioned associated with this element, if one exists.
 
double altitudeFt () const
 
double speed (RouteUnits aUnits=DEFAULT_UNITS) const
 
double altitude (RouteUnits aUnits=DEFAULT_UNITS) const
 
double constraintAltitude (RouteUnits aUnits=DEFAULT_UNITS) const
 
double speedKts () const
 
double speedMach () const
 
virtual RouteRestriction altitudeRestriction () const
 
virtual RouteRestriction speedRestriction () const
 
void setAltitude (double aAlt, RouteRestriction aRestrict, RouteUnits aUnits=DEFAULT_UNITS)
 
void setSpeed (double aSpeed, RouteRestriction aRestrict, RouteUnits aUnits=DEFAULT_UNITS)
 
void setConstraintAltitude (double aAlt)
 
virtual std::string ident () const
 Identifier assoicated with the waypoint.
 
virtual bool flag (WayptFlag aFlag) const
 Test if the specified flag is set for this element.
 
virtual unsigned int flags () const
 
void setFlag (WayptFlag aFlag, bool aV=true)
 
void saveAsNode (SGPropertyNode *node) const
 
bool matches (Waypt *aOther) const
 Test if this element and another are 'the same', i.e matching ident and lat/lon are approximately equal.
 
bool matches (FGPositioned *aPos) const
 Test if this element and positioned are the same, i.e matching ident and lat/lon are approximately equal.
 
bool matches (const SGGeod &aPos) const
 Test if this element and a position 'the same' this can be defined by either position, ident or both.
 
virtual std::string type () const =0
 
virtual double magvarDeg () const
 Magentic variation at/in the vicinity of the waypoint.
 
virtual double headingRadialDeg () const
 return the assoicated heading or radial for this waypoint.
 
virtual std::string icaoDescription () const
 icaoDescription - description of the waypoint in ICAO route plan format
 

Static Public Member Functions

static WayptRef createFromProperties (RouteBase *aOwner, SGPropertyNode_ptr aProp)
 Factory method.
 
static WayptRef createFromString (RouteBase *aOwner, const std::string &s, const SGGeod &vicinity)
 Create a waypoint from the route manager's standard string format:
 
static WayptRef fromLatLonString (RouteBase *aOwner, const std::string &target)
 

Protected Types

typedef WayptFactoryFunction(RouteBase *aOwner)
 

Protected Member Functions

 Waypt (RouteBase *aOwner)
 
virtual bool initFromProperties (SGPropertyNode_ptr aProp)
 Persistence helper - read node properties from a file.
 
virtual void writeToProperties (SGPropertyNode_ptr aProp) const
 Persistence helper - save this element to a node.
 

Static Protected Member Functions

static void registerFactory (const std::string aNodeType, FactoryFunction *aFactory)
 

Protected Attributes

double _altitude = 0.0
 
std::optional< double > _constraintAltitude
 some restriction types specify two altitudes, in which case this is the second value, corresponding to AltitudeCons in the level-D XML procedures format.
 
RouteUnits _altitudeUnits = ALTITUDE_FEET
 
double _speed = 0.0
 
RouteUnits _speedUnits = SPEED_KNOTS
 
RouteRestriction _altRestrict = RESTRICT_NONE
 
RouteRestriction _speedRestrict = RESTRICT_NONE
 

Friends

class NavdataVisitor
 

Detailed Description

Abstract base class for waypoints (and things that are treated similarly by navigation systems).

More precisely this is route path elements, including their terminator.

Definition at line 104 of file route.hxx.

Member Typedef Documentation

◆ FactoryFunction

typedef Waypt * flightgear::Waypt::FactoryFunction(RouteBase *aOwner)
protected

Definition at line 234 of file route.hxx.

Constructor & Destructor Documentation

◆ ~Waypt()

flightgear::Waypt::~Waypt ( )
virtual

Definition at line 195 of file route.cxx.

◆ Waypt()

flightgear::Waypt::Waypt ( RouteBase * aOwner)
protected

Definition at line 189 of file route.cxx.

Member Function Documentation

◆ altitude()

double flightgear::Waypt::altitude ( RouteUnits aUnits = DEFAULT_UNITS) const

Definition at line 303 of file route.cxx.

◆ altitudeFt()

double flightgear::Waypt::altitudeFt ( ) const

Definition at line 289 of file route.cxx.

◆ altitudeRestriction()

virtual RouteRestriction flightgear::Waypt::altitudeRestriction ( ) const
inlinevirtual

Definition at line 134 of file route.hxx.

◆ constraintAltitude()

double flightgear::Waypt::constraintAltitude ( RouteUnits aUnits = DEFAULT_UNITS) const

Definition at line 312 of file route.cxx.

◆ createFromProperties()

WayptRef flightgear::Waypt::createFromProperties ( RouteBase * aOwner,
SGPropertyNode_ptr aProp )
static

Factory method.

Definition at line 417 of file route.cxx.

◆ createFromString()

WayptRef flightgear::Waypt::createFromString ( RouteBase * aOwner,
const std::string & s,
const SGGeod & vicinity )
static

Create a waypoint from the route manager's standard string format:

  • simple identifier
  • decimal-lon,decimal-lat
  • airport-id/runway-id
  • navaid/radial-deg/offset-nm

Definition at line 491 of file route.cxx.

◆ flag()

bool flightgear::Waypt::flag ( WayptFlag aFlag) const
virtual

Test if the specified flag is set for this element.

Definition at line 204 of file route.cxx.

◆ flags()

virtual unsigned int flightgear::Waypt::flags ( ) const
inlinevirtual

Definition at line 156 of file route.hxx.

◆ fromLatLonString()

WayptRef flightgear::Waypt::fromLatLonString ( RouteBase * aOwner,
const std::string & target )
static

Definition at line 458 of file route.cxx.

◆ headingRadialDeg()

double flightgear::Waypt::headingRadialDeg ( ) const
virtual

return the assoicated heading or radial for this waypoint.

The exact meaning varies by type - for a hold it's the inbound radial, for a DME intercept it's the heading to hold, and so on.

Reimplemented in flightgear::DMEIntercept, flightgear::HeadingToAltitude, flightgear::Hold, flightgear::RadialIntercept, and flightgear::RunwayWaypt.

Definition at line 337 of file route.cxx.

◆ icaoDescription()

std::string flightgear::Waypt::icaoDescription ( ) const
virtual

icaoDescription - description of the waypoint in ICAO route plan format

Returns

Reimplemented in flightgear::BasicWaypt.

Definition at line 342 of file route.cxx.

◆ ident()

std::string flightgear::Waypt::ident ( ) const
virtual

Identifier assoicated with the waypoint.

Human-readable, but possibly quite terse, and definitiely not unique.

Reimplemented in flightgear::ATCVectors, flightgear::BasicWaypt, flightgear::Discontinuity, flightgear::DMEIntercept, flightgear::HeadingToAltitude, flightgear::NavaidWaypoint, flightgear::RadialIntercept, flightgear::RunwayWaypt, and flightgear::Via.

Definition at line 199 of file route.cxx.

◆ initFromProperties()

bool flightgear::Waypt::initFromProperties ( SGPropertyNode_ptr aProp)
protectedvirtual

◆ magvarDeg()

double flightgear::Waypt::magvarDeg ( ) const
virtual

Magentic variation at/in the vicinity of the waypoint.

For some waypoint types this will always return 0.

Reimplemented in flightgear::Discontinuity, and flightgear::HeadingToAltitude.

Definition at line 324 of file route.cxx.

◆ matches() [1/3]

bool flightgear::Waypt::matches ( const SGGeod & aPos) const

Test if this element and a position 'the same' this can be defined by either position, ident or both.

Definition at line 242 of file route.cxx.

◆ matches() [2/3]

bool flightgear::Waypt::matches ( FGPositioned * aPos) const

Test if this element and positioned are the same, i.e matching ident and lat/lon are approximately equal.

Definition at line 229 of file route.cxx.

◆ matches() [3/3]

bool flightgear::Waypt::matches ( Waypt * aOther) const

Test if this element and another are 'the same', i.e matching ident and lat/lon are approximately equal.

Definition at line 219 of file route.cxx.

◆ owner()

RouteBase * flightgear::Waypt::owner ( ) const
inline

Definition at line 109 of file route.hxx.

◆ position()

◆ registerFactory()

static void flightgear::Waypt::registerFactory ( const std::string aNodeType,
FactoryFunction * aFactory )
staticprotected

◆ saveAsNode()

void flightgear::Waypt::saveAsNode ( SGPropertyNode * node) const

Definition at line 578 of file route.cxx.

◆ setAltitude()

void flightgear::Waypt::setAltitude ( double aAlt,
RouteRestriction aRestrict,
RouteUnits aUnits = DEFAULT_UNITS )

Definition at line 248 of file route.cxx.

◆ setConstraintAltitude()

void flightgear::Waypt::setConstraintAltitude ( double aAlt)

Definition at line 259 of file route.cxx.

◆ setFlag()

void flightgear::Waypt::setFlag ( WayptFlag aFlag,
bool aV = true )

Definition at line 209 of file route.cxx.

◆ setSpeed()

void flightgear::Waypt::setSpeed ( double aSpeed,
RouteRestriction aRestrict,
RouteUnits aUnits = DEFAULT_UNITS )

Definition at line 264 of file route.cxx.

◆ source()

virtual FGPositioned * flightgear::Waypt::source ( ) const
inlinevirtual

The Positioned associated with this element, if one exists.

Reimplemented in flightgear::NavaidWaypoint, flightgear::RunwayWaypt, and flightgear::Via.

Definition at line 117 of file route.hxx.

◆ speed()

double flightgear::Waypt::speed ( RouteUnits aUnits = DEFAULT_UNITS) const

Definition at line 294 of file route.cxx.

◆ speedKts()

double flightgear::Waypt::speedKts ( ) const

Definition at line 279 of file route.cxx.

◆ speedMach()

double flightgear::Waypt::speedMach ( ) const

Definition at line 284 of file route.cxx.

◆ speedRestriction()

virtual RouteRestriction flightgear::Waypt::speedRestriction ( ) const
inlinevirtual

Definition at line 137 of file route.hxx.

◆ type()

◆ writeToProperties()

void flightgear::Waypt::writeToProperties ( SGPropertyNode_ptr aProp) const
protectedvirtual

Friends And Related Symbol Documentation

◆ NavdataVisitor

friend class NavdataVisitor
friend

Definition at line 220 of file route.hxx.

Member Data Documentation

◆ _altitude

double flightgear::Waypt::_altitude = 0.0
protected

Definition at line 237 of file route.hxx.

◆ _altitudeUnits

RouteUnits flightgear::Waypt::_altitudeUnits = ALTITUDE_FEET
protected

Definition at line 242 of file route.hxx.

◆ _altRestrict

RouteRestriction flightgear::Waypt::_altRestrict = RESTRICT_NONE
protected

Definition at line 247 of file route.hxx.

◆ _constraintAltitude

std::optional<double> flightgear::Waypt::_constraintAltitude
protected

some restriction types specify two altitudes, in which case this is the second value, corresponding to AltitudeCons in the level-D XML procedures format.

Definition at line 240 of file route.hxx.

◆ _speed

double flightgear::Waypt::_speed = 0.0
protected

Definition at line 244 of file route.hxx.

◆ _speedRestrict

RouteRestriction flightgear::Waypt::_speedRestrict = RESTRICT_NONE
protected

Definition at line 248 of file route.hxx.

◆ _speedUnits

RouteUnits flightgear::Waypt::_speedUnits = SPEED_KNOTS
protected

Definition at line 245 of file route.hxx.


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