|
WSF
|
#include <WsfNavigationMesh.hpp>


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< WsfStringId > | TypeList |
| 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 WsfPFNode * | GetClosestNode (const WsfGeoPoint &aPointPtr) override |
| void | RefineFromCurrentIndex (int aIndex) |
| bool | RefineFromCurrentPosition (int aIndex, double aLat, double aLon, double aAlt, WsfRoute &aRoute, const WsfRoute *aOriginalRoute) |
| WsfNavigationCell * | GetCellForPoint (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 () |
| WsfGeoPoint * | FindClosestValidPoint (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 () |
| WsfGeoPoint * | FindClosestPointOnEdge (double aSimTime, const WsfGeoPoint &aGeoPoint) |
| WsfGeoPoint * | FindClosestPointInQuadrant (const WsfGeoPoint &aGeoPoint, int aQuadrant) |
| WsfZone * | GetZoneByName (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 |
| WsfSimulation * | GetSimulation () const |
| Public Member Functions inherited from WsfUncloneableObject | |
| WsfUncloneableObject () | |
| WsfObject * | Clone () 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 TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (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 |
| WsfDraw * | mDebugMeshDrawPtr |
| WsfDraw * | mDebugRouteDrawPtr |
| std::vector< WsfPFNode * > | mMeshNodes |
| std::vector< WsfGeoPoint > | mAdjustedPath |
| std::vector< WsfNavigationCell * > | mGetCellForPointCache |
| Protected Attributes inherited from WsfPathFinder | |
| WsfScenario * | mScenarioPtr |
| WsfSimulation * | mSimulationPtr |
| 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 |
| WsfDraw * | mDebugDrawObjPtr |
| 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()). | |
| WsfNavigationMesh::WsfNavigationMesh | ( | WsfScenario * | aScenarioPtr | ) |
|
override |
References mDebugMeshDrawPtr, mDebugRouteDrawPtr, and mMeshCells.
| void WsfNavigationMesh::CleanUpDuplicatePoints | ( | ) |
References WsfGeoPoint::GetLat(), WsfGeoPoint::GetLocationLLA(), WsfGeoPoint::GetLon(), and mAdjustedPath.
Referenced by FindPath(), and RefineFromCurrentPosition().
Called when FindAndSetPath is called on a mover
| aMover | The mover that is performing the movement. |
| aRoute | The route to be transformed. Returns 'true' if aRoute was modified. |
Reimplemented from WsfRouteComputer.
References ComputeSetRoute(), and mAdjustedPath.
|
overridevirtual |
Called when a mover is given an initial route.
| aMover | The mover that is performing the movement. |
| aRoute | The route to be transformed. |
| aInitialPointIndex | The 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().
| void WsfNavigationMesh::CreateNavigationMesh | ( | ) |
References WsfNavigationCell::AddVertex(), GetCellNeighbors(), GetCellZoneInteraction(), InsertCellIntoGrid(), LinkGridNeighbors(), WsfNavigationCell::mCellID, WsfNavigationCell::mCellNumber, WsfPathFinder::mGrid, WsfPathFinder::mGridSizeDegrees, mMeshCells, mMeshCellsIterator, WsfNavigationCell::mNoZoneInteraction, WsfNavigationCell::mTessilationLevel, WsfPathFinder::mUpperLeft, WsfNavigationCell::mVerts, WsfNavigationCell::mX, WsfPathFinder::mXSize, WsfNavigationCell::mY, WsfPathFinder::mYSize, WsfPathFinder::mZones, NO_INTERACTION, ReNumberMeshCells(), SetMeshBoundries(), SetMeshCenter(), TessellateCell(), and THREE_VERTS_INSIDE.
Referenced by Initialize().
| void WsfNavigationMesh::DebugDrawMesh | ( | ) |
References wsf::TerrainInterface::EnableTerrain(), wsf::Terrain::GetElevApprox(), WsfPathFinder::GetSimulation(), WsfSimulation::GetTerrainInterface(), WsfNavigationCell::mCellCentroid, mDebugMeshDrawPtr, mMeshCells, and WsfNavigationCell::mNeighborIterator.
Referenced by DebugDrawZones(), and UT_DEFINE_SCRIPT_METHOD().
|
overridevirtual |
Reimplemented from WsfPathFinder.
References DebugDrawMesh(), WsfZoneDefinition::GetPoints(), WsfPathFinder::mDebugDrawObjPtr, WsfZone::Point::mX, WsfZone::Point::mY, and WsfPathFinder::mZones.
Referenced by UT_DEFINE_SCRIPT_METHOD().
|
overridevirtual |
Reimplemented from WsfPathFinder.
References WsfGeoPoint::GetAlt(), GetCellForPoint(), WsfGeoPoint::GetLat(), WsfGeoPoint::GetLon(), WsfNavigationCell::mCellCentroid, mMeshCells, and mMeshCellsIterator.
|
overridevirtual |
Reimplemented from WsfPathFinder.
References WsfRoute::Append(), WsfPath::cDOUBLE_NOT_SET, CleanUpDuplicatePoints(), WsfRoute::Clear(), FLOAT_EPSILON, GetClosestNode(), WsfGeoPoint::GetDistanceFrom(), WsfGeoPoint::GetLocationLLA(), GetRouteIntersectionPoints(), mAdjustedPath, WsfPathFinder::mInitialized, WsfPathFinder::mUpperLeft, and shortest_path().
Referenced by ComputeSetRoute().
| WsfNavigationCell * WsfNavigationMesh::GetCellForPoint | ( | const WsfGeoPoint & | aPoint | ) |
References WsfGeoPoint::GetAlt(), WsfGeoPoint::GetLat(), WsfGeoPoint::GetLon(), mGetCellForPointCache, mMeshCells, mMeshCellsIterator, and WsfNavigationCell::PointInCell().
Referenced by FindClosestValidPoint(), GetClosestNode(), GetFurthestVisiblePoint(), GetRouteIntersectionPoints(), and LineOfSightTest().
| void WsfNavigationMesh::GetCellNeighbors | ( | WsfNavigationCell * | aNavCellPtr | ) |
| std::vector< WsfNavigationCell * > WsfNavigationMesh::GetCellsForPoint | ( | const WsfGeoPoint & | aPoint | ) |
| WsfNavigationMesh::ZONE_INTERACTION WsfNavigationMesh::GetCellZoneInteraction | ( | WsfNavigationCell * | aCellPtr, |
| WsfZoneDefinition * | aZonePtr ) |
References WsfGeoPoint::GetLocationWCS(), WsfZoneDefinition::GetPoints(), WsfPathFinder::GetSimulation(), WsfNavigationCell::mVertexIterator, WsfNavigationCell::mVerts, WsfZone::Point::mX, WsfZone::Point::mY, NO_INTERACTION, WsfNavigationCell::PointInCell(), WsfZoneDefinition::PointIsInside(), and ZONE_VERT_INSIDE.
Referenced by CreateNavigationMesh(), and TessellateCell().
|
overridevirtual |
Reimplemented from WsfPathFinder.
References GetCellForPoint(), GetGrid(), WsfNavigationCell::mCellNumber, and WsfPathFinder::mInitialized.
Referenced by FindPath().
| int WsfNavigationMesh::GetFurthestVisiblePoint | ( | int | aIndex, |
| WsfRoute & | aRoute ) |
References WsfRoute::Clear(), GetCellForPoint(), LineOfSightTest(), mAdjustedPath, and MovePointAlongPath().
Referenced by RefineFromCurrentIndex(), and RefineFromCurrentPosition().
| WsfPathFinder::node_iterator WsfNavigationMesh::GetGrid | ( | long | aX, |
| long | aY ) |
References begin(), and end().
Referenced by GetClosestNode(), and LinkGridNeighbors().
|
inline |
Referenced by WsfRouteMover::Update().
|
inline |
References mMeshCells.
Referenced by UT_DEFINE_SCRIPT_METHOD().
|
overridevirtual |
Reimplemented from WsfPathFinder.
References WsfGeoPoint::GetLocationLLA(), WsfSimulation::GetRandom(), WsfPathFinder::GetSimulation(), WsfNavigationCell::mCellCentroid, mMeshCells, and WsfNavigationCell::mVerts.
|
inline |
Referenced by WsfRouteMover::Update().
| void WsfNavigationMesh::GetRouteIntersectionPoints | ( | ) |
References GetCellForPoint(), WsfGeoPoint::GetLocationLLA(), mAdjustedPath, and WsfNavigationCell::mSides.
Referenced by FindPath().
|
override |
|
inline |
References WsfPathFinder::mXSize.
|
inline |
References WsfPathFinder::mYSize.
|
overridevirtual |
Reimplemented from WsfPathFinder.
References CreateNavigationMesh(), mDebugMeshDrawPtr, mDebugRouteDrawPtr, WsfPathFinder::mGridSizeDegrees, WsfPathFinder::mInitialized, WsfPathFinder::mLowerRight, WsfPathFinder::mSimulationPtr, WsfPathFinder::mUpperLeft, WsfPathFinder::mXSize, and WsfPathFinder::mYSize.
| void WsfNavigationMesh::InsertCellIntoGrid | ( | WsfNavigationCell * | aNavCellPtr | ) |
References WsfNavigationCell::mCellCentroid, WsfNavigationCell::mCellNumber, WsfNavigationCell::mWeight, and WsfPathFinder::SetGridAbsolute().
Referenced by CreateNavigationMesh().
|
inlineoverridevirtual |
Reimplemented from WsfRouteComputer.
| bool WsfNavigationMesh::LineOfSightTest | ( | WsfNavigationCell * | aFromCellPtr, |
| int | aIndexFrom, | ||
| int | aIndexTo, | ||
| WsfRoute & | aRoute ) |
References WsfRoute::Append(), WsfPath::cDOUBLE_NOT_SET, WsfNavigationCell::ClassifyPathToCell(), WsfNavigationCell::ENDING_CELL, WsfNavigationCell::EXITING_CELL, GetCellForPoint(), WsfGeoPoint::GetLocationLLA(), mAdjustedPath, MovePointAlongPath(), and WsfNavigationCell::NO_RELATIONSHIP.
Referenced by GetFurthestVisiblePoint().
| void WsfNavigationMesh::LinkGridNeighbors | ( | WsfNavigationCell * | aNavCellPtr | ) |
| void WsfNavigationMesh::MovePointAlongPath | ( | WsfGeoPoint & | aPoint, |
| int | aIndexFrom, | ||
| int | aIndexTo ) |
References WsfGeoPoint::GetLocationLLA(), mAdjustedPath, and WsfGeoPoint::SetLocationLLA().
Referenced by GetFurthestVisiblePoint(), and LineOfSightTest().
| void WsfNavigationMesh::MovePointTowardsCentroid | ( | WsfGeoPoint & | aPoint, |
| int | aIndexFrom, | ||
| WsfNavigationCell * | aCellPtr ) |
|
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'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
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().
| void WsfNavigationMesh::RefineFromCurrentIndex | ( | int | aIndex | ) |
| bool WsfNavigationMesh::RefineFromCurrentPosition | ( | int | aIndex, |
| double | aLat, | ||
| double | aLon, | ||
| double | aAlt, | ||
| WsfRoute & | aRoute, | ||
| const WsfRoute * | aOriginalRoute ) |
References WsfRoute::Append(), WsfPath::cDOUBLE_NOT_SET, CleanUpDuplicatePoints(), WsfRoute::Clear(), GetFurthestVisiblePoint(), WsfWaypoint::GetLocationLLA(), WsfRoute::GetSize(), WsfRoute::GetSpeed(), WsfRoute::GetWaypointAt(), mAdjustedPath, WsfObject::SetName(), and WsfRoute::SetSpeed().
Referenced by ComputeSetRoute(), and WsfRouteMover::Update().
| void WsfNavigationMesh::ReNumberMeshCells | ( | ) |
References WsfNavigationCell::mCellID, WsfNavigationCell::mCellNumber, and mMeshCells.
Referenced by CreateNavigationMesh().
| void WsfNavigationMesh::SetMeshBoundries | ( | double | aLLA[3] | ) |
Referenced by CreateNavigationMesh().
| void WsfNavigationMesh::SetMeshCenter | ( | ) |
Referenced by CreateNavigationMesh().
|
inline |
Referenced by ProcessInput().
|
inline |
Referenced by WsfRouteMover::Update().
|
override |
References WsfPathFinder::mInitialized.
Referenced by FindPath().
| void WsfNavigationMesh::TessellateCell | ( | WsfNavigationCell * | aCellPtr, |
| WsfZoneDefinition * | aZonePtr, | ||
| int | aCurrentTessLevel ) |
References WsfNavigationCell::AddVertex(), GetCellZoneInteraction(), MAX_TESSILLATION_LEVEL, WsfNavigationCell::mCellID, mMeshCells, WsfNavigationCell::mTessilationLevel, WsfNavigationCell::mTessillated, WsfNavigationCell::mVerts, WsfNavigationCell::mX, WsfNavigationCell::mY, NO_INTERACTION, TessellateCell(), and THREE_VERTS_INSIDE.
Referenced by CreateNavigationMesh(), and TessellateCell().
|
protected |
|
protected |
Referenced by DebugDrawMesh(), Initialize(), WsfNavigationMesh(), and ~WsfNavigationMesh().
|
protected |
Referenced by Initialize(), WsfNavigationMesh(), and ~WsfNavigationMesh().
|
protected |
Referenced by GetCellForPoint(), and WsfNavigationMesh().
|
protected |
|
protected |
|
protected |
Referenced by WsfNavigationMesh().