15#ifndef WSFNAVIGATIONMESH_HPP
16#define WSFNAVIGATIONMESH_HPP
18#include "wsf_export.h"
33#define FLOAT_EPSILON 1.0E-6F
51 void CreateNavigationMesh();
59 WsfPathFinder::node_iterator
GetGrid(
long aX,
long aY);
63 const_node_iterator aDstNodeIter,
66 const cost_func* aCostFuncPtr =
nullptr)
const override;
71 void RefineFromCurrentIndex(
int aIndex);
72 bool RefineFromCurrentPosition(
int aIndex,
double aLat,
double aLon,
double aAlt,
WsfRoute& aRoute,
const WsfRoute* aOriginalRoute);
74 std::vector<WsfNavigationCell*> GetCellsForPoint(
const WsfGeoPoint& aPoint);
79 void ReNumberMeshCells();
80 void SetMeshBoundries(
double aLLA[3]);
84 int GetFurthestVisiblePoint(
int aIndex,
WsfRoute& aRoute);
87 void MovePointAlongPath(
WsfGeoPoint& aPoint,
int aIndexFrom,
int aIndexTo);
91 void GetRouteIntersectionPoints();
92 void CleanUpDuplicatePoints();
105 void GenerateExportedNavMesh();
106 void ImportNavMesh();
108 class pf_cost_func :
public PFGraph::cost_func
113 double cost = (aEdge.
mLength * 2);
117 double operator()(
const WsfPFNode& aNode1,
const WsfPFNode& aNode2)
const override
124 bool consider_node(
const WsfPFNode& aNode1)
const override
127 std::numeric_limits<double>::max())
154 double mCenterLLA[3];
155 double mRefineUpdateTime;
156 double mNavMeshThinkTime;
157 std::string mInputFile;
158 std::string mOutputFile;
159 bool mLoadBinaryFile;
160 std::map<unsigned int, WsfNavigationCell*> mCellMap;
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Provides the capability to draw shapes into the WSF replay file.
Definition WsfDraw.hpp:35
Definition WsfGeoPoint.hpp:29
double GetDistanceFrom(double aLocationWCS[3]) const
Definition WsfGeoPoint.cpp:151
Definition WsfMover.hpp:37
Definition WsfNavigationCell.hpp:29
void SetRefineUpdateTime(double aTime)
Definition WsfNavigationMesh.hpp:98
int GetXSize()
Definition WsfNavigationMesh.hpp:54
ZONE_INTERACTION
Definition WsfNavigationMesh.hpp:43
@ THREE_VERTS_INSIDE
Definition WsfNavigationMesh.hpp:47
@ ZONE_VERT_INSIDE
Definition WsfNavigationMesh.hpp:48
@ TWO_VERTS_INSIDE
Definition WsfNavigationMesh.hpp:46
@ NO_INTERACTION
Definition WsfNavigationMesh.hpp:44
@ ONE_VERT_INSIDE
Definition WsfNavigationMesh.hpp:45
WsfDraw * mDebugRouteDrawPtr
Definition WsfNavigationMesh.hpp:143
std::vector< WsfGeoPoint > mAdjustedPath
Definition WsfNavigationMesh.hpp:145
WsfNavigationMesh(WsfScenario *aScenarioPtr)
Definition WsfNavigationMesh.cpp:36
bool IsNavMesh() override
Definition WsfNavigationMesh.hpp:96
double GetRefineUpdateTime()
Definition WsfNavigationMesh.hpp:99
double GetNavMeshThinkTime()
Definition WsfNavigationMesh.hpp:102
std::vector< WsfNavigationCell * > mGetCellForPointCache
Definition WsfNavigationMesh.hpp:146
std::vector< WsfPFNode * > mMeshNodes
Definition WsfNavigationMesh.hpp:144
WsfDraw * mDebugMeshDrawPtr
Definition WsfNavigationMesh.hpp:142
int GetYSize()
Definition WsfNavigationMesh.hpp:55
int GetNumCells()
Definition WsfNavigationMesh.hpp:56
void SetNavMeshThinkTime(double aTime)
Definition WsfNavigationMesh.hpp:101
std::vector< WsfNavigationCell * > mMeshCells
Definition WsfNavigationMesh.hpp:140
std::vector< WsfNavigationCell * >::iterator mMeshCellsIterator
Definition WsfNavigationMesh.hpp:141
Definition WsfPathFinder.hpp:58
WsfGeoPoint mLoc
Definition WsfPathFinder.hpp:79
double mWeight
Definition WsfPathFinder.hpp:77
long mXSize
Definition WsfPathFinder.hpp:196
virtual void DebugDrawZones()
Definition WsfPathFinder.cpp:1052
WsfPathFinder(WsfScenario *aScenarioPtr, WsfGeoPoint &aUpperLeftPtr, WsfGeoPoint &aLowerRightPtr, double aGridSizeDegrees)
Definition WsfPathFinder.cpp:64
virtual WsfGeoPoint * FindClosestValidPoint(double aSimTime, const WsfGeoPoint &aGeoPoint)
Definition WsfPathFinder.cpp:909
const char * GetScriptClassName() const override
Definition WsfPathFinder.cpp:1295
bool ProcessInput(UtInput &aInput) override
Definition WsfPathFinder.cpp:465
bool ComputeFindPath(WsfMover &aMover, WsfRoute &aRoute) override
Definition WsfPathFinder.cpp:1185
virtual bool FindPath(const WsfGeoPoint &aStartPtr, WsfGeoPoint &aEndPtr, WsfRoute &aRoute, double &aCost)
Definition WsfPathFinder.cpp:314
bool shortest_path(const_node_iterator aSrcNodeIter, const_node_iterator aDstNodeIter, NodeList &aPath, double &aCost, const cost_func *aCostFuncPtr=nullptr) const override
Definition WsfPathFinder.cpp:395
virtual bool Initialize(WsfSimulation *aSimulationPtr)
Definition WsfPathFinder.cpp:102
node_iterator GetGrid(long aX, long aY)
Definition WsfPathFinder.cpp:418
bool ComputeSetRoute(WsfMover &aMover, WsfRoute &aRoute, int &aInitialPointIndex) override
Definition WsfPathFinder.cpp:1192
virtual WsfGeoPoint GetRandomLocation()
Definition WsfPathFinder.cpp:1021
long mYSize
Definition WsfPathFinder.hpp:197
virtual const WsfPFNode * GetClosestNode(const WsfGeoPoint &aPointPtr)
Definition WsfPathFinder.cpp:292
A collection of WsfWaypoint objects that represent a path to be followed.
Definition WsfRoute.hpp:40
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
UT_DECLARE_SCRIPT_METHOD(DebugDrawMesh)
WsfScriptNavigationMeshClass(const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)
Definition WsfNavigationMesh.cpp:1875
WsfScriptObjectClass(const std::string &aClassName, UtScriptTypes *aTypesPtr)
Definition WsfScriptObjectClass.cpp:24
The main controller for a simulation.
Definition WsfSimulation.hpp:109
A class for defining a zone.
Definition WsfZoneDefinition.hpp:32
Definition WsfPathFinder.hpp:87
double mLength
Definition WsfPathFinder.hpp:102