WSF
WsfGeoPoint Class Reference

#include <WsfGeoPoint.hpp>

Inheritance diagram for WsfGeoPoint:
Collaboration diagram for WsfGeoPoint:

Public Member Functions

 WsfGeoPoint ()
 WsfGeoPoint (const double aPointWCS[3])
 WsfGeoPoint (double aLat, double aLon, double aAlt)
 WsfGeoPoint (const WsfGeoPoint &aSrc)
 Copy constructor (for Clone()).
WsfGeoPointoperator= (const WsfGeoPoint &)
 Assignment operator.
 ~WsfGeoPoint () override=default
Public Member Functions inherited from WsfSimpleComponentT< WsfPlatformComponent >
 WsfSimpleComponentT ()=default
 Empty constructor for serialization.
 WsfSimpleComponentT (int aRole, WsfStringId aName)
 WsfSimpleComponentT (int aRole)
 WsfSimpleComponentT (WsfStringId aName)
 WsfSimpleComponentT (const WsfSimpleComponentT &aSrc)
WsfSimpleComponentToperator= (const WsfSimpleComponentT &aRhs)
 ~WsfSimpleComponentT () override=default
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
virtual void ComponentParentChanged (ParentType *aParentPtr)
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
virtual int GetComponentInitializationOrder () const
template<typename T>
bool QueryInterfaceT (T *&aRolePtr)
bool ComponentHasRole (int aRole)
 Returns true if the component has the specified role.
virtual bool PreInitialize (double aSimTime)
virtual bool Initialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual void PreInput ()
Public Member Functions inherited from WsfNamed
 WsfNamed ()
 WsfNamed (WsfStringId aName)
 WsfNamed (const WsfNamed &)=default
WsfNamedoperator= (const WsfNamed &)=default
virtual ~WsfNamed ()=default
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)

Static Public Member Functions

static void RegisterComponentFactory (WsfScenario &aScenario)

Component infrastructure methods

WsfComponentCloneComponent () const override
void * QueryInterface (int aRole) override
virtual WsfGeoPointClone () const
bool ProcessInput (UtInput &aInput) override
 Process input from a generic source.
void GetLocationWCS (double aLocationWCS[3]) const
double GetDistanceFrom (double aLocationWCS[3]) const
double GetDistanceFrom (const WsfGeoPoint &aRefPoint) const
void SetLocationWCS (const double aLocationWCS[3])
 Set the geo point location in world coordinates.
void GetLocationECI (const UtCalendar &aTime, double aLocationECI[3]) const
double GetLat () const
double GetLon () const
double GetAlt () const
void GetLocationLLA (double &aLat, double &aLon, double &aAlt) const
void SetLocationLLA (double aLat, double aLon, double aAlt)
void AddOffset (double aHeading, const double aOffset[3])
void AddOffsetNED (const double aOffsetNED[3])
void Extrapolate (double aHeading, double aDistance)
void SetAltitudeMSL (double aAltitude)
 Sets the altitude in meters above sea level.
double TrueBearingTo (const WsfGeoPoint &aRhs) const
 Returns the true bearing to another geopoint in radians.
double GroundRangeTo (const WsfGeoPoint &aRhs) const
 Returns the ground range to a location.
double GetApparentTime (const UtCalendar &aEpoch) const
 Return the apparent time in hours since midnight of this point at the given aEpoch.
double SlantRangeTo (const WsfGeoPoint &aRhs, const bool aUseSpherical=true) const
 Returns the slant range to a location.
template<typename AR>
void Serialize (AR &aAr)
 For XIO (de)serialization.

Additional Inherited Members

Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.
int mRoles [2]

Detailed Description

A representation of a geographical point. A geo point represents a point on the earth. The geo point interface accommodates both world coordinates (WCS) and (lat, lon, alt) systems.

Constructor & Destructor Documentation

◆ WsfGeoPoint() [1/4]

◆ WsfGeoPoint() [2/4]

WsfGeoPoint::WsfGeoPoint ( const double aPointWCS[3])
explicit

Constructor from an input point in world coordinates (WCS).

Parameters
aPointWCSThe world coordinates of the geo point.

References cWSF_COMPONENT_GEOPOINT, and SetLocationWCS().

◆ WsfGeoPoint() [3/4]

WsfGeoPoint::WsfGeoPoint ( double aLat,
double aLon,
double aAlt )

Constructor from an input in (lat, lon, alt).

Parameters
aLatThe latitude of the geo point.
aLonThe longitude of the geo point.
aAltThe altitude of the geo point.

References cWSF_COMPONENT_GEOPOINT, and SetLocationLLA().

◆ WsfGeoPoint() [4/4]

WsfGeoPoint::WsfGeoPoint ( const WsfGeoPoint & aSrc)

Copy constructor (for Clone()).

References WsfGeoPoint().

◆ ~WsfGeoPoint()

