WSF
WsfNavigationMesh Class Reference

#include <WsfNavigationMesh.hpp>

Inheritance diagram for WsfNavigationMesh:
Collaboration diagram for WsfNavigationMesh:

Public Types

enum  ZONE_INTERACTION {
  NO_INTERACTION , ONE_VERT_INSIDE , TWO_VERTS_INSIDE , THREE_VERTS_INSIDE ,
  ZONE_VERT_INSIDE
}
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.

Public Member Functions

 WsfNavigationMesh (WsfScenario *aScenarioPtr)
 ~WsfNavigationMesh () override
bool ProcessInput (UtInput &aInput) override
const char * GetScriptClassName () const override
void CreateNavigationMesh ()
void GetCellNeighbors (WsfNavigationCell *aNavCellPtr)
int GetXSize ()
int GetYSize ()
int GetNumCells ()
void DebugDrawMesh ()
void DebugDrawZones () override
WsfPathFinder::node_iterator GetGrid (long aX, long aY)
bool Initialize (WsfSimulation *aSimulationPtr) override
bool shortest_path (const_node_iterator aSrcNodeIter, const_node_iterator aDstNodeIter, NodeList &aPath, double &aCost, const cost_func *aCostFuncPtr=nullptr) const override
bool FindPath (const WsfGeoPoint &aStartPtr, WsfGeoPoint &aEndPtr, WsfRoute &aRoute, double &aCost) override
const WsfPFNodeGetClosestNode (const WsfGeoPoint &aPointPtr) override
void RefineFromCurrentIndex (int aIndex)
bool RefineFromCurrentPosition (int aIndex, double aLat, double aLon, double aAlt, WsfRoute &aRoute, const WsfRoute *aOriginalRoute)
WsfNavigationCellGetCellForPoint (const WsfGeoPoint &aPoint)
std::vector< WsfNavigationCell * > GetCellsForPoint (const WsfGeoPoint &aPoint)
void TessellateCell (WsfNavigationCell *aCellPtr, WsfZoneDefinition *aZonePtr, int aCurrentTessLevel)
ZONE_INTERACTION GetCellZoneInteraction (WsfNavigationCell *aCellPtr, WsfZoneDefinition *aZonePtr)
void ReNumberMeshCells ()
void SetMeshBoundries (double aLLA[3])
void SetMeshCenter ()
void InsertCellIntoGrid (WsfNavigationCell *aNavCellPtr)
void LinkGridNeighbors (WsfNavigationCell *aNavCellPtr)
int GetFurthestVisiblePoint (int aIndex, WsfRoute &aRoute)
bool LineOfSightTest (WsfNavigationCell *aFromCellPtr, int aIndexFrom, int aIndexTo, WsfRoute &aRoute)
void MovePointAlongPath (WsfGeoPoint &aPoint, int aIndexFrom, int aIndexTo)
void MovePointTowardsCentroid (WsfGeoPoint &aPoint, int aIndexFrom, WsfNavigationCell *aCellPtr)
bool ComputeSetRoute (WsfMover &aMover, WsfRoute &aRoute, int &aInitialPointIndex) override
bool ComputeFindPath (WsfMover &aMover, WsfRoute &aRoute) override
void GetRouteIntersectionPoints ()
void CleanUpDuplicatePoints ()
WsfGeoPointFindClosestValidPoint (double aSimTime, const WsfGeoPoint &aGeoPoint) override
WsfGeoPoint GetRandomLocation () override
bool IsNavMesh () override
void SetRefineUpdateTime (double aTime)
double GetRefineUpdateTime ()
void SetNavMeshThinkTime (double aTime)
double GetNavMeshThinkTime ()
Public Member Functions inherited from WsfPathFinder
 WsfPathFinder (WsfScenario *aScenarioPtr, WsfGeoPoint &aUpperLeftPtr, WsfGeoPoint &aLowerRightPtr, double aGridSizeDegrees)
 WsfPathFinder (WsfScenario *aScenarioPtr)
 ~WsfPathFinder () override
bool ProcessInput (UtInput &aInput) override
const char * GetScriptClassName () const override
void AddZone (WsfZone *aZonePtr, double aWeight)
void RemoveZone (WsfZone *aZonePtr)
void RecalculateWeights ()
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 ()
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)
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 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 GetEnabled ()

