FlightGear next
FGPositioned Class Reference

#include <positioned.hxx>

Inherits SGReferenced.

Inherited by FGAirport, FGFix, FGMarkerBeaconRecord, FGNavRecord, FGPavement, FGRunwayBase, FGTaxiNode, POI, flightgear::AirportTower, and flightgear::CommStation.

Classes

class  Filter
 Predicate class to support custom filtering of FGPositioned queries Default implementation of this passes any FGPositioned instance. More...
 
class  TypeFilter
 

Public Types

enum  Type {
  INVALID = 0 , AIRPORT , HELIPORT , SEAPORT ,
  RUNWAY , HELIPAD , TAXIWAY , PAVEMENT ,
  WAYPOINT , FIX , NDB , VOR ,
  ILS , LOC , GS , OM ,
  MM , IM , DME , TACAN ,
  MOBILE_TACAN , OBSTACLE , TOWER , FREQ_GROUND ,
  FREQ_TOWER , FREQ_ATIS , FREQ_AWOS , FREQ_APP_DEP ,
  FREQ_ENROUTE , FREQ_CLEARANCE , FREQ_UNICOM , PARKING ,
  TAXI_NODE , COUNTRY , CITY , TOWN ,
  VILLAGE , VISUAL_REPORTING_POINT , LAST_POI_TYPE , LAST_TYPE
}
 

Public Member Functions

virtual ~FGPositioned ()
 
Type type () const
 
const char * typeString () const
 
const std::string & ident () const
 
virtual const std::string & name () const
 Return the name of this positioned.
 
virtual const SGGeod & geod () const
 
PositionedID guid () const
 
virtual const SGVec3d & cart () const
 The cartesian position associated with this object.
 
double latitude () const
 
double longitude () const
 
double elevation () const
 
double elevationM () const
 

Static Public Member Functions

static bool isAirportType (FGPositioned *pos)
 
static bool isRunwayType (FGPositioned *pos)
 
static bool isNavaidType (FGPositioned *pos)
 
static FGPositionedList findWithinRange (const SGGeod &aPos, double aRangeNm, Filter *aFilter)
 
static FGPositionedList findWithinRangePartial (const SGGeod &aPos, double aRangeNm, Filter *aFilter, bool &aPartial)
 
static FGPositionedRef findClosestWithIdent (const std::string &aIdent, const SGGeod &aPos, Filter *aFilter=NULL)
 
static FGPositionedRef findFirstWithIdent (const std::string &aIdent, Filter *aFilter)
 
static FGPositionedList findAllWithIdent (const std::string &aIdent, Filter *aFilter=NULL, bool aExact=true)
 Find all items with the specified ident.
 
static FGPositionedList findAllWithName (const std::string &aName, Filter *aFilter=NULL, bool aExact=true)
 As above, but searches names instead of idents.
 
static void sortByRange (FGPositionedList &, const SGGeod &aPos)
 Sort an FGPositionedList by distance from a position.
 
static FGPositionedRef findClosest (const SGGeod &aPos, double aCutoffNm, Filter *aFilter=NULL)
 Find the closest item to a position, which pass the specified filter A cutoff range in NM must be specified, to constrain the search acceptably.
 
static FGPositionedList findClosestN (const SGGeod &aPos, unsigned int aN, double aCutoffNm, Filter *aFilter=NULL)
 Find the closest N items to a position, which pass the specified filter A cutoff range in NM must be specified, to constrain the search acceptably.
 
static FGPositionedList findClosestNPartial (const SGGeod &aPos, unsigned int aN, double aCutoffNm, Filter *aFilter, bool &aPartial)
 Same as above, but with a time-bound in msec too.
 
template<class T>
static SGSharedPtr< T > loadById (PositionedID id)
 
template<class T>
static SGSharedPtr< T > loadById (const PositionedIDVec &id_vec, size_t index)
 
template<class T>
static std::vector< SGSharedPtr< T > > loadAllById (const PositionedIDVec &id_vec)
 
static Type typeFromName (const std::string &aName)
 Map a candidate type string to a real type.
 
static const char * nameForType (Type aTy)
 Map a type to a human-readable string.
 
static FGPositionedRef createWaypoint (FGPositioned::Type aType, const std::string &aIdent, const SGGeod &aPos, bool isTemporary=false, const std::string &aName={})
 
static bool deleteWaypoint (FGPositionedRef aWpt)
 

Protected Member Functions

 FGPositioned (PositionedID aGuid, Type ty, const std::string &aIdent, const SGGeod &aPos)
 
void modifyPosition (const SGGeod &newPos)
 
void invalidatePosition ()
 

Static Protected Member Functions

static FGPositionedRef loadByIdImpl (PositionedID id)
 

Protected Attributes

const PositionedID mGuid
 