WsfGeoPoint::~WsfGeoPoint ( )
overridedefault

Member Function Documentation

◆ AddOffset()

void WsfGeoPoint::AddOffset ( double aHeading,
const double aOffset[3] )

Add an offset to the current location define by the geo point.

The addition takes place in a local frame whose origin is the current point. The X-Y plane is tangent to the Earth's surface at the location of the current point, with the X-axis aligned pointed in the direction specified by the first argument. The Z-axis points down and the Y-axis is formed such that the resulting coordinate system is right-handed (i.e.: Y = Z cross X).

Parameters
aHeadingThe heading that defines the X-axis (radians CW from North).
aOffsetThe offset to be applied (X/Y/Z) (meters).
Note
A Z-offset of 0 does not preserve altitude. Use Extrapolate to perform that function.

◆ AddOffsetNED()

void WsfGeoPoint::AddOffsetNED ( const double aOffsetNED[3])

Add an north-east-down offset to the current location define by the geo point.

The addition takes place in the local NED frame whose origin is the current point.

Parameters
aOffsetNEDThe offset to be applied (North/East/Down) (meters).
Note
A down-offset of 0 does not preserve altitude.

◆ Clone()

◆ CloneComponent()

WsfComponent * WsfGeoPoint::CloneComponent ( ) const
inlineoverridevirtual

Clones a component. May return null if component does not support clone.

Implements WsfComponent.

References Clone().

◆ Extrapolate()

void WsfGeoPoint::Extrapolate ( double aHeading,
double aDistance )

Extrapolate a geo point for a given distance along a heading.

Parameters
aHeadingThe heading along which the extrapolation should occur (radians CW from North)
aDistanceThe extrapolation distance (meters).

References SetLocationLLA().

Referenced by WsfPathComputer::CreateTarget().

◆ GetAlt()

◆ GetApparentTime()

double WsfGeoPoint::GetApparentTime ( const UtCalendar & aEpoch) const

Return the apparent time in hours since midnight of this point at the given aEpoch.

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ GetDistanceFrom() [1/2]

double WsfGeoPoint::GetDistanceFrom ( const WsfGeoPoint & aRefPoint) const

Get the distance from one geo point to another.

Parameters
aRefPointThe reference geo point.

References WsfGeoPoint().

◆ GetDistanceFrom() [2/2]

◆ GetLat()

double WsfGeoPoint::GetLat ( ) const

Get the latitude of a geo point.

Returns
The latitude (in degrees, range [-90, 90]) of the geo point.

Referenced by WsfInterceptCalculator::CanIntercept(), WsfNavigationMesh::CleanUpDuplicatePoints(), WsfPathComputer::CreateTarget(), WsfRouteFinder::DrawRoute(), WsfRouteMover::FindAndSetPath(), WsfPathFinder::FindClosestPointInQuadrant(), WsfPathFinder::FindClosestPointOnEdge(), WsfNavigationMesh::FindClosestValidPoint(), WsfPathFinder::FindClosestValidPoint(), ZoneUtils::FindIntersection(), WsfPathFinder::FindPath(), WsfNavigationMesh::GetCellForPoint(), WsfNavigationMesh::GetCellsForPoint(), WsfPathFinder::GetClosestNode(), WsfTerrainPathFinder::GetClosestNodePos(), ZoneUtils::GetLatLonPoints(), WsfTerrainPathFinder::Initialize(), ZoneUtils::PointIsInAngularExtents(), WsfSA_Predict::ProjectPositionGoToPoint(), WsfSA_Predict::ProjectPositionRollAndPull(), WsfSA_Predict::ProjectPositionTurnToHeading(), WsfRouteFinder::Route(), WsfZoneRouteFinder::RouteAroundZones(), XWsfOSM_Traffic::ScriptGoOffroad(), WsfBMStatusMessage::SetPosition(), WsfBMTrackMessage::SetPosition(), WsfZoneDefinition::SetReference(), wsf::comm::ComponentHW_Subsurface::SetSubmarineRadioValues(), WsfScriptGeoPointClass::ToString(), WsfScriptGeoPointClass::ToStringMGRS(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetLocationECI()

void WsfGeoPoint::GetLocationECI ( const UtCalendar & aTime,
double aLocationECI[3] ) const

Get the geo point location in earth-centered inertial coordinates.

Parameters
aTimeThe epoch at which the ECI location is desired.
aLocationECIThe returned ECI location.

◆ GetLocationLLA()

◆ GetLocationWCS()

void WsfGeoPoint::GetLocationWCS ( double aLocationWCS[3]) const

Get the geo point location in world coordinates.

Parameters
aLocationWCS[output] The geo point location in world coordinates.

Referenced by WsfSA_PerceivedItem::AngleOffHeadingFromOwningPlatform_deg(), WsfInterceptCalculator::CanIntercept(), WsfNoiseCloud::CheckIntersections(), WsfClusterCorrelation::ClusterRawTracksIntoLocalTracks(), WsfWaypointMover::CornerVelocity(), WsfClusterManager::CrossLength(), WsfClusterManager::CrossLength(), WsfClusterManager::CrossLength(), WsfClusterManager::CrossLength(), WsfPathFinder::FindClosestValidPoint(), WsfNavigationMesh::GetCellZoneInteraction(), ZoneUtils::GetClosestPointInZone(), ZoneUtils::GetDistanceFromEllipseToPoint(), ZoneUtils::GetDistanceFromPointToZone(), ZoneUtils::GetDistanceFromPointToZoneCenter(), wsf::six_dof::Mover::GetInitialState(), WsfP6DOF_Mover::GetInitialState(), ZoneUtils::GetLatLonPoints(), GroundRangeTo(), WsfGuidanceComputer::Initialize2(), ZoneUtils::PointIsInAngularExtents(), WsfNavigationMesh::ProcessInput(), WsfPathFinder::ProcessInput(), WsfRouteFinder::Route(), SlantRangeTo(), TrueBearingTo(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ GetLon()

double WsfGeoPoint::GetLon ( ) const

Get the longitude of a geo point.

Returns
The longitude (in degrees, range [-180, 180]) of the geo point.

Referenced by WsfInterceptCalculator::CanIntercept(), WsfNavigationMesh::CleanUpDuplicatePoints(), WsfPathComputer::CreateTarget(), WsfRouteFinder::DrawRoute(), WsfRouteMover::FindAndSetPath(), WsfPathFinder::FindClosestPointInQuadrant(), WsfPathFinder::FindClosestPointOnEdge(), WsfNavigationMesh::FindClosestValidPoint(), WsfPathFinder::FindClosestValidPoint(), ZoneUtils::FindIntersection(), WsfPathFinder::FindPath(), WsfNavigationMesh::GetCellForPoint(), WsfNavigationMesh::GetCellsForPoint(), WsfPathFinder::GetClosestNode(), WsfTerrainPathFinder::GetClosestNodePos(), ZoneUtils::GetLatLonPoints(), WsfTerrainPathFinder::Initialize(), ZoneUtils::PointIsInAngularExtents(), WsfSA_Predict::ProjectPositionGoToPoint(), WsfSA_Predict::ProjectPositionRollAndPull(), WsfSA_Predict::ProjectPositionTurnToHeading(), WsfRouteFinder::Route(), WsfZoneRouteFinder::RouteAroundZones(), XWsfOSM_Traffic::ScriptGoOffroad(), WsfBMStatusMessage::SetPosition(), WsfBMTrackMessage::SetPosition(), WsfZoneDefinition::SetReference(), wsf::comm::ComponentHW_Subsurface::SetSubmarineRadioValues(), WsfScriptGeoPointClass::ToString(), WsfScriptGeoPointClass::ToStringMGRS(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ GroundRangeTo()

◆ operator=()

WsfGeoPoint & WsfGeoPoint::operator= ( const WsfGeoPoint & aRhs)

◆ ProcessInput()

bool WsfGeoPoint::ProcessInput ( UtInput & aInput)
overridevirtual

Process input from a generic source.

Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.

Reimplemented from WsfComponent.

References WsfNamed::SetName().

Referenced by WsfNavigationMesh::ProcessInput(), WsfPathFinder::ProcessInput(), and WsfTerrainPathFinder::ProcessInput().

◆ QueryInterface()

void * WsfGeoPoint::QueryInterface ( int aRole)
inlineoverridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Implements WsfComponent.

References WsfSimpleComponentT< WsfPlatformComponent >::mRoles.

◆ RegisterComponentFactory()

void WsfGeoPoint::RegisterComponentFactory ( WsfScenario & aScenario)
static

◆ Serialize()

template<typename AR>
void WsfGeoPoint::Serialize ( AR & aAr)
inline

For XIO (de)serialization.

◆ SetAltitudeMSL()

void WsfGeoPoint::SetAltitudeMSL ( double aAltitude)

Sets the altitude in meters above sea level.

References GetLocationLLA(), and SetLocationLLA().

Referenced by WsfRouteFinder::Route(), and WsfZoneRouteFinder::RouteAroundZones().

◆ SetLocationLLA()

◆ SetLocationWCS()

◆ SlantRangeTo()

double WsfGeoPoint::SlantRangeTo ( const WsfGeoPoint & aRhs,
const bool aUseSpherical = true ) const

Returns the slant range to a location.

References GetLocationWCS(), and WsfGeoPoint().

◆ TrueBearingTo()

double WsfGeoPoint::TrueBearingTo ( const WsfGeoPoint & aRhs) const

Returns the true bearing to another geopoint in radians.

References GetLocationWCS(), and WsfGeoPoint().

Referenced by ZoneUtils::GetDistanceFromEllipseToPoint(), and UT_DEFINE_SCRIPT_METHOD().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved