WSF
WsfTerrainPathFinder Class Reference

#include <WsfTerrainPathFinder.hpp>

Inheritance diagram for WsfTerrainPathFinder:
Collaboration diagram for WsfTerrainPathFinder:

Classes

struct  sTerrainLatLon
struct  sTerrainTriCell

Public Member Functions

 WsfTerrainPathFinder (WsfScenario *aScenarioPtr)
 ~WsfTerrainPathFinder () override=default
bool Initialize (WsfSimulation *aSimulationPtr) override
const WsfPFNodeGetClosestNode (const WsfGeoPoint &aPointPtr) override
const WsfPFNodeGetClosestNodePos (float x, const WsfGeoPoint &aPointPtr)
bool ProcessInput (UtInput &aInput) override
bool ComparePoints (sTerrainLatLon aPt1, sTerrainLatLon aPt2)
Public Member Functions inherited from WsfPathFinder
 WsfPathFinder (WsfScenario *aScenarioPtr, WsfGeoPoint &aUpperLeftPtr, WsfGeoPoint &aLowerRightPtr, double aGridSizeDegrees)
 WsfPathFinder (WsfScenario *aScenarioPtr)
 ~WsfPathFinder () override
const char * GetScriptClassName () const override
void AddZone (WsfZone *aZonePtr, double aWeight)
void RemoveZone (WsfZone *aZonePtr)
void RecalculateWeights ()
virtual bool FindPath (const WsfGeoPoint &aStartPtr, WsfGeoPoint &aEndPtr, WsfRoute &aRoute, double &aCost)
void print () const
node_iterator GetGrid (long aX, long aY)
node_iterator GetGridAbsolute (unsigned long idx)
void SetGrid (unsigned long aX, unsigned long aY, node_iterator aIterPtr)
void SetGridAbsolute (unsigned long aX, node_iterator aIterPtr)
void DebugDrawGrid ()
virtual void DebugDrawZones ()
WsfGeoPoint GetNodeLocation (int nodeIndex)
long GetXSize ()
long GetYSize ()
bool GetConsiderNode (const WsfPFNode &aNode)
bool GetConsiderNode (const WsfGeoPoint &aGeoPoint)
int GetNumberOfZones ()
double GetGridSizeDegrees ()
WsfGeoPoint GetUpperLeft ()
WsfGeoPoint GetLowerRight ()
WsfGeoPointFindClosestPointOnEdge (double aSimTime, const WsfGeoPoint &aGeoPoint)
virtual WsfGeoPointFindClosestValidPoint (double aSimTime, const WsfGeoPoint &aGeoPoint)
WsfGeoPointFindClosestPointInQuadrant (const WsfGeoPoint &aGeoPoint, int aQuadrant)
WsfZoneGetZoneByName (const std::string &aZoneName)
bool ComputeFindPath (WsfMover &aMover, WsfRoute &aRoute) override
bool ComputeSetRoute (WsfMover &aMover, WsfRoute &aRoute, int &aInitialPointIndex) override
bool ComputeUpdateRoute (WsfMover &aMover, WsfRoute &aRoute) override
bool ComputeExtrapolate (WsfMover &aMover, WsfRoute &aRoute) override
bool ReturnToRoute (WsfMover &aMover, WsfRoute &aRoute) override
virtual WsfGeoPoint GetRandomLocation ()
virtual void SetDebugEnabled (bool aDebugEnabled)
bool DebugEnabled () const
WsfSimulationGetSimulation () const
Public Member Functions inherited from WsfUncloneableObject
 WsfUncloneableObject ()
WsfObjectClone () const override
Public Member Functions inherited from WsfObject
 WsfObject ()
 This is the constructor for the WsfObject class.
 ~WsfObject () override
 This is the destructor for the WsfObject class.
const char * GetScriptClassName () const override
const std::string & GetType () const
WsfStringId GetTypeId () const
 Get the string ID of the 'type' of the object.
void SetType (WsfStringId aType)
const std::string & GetBaseType () const
WsfStringId GetBaseTypeId () const
const TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (const WsfObject &aRhs)
 Assignment operator.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfRouteComputer
virtual ~WsfRouteComputer ()
virtual bool IsNavMesh ()
virtual bool GetEnabled ()

Additional Inherited Members

Public Types inherited from WsfPathFinder
using PFGraph = UtGraphT<WsfPFNode, WsfPFEdge, false, double>
Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.
Protected Member Functions inherited from WsfPathFinder
bool ContainsZone (WsfZone *aZonePtr)
bool ContainsZone (const std::string &aZoneName)
bool PointIsInGridBounds (int x, int y)
bool IsDuplicateEdge (node_iterator nodeIter, const WsfPFNode &aNode2, const WsfPFEdge &tmpEdge)
bool shortest_path (const_node_iterator aSrcNodeIter, const_node_iterator aDstNodeIter, NodeList &aPath, double &aCost, const cost_func *aCostFuncPtr=nullptr) const override
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).
Protected Attributes inherited from WsfPathFinder
WsfScenariomScenarioPtr
WsfSimulationmSimulationPtr
std::list< WsfZone * > mZones
std::map< WsfZone *, double > mZoneWeights
WsfGeoPoint mUpperLeft
WsfGeoPoint mLowerRight
double mGridSizeDegrees
long mXSize
long mYSize
std::vector< node_iterator > mGrid
bool mInitialized
WsfDrawmDebugDrawObjPtr
bool mDebugEnabled

Constructor & Destructor Documentation

◆ WsfTerrainPathFinder()

WsfTerrainPathFinder::WsfTerrainPathFinder ( WsfScenario * aScenarioPtr)

◆ ~WsfTerrainPathFinder()

WsfTerrainPathFinder::~WsfTerrainPathFinder ( )
overridedefault

References GetClosestNodePos().

Member Function Documentation

◆ ComparePoints()

bool WsfTerrainPathFinder::ComparePoints ( sTerrainLatLon aPt1,
sTerrainLatLon aPt2 )

◆ GetClosestNode()

const WsfPFNode * WsfTerrainPathFinder::GetClosestNode ( const WsfGeoPoint & aPointPtr)
overridevirtual

Reimplemented from WsfPathFinder.

References GetClosestNodePos(), and WsfPathFinder::mInitialized.

◆ GetClosestNodePos()

const WsfPFNode * WsfTerrainPathFinder::GetClosestNodePos ( float x,
const WsfGeoPoint & aPointPtr )

◆ Initialize()

◆ ProcessInput()

bool WsfTerrainPathFinder::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.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfPathFinder.

References WsfPathFinder::AddZone(), WsfScenario::FindType(), WsfScenario::FromInput(), WsfPathFinder::mGridSizeDegrees, WsfPathFinder::mLowerRight, WsfPathFinder::mUpperLeft, and WsfGeoPoint::ProcessInput().


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