const Type mType
 
const std::string mIdent
 

Friends

class flightgear::NavDataCache
 

Detailed Description

Definition at line 27 of file positioned.hxx.

Member Enumeration Documentation

◆ Type

Enumerator
INVALID 
AIRPORT 
HELIPORT 
SEAPORT 
RUNWAY 
HELIPAD 
TAXIWAY 
PAVEMENT 
WAYPOINT 
FIX 
NDB 
VOR 
ILS 
LOC 
GS 
OM 
MM 
IM 
DME 

important that DME & TACAN are adjacent to keep the TacanFilter efficient - DMEs are proxies for TACAN/VORTAC stations

TACAN 
MOBILE_TACAN 
OBSTACLE 
TOWER 

an actual airport tower - not a radio comms facility!

some airports have multiple towers, eg EHAM, although our data source doesn't necessarily include them

FREQ_GROUND 
FREQ_TOWER 
FREQ_ATIS 
FREQ_AWOS 
FREQ_APP_DEP 
FREQ_ENROUTE 
FREQ_CLEARANCE 
FREQ_UNICOM 
PARKING 

parking position - might be a gate, or stand

TAXI_NODE 
COUNTRY 
CITY 
TOWN 
VILLAGE 
VISUAL_REPORTING_POINT 
LAST_POI_TYPE 
LAST_TYPE 

Definition at line 30 of file positioned.hxx.

Constructor & Destructor Documentation

◆ ~FGPositioned()

FGPositioned::~FGPositioned ( )
virtual

Definition at line 64 of file positioned.cxx.

◆ FGPositioned()

FGPositioned::FGPositioned ( PositionedID aGuid,
Type ty,
const std::string & aIdent,
const SGGeod & aPos )
protected

Definition at line 51 of file positioned.cxx.

Member Function Documentation

◆ cart()

const SGVec3d & FGPositioned::cart ( ) const
virtual

The cartesian position associated with this object.

Reimplemented in FGMobileNavRecord.

Definition at line 158 of file positioned.cxx.

◆ createWaypoint()

FGPositionedRef FGPositioned::createWaypoint ( FGPositioned::Type aType,
const std::string & aIdent,
const SGGeod & aPos,
bool isTemporary = false,
const std::string & aName = {} )
static

Definition at line 119 of file positioned.cxx.

◆ deleteWaypoint()

bool FGPositioned::deleteWaypoint ( FGPositionedRef aWpt)
static

Definition at line 144 of file positioned.cxx.

◆ elevation()

double FGPositioned::elevation ( ) const
inline

Definition at line 130 of file positioned.hxx.

◆ elevationM()

double FGPositioned::elevationM ( ) const
inline

Definition at line 133 of file positioned.hxx.

◆ findAllWithIdent()

FGPositionedList FGPositioned::findAllWithIdent ( const std::string & aIdent,
Filter * aFilter = NULL,
bool aExact = true )
static

Find all items with the specified ident.

Parameters
aFilter- optional filter on items

Definition at line 344 of file positioned.cxx.

◆ findAllWithName()

FGPositionedList FGPositioned::findAllWithName ( const std::string & aName,
Filter * aFilter = NULL,
bool aExact = true )
static

As above, but searches names instead of idents.

Definition at line 354 of file positioned.cxx.

◆ findClosest()

FGPositionedRef FGPositioned::findClosest ( const SGGeod & aPos,
double aCutoffNm,
Filter * aFilter = NULL )
static

Find the closest item to a position, which pass the specified filter A cutoff range in NM must be specified, to constrain the search acceptably.

Very large cutoff values will make this slow.

Returns
The closest item passing the filter, or NULL
Parameters
aCutoffNm- maximum distance to search within, in nautical miles

Definition at line 364 of file positioned.cxx.

◆ findClosestN()

FGPositionedList FGPositioned::findClosestN ( const SGGeod & aPos,
unsigned int aN,
double aCutoffNm,
Filter * aFilter = NULL )
static

Find the closest N items to a position, which pass the specified filter A cutoff range in NM must be specified, to constrain the search acceptably.

Very large cutoff values will make this slow.

Returns
The matches (possibly less than N, depending on the filter and cutoff), sorted by distance from the search pos
Parameters
aN- number of matches to find
aCutoffNm- maximum distance to search within, in nautical miles

Definition at line 382 of file positioned.cxx.

◆ findClosestNPartial()

FGPositionedList FGPositioned::findClosestNPartial ( const SGGeod & aPos,
unsigned int aN,
double aCutoffNm,
Filter * aFilter,
bool & aPartial )
static

Same as above, but with a time-bound in msec too.

Definition at line 393 of file positioned.cxx.

◆ findClosestWithIdent()

FGPositionedRef FGPositioned::findClosestWithIdent ( const std::string & aIdent,
const SGGeod & aPos,
Filter * aFilter = NULL )
static

Definition at line 289 of file positioned.cxx.

◆ findFirstWithIdent()

FGPositionedRef FGPositioned::findFirstWithIdent ( const std::string & aIdent,
Filter * aFilter )
static

Definition at line 296 of file positioned.cxx.

◆ findWithinRange()

FGPositionedList FGPositioned::findWithinRange ( const SGGeod & aPos,
double aRangeNm,
Filter * aFilter )
static

Definition at line 312 of file positioned.cxx.

◆ findWithinRangePartial()

FGPositionedList FGPositioned::findWithinRangePartial ( const SGGeod & aPos,
double aRangeNm,
Filter * aFilter,
bool & aPartial )
static

Definition at line 327 of file positioned.cxx.

◆ geod()

virtual const SGGeod & FGPositioned::geod ( ) const
inlinevirtual

Reimplemented in FGMobileNavRecord.

Definition at line 113 of file positioned.hxx.

◆ guid()

PositionedID FGPositioned::guid ( ) const
inline

Definition at line 116 of file positioned.hxx.

◆ ident()

const std::string & FGPositioned::ident ( ) const
inline

Definition at line 102 of file positioned.hxx.

◆ invalidatePosition()

void FGPositioned::invalidatePosition ( )
protected

Definition at line 436 of file positioned.cxx.

◆ isAirportType()

bool FGPositioned::isAirportType ( FGPositioned * pos)
static

Definition at line 69 of file positioned.cxx.

◆ isNavaidType()

bool FGPositioned::isNavaidType ( FGPositioned * pos)
static

Definition at line 85 of file positioned.cxx.

◆ isRunwayType()

bool FGPositioned::isRunwayType ( FGPositioned * pos)
static

Definition at line 79 of file positioned.cxx.

◆ latitude()

double FGPositioned::latitude ( ) const
inline

Definition at line 124 of file positioned.hxx.

◆ loadAllById()

template<class T>
static std::vector< SGSharedPtr< T > > FGPositioned::loadAllById ( const PositionedIDVec & id_vec)
inlinestatic

Definition at line 261 of file positioned.hxx.

◆ loadById() [1/2]

template<class T>
static SGSharedPtr< T > FGPositioned::loadById ( const PositionedIDVec & id_vec,
size_t index )
inlinestatic

Definition at line 254 of file positioned.hxx.

◆ loadById() [2/2]

template<class T>
static SGSharedPtr< T > FGPositioned::loadById ( PositionedID id)
inlinestatic

Definition at line 248 of file positioned.hxx.

◆ loadByIdImpl()

FGPositionedRef FGPositioned::loadByIdImpl ( PositionedID id)
staticprotected

Definition at line 443 of file positioned.cxx.

◆ longitude()

double FGPositioned::longitude ( ) const
inline

Definition at line 127 of file positioned.hxx.

◆ modifyPosition()

void FGPositioned::modifyPosition ( const SGGeod & newPos)
protected

Definition at line 429 of file positioned.cxx.

◆ name()

virtual const std::string & FGPositioned::name ( ) const
inlinevirtual

Return the name of this positioned.

By default this is the same as the ident, but for many derived classes it's more meaningful - the aiport or navaid name, for example.

Reimplemented in FGAirport, FGNavRecord, and POI.

Definition at line 110 of file positioned.hxx.

◆ nameForType()

const char * FGPositioned::nameForType ( Type aTy)
static

Map a type to a human-readable string.

Definition at line 242 of file positioned.cxx.

◆ sortByRange()

void FGPositioned::sortByRange ( FGPositionedList & aResult,
const SGGeod & aPos )
static

Sort an FGPositionedList by distance from a position.

Definition at line 405 of file positioned.cxx.

◆ type()

Type FGPositioned::type ( ) const
inline

Definition at line 84 of file positioned.hxx.

◆ typeFromName()

FGPositioned::Type FGPositioned::typeFromName ( const std::string & aName)
static

Map a candidate type string to a real type.

Returns INVALID if the string does not correspond to a defined type.

Definition at line 163 of file positioned.cxx.

◆ typeString()

const char * FGPositioned::typeString ( ) const
inline

Definition at line 99 of file positioned.hxx.

Friends And Related Symbol Documentation

◆ flightgear::NavDataCache

friend class flightgear::NavDataCache
friend

Definition at line 287 of file positioned.hxx.

Member Data Documentation

◆ mGuid

const PositionedID FGPositioned::mGuid
protected

Definition at line 297 of file positioned.hxx.

◆ mIdent

const std::string FGPositioned::mIdent
protected

Definition at line 299 of file positioned.hxx.

◆ mType

const Type FGPositioned::mType
protected

Definition at line 298 of file positioned.hxx.


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