Protected Attributes

std::vector< WsfNavigationCell * > mMeshCells
std::vector< WsfNavigationCell * >::iterator mMeshCellsIterator
WsfDrawmDebugMeshDrawPtr
WsfDrawmDebugRouteDrawPtr
std::vector< WsfPFNode * > mMeshNodes
std::vector< WsfGeoPointmAdjustedPath
std::vector< WsfNavigationCell * > mGetCellForPointCache
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

Additional Inherited Members

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()).

Member Enumeration Documentation

◆ ZONE_INTERACTION

Enumerator
NO_INTERACTION 
ONE_VERT_INSIDE 
TWO_VERTS_INSIDE 
THREE_VERTS_INSIDE 
ZONE_VERT_INSIDE 

Constructor & Destructor Documentation

◆ WsfNavigationMesh()

◆ ~WsfNavigationMesh()

WsfNavigationMesh::~WsfNavigationMesh ( )
override

Member Function Documentation

◆ CleanUpDuplicatePoints()

void WsfNavigationMesh::CleanUpDuplicatePoints ( )

◆ ComputeFindPath()

bool WsfNavigationMesh::ComputeFindPath ( WsfMover & aMover,
WsfRoute & aRoute )
overridevirtual

Called when FindAndSetPath is called on a mover

Parameters
aMoverThe mover that is performing the movement.
aRouteThe route to be transformed. Returns 'true' if aRoute was modified.

Reimplemented from WsfRouteComputer.

References ComputeSetRoute(), and mAdjustedPath.

◆ ComputeSetRoute()

bool WsfNavigationMesh::ComputeSetRoute ( WsfMover & aMover,
WsfRoute & aRoute,
int & aInitialPointIndex )
overridevirtual

Called when a mover is given an initial route.

Parameters
aMoverThe mover that is performing the movement.
aRouteThe route to be transformed.
aInitialPointIndexThe index of the point within the route where movement is to start. Returns 'true' if aRoute was modified.

Reimplemented from WsfRouteComputer.

References WsfRoute::Append(), WsfRoute::Clear(), FindPath(), WsfMover::GetDefaultRoute(), WsfWaypoint::GetLat(), WsfWaypoint::GetLon(), WsfObject::GetNameId(), WsfRoute::GetSize(), WsfRoute::GetWaypointAt(), RefineFromCurrentPosition(), WsfObject::SetName(), and WsfRoute::SetSpeed().

Referenced by ComputeFindPath().

◆ CreateNavigationMesh()

◆ DebugDrawMesh()

◆ DebugDrawZones()

void WsfNavigationMesh::DebugDrawZones ( )
overridevirtual

◆ FindClosestValidPoint()

WsfGeoPoint * WsfNavigationMesh::FindClosestValidPoint ( double aSimTime,
const WsfGeoPoint & aGeoPoint )
overridevirtual

◆ FindPath()

◆ GetCellForPoint()

◆ GetCellNeighbors()

◆ GetCellsForPoint()

std::vector< WsfNavigationCell * > WsfNavigationMesh::GetCellsForPoint ( const WsfGeoPoint & aPoint)

◆ GetCellZoneInteraction()

◆ GetClosestNode()

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

◆ GetFurthestVisiblePoint()

int WsfNavigationMesh::GetFurthestVisiblePoint ( int aIndex,
WsfRoute & aRoute )

◆ GetGrid()

WsfPathFinder::node_iterator WsfNavigationMesh::GetGrid ( long aX,
long aY )

References begin(), and end().

Referenced by GetClosestNode(), and LinkGridNeighbors().

◆ GetNavMeshThinkTime()

double WsfNavigationMesh::GetNavMeshThinkTime ( )
inline

Referenced by WsfRouteMover::Update().

◆ GetNumCells()

int WsfNavigationMesh::GetNumCells ( )
inline

References mMeshCells.

Referenced by UT_DEFINE_SCRIPT_METHOD().

◆ GetRandomLocation()

◆ GetRefineUpdateTime()

double WsfNavigationMesh::GetRefineUpdateTime ( )
inline

Referenced by WsfRouteMover::Update().

◆ GetRouteIntersectionPoints()

void WsfNavigationMesh::GetRouteIntersectionPoints ( )

◆ GetScriptClassName()

const char * WsfNavigationMesh::GetScriptClassName ( ) const
override

◆ GetXSize()

int WsfNavigationMesh::GetXSize ( )
inline

References WsfPathFinder::mXSize.

◆ GetYSize()

int WsfNavigationMesh::GetYSize ( )
inline

References WsfPathFinder::mYSize.

◆ Initialize()

◆ InsertCellIntoGrid()

◆ IsNavMesh()

bool WsfNavigationMesh::IsNavMesh ( )
inlineoverridevirtual

Reimplemented from WsfRouteComputer.

◆ LineOfSightTest()

◆ LinkGridNeighbors()

◆ MovePointAlongPath()

void WsfNavigationMesh::MovePointAlongPath ( WsfGeoPoint & aPoint,
int aIndexFrom,
int aIndexTo )

◆ MovePointTowardsCentroid()

void WsfNavigationMesh::MovePointTowardsCentroid ( WsfGeoPoint & aPoint,
int aIndexFrom,
WsfNavigationCell * aCellPtr )

◆ ProcessInput()

bool WsfNavigationMesh::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 WsfObject.

References WsfPathFinder::AddZone(), WsfZoneDefinition::cPOLYGONAL, WsfScenario::FindType(), WsfScenario::FromInput(), WsfGeoPoint::GetLocationWCS(), WsfZoneSet::GetNumZones(), WsfZoneDefinition::GetPoints(), WsfPathFinder::GetSimulation(), WsfZoneSet::GetZoneAtIndex(), WsfPathFinder::mGridSizeDegrees, WsfPathFinder::mLowerRight, WsfPathFinder::mUpperLeft, WsfZone::Point::mX, WsfZone::Point::mY, WsfPathFinder::mZones, WsfPathFinder::mZoneWeights, WsfGeoPoint::ProcessInput(), and SetNavMeshThinkTime().

◆ RefineFromCurrentIndex()

void WsfNavigationMesh::RefineFromCurrentIndex ( int aIndex)

◆ RefineFromCurrentPosition()

◆ ReNumberMeshCells()

void WsfNavigationMesh::ReNumberMeshCells ( )

◆ SetMeshBoundries()

void WsfNavigationMesh::SetMeshBoundries ( double aLLA[3])

Referenced by CreateNavigationMesh().

◆ SetMeshCenter()

void WsfNavigationMesh::SetMeshCenter ( )

Referenced by CreateNavigationMesh().

◆ SetNavMeshThinkTime()

void WsfNavigationMesh::SetNavMeshThinkTime ( double aTime)
inline

Referenced by ProcessInput().

◆ SetRefineUpdateTime()

void WsfNavigationMesh::SetRefineUpdateTime ( double aTime)
inline

Referenced by WsfRouteMover::Update().

◆ shortest_path()

bool WsfNavigationMesh::shortest_path ( const_node_iterator aSrcNodeIter,
const_node_iterator aDstNodeIter,
NodeList & aPath,
double & aCost,
const cost_func * aCostFuncPtr = nullptr ) const
override

References WsfPathFinder::mInitialized.

Referenced by FindPath().

◆ TessellateCell()

Member Data Documentation

◆ mAdjustedPath

◆ mDebugMeshDrawPtr

WsfDraw* WsfNavigationMesh::mDebugMeshDrawPtr
protected

◆ mDebugRouteDrawPtr

WsfDraw* WsfNavigationMesh::mDebugRouteDrawPtr
protected

◆ mGetCellForPointCache

std::vector<WsfNavigationCell*> WsfNavigationMesh::mGetCellForPointCache
protected

◆ mMeshCells

◆ mMeshCellsIterator

std::vector<WsfNavigationCell*>::iterator WsfNavigationMesh::mMeshCellsIterator
protected

◆ mMeshNodes

std::vector<WsfPFNode*> WsfNavigationMesh::mMeshNodes
protected

Referenced by WsfNavigationMesh().


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