|
WSF
|
A collection of WsfRoute object that represents a connected network (such as a road network). More...
#include <WsfRouteNetwork.hpp>


Classes | |
| class | RoutePoint |
| Specifies a location along a route. More... | |
| struct | RouteNode |
| Represents a node key for use with the RouteGraph class. More... | |
| struct | RouteEdge |
| Represents an edge key for use with the RouteGraph class. More... | |
| class | RouteCostFunc |
| A cost function used by the shortest_path algorithm provided by the RouteGraph class. More... | |
Public Types | |
| using | WaypointAddr = std::pair<int, int> |
| A waypoint address. Minimal information required to look up a waypoint. | |
| using | WaypointAddrList = std::vector<WaypointAddr> |
| using | RouteGraph = UtGraphT<RouteNode, RouteEdge, false, double> |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
Public Member Functions | |
| WsfRouteNetwork () | |
| WsfRouteNetwork & | operator= (const WsfRouteNetwork &)=delete |
| ~WsfRouteNetwork () override | |
| WsfRouteNetwork * | Clone () const override |
| bool | ProcessInput (UtInput &aInput) override |
| bool | Initialize () |
| WSF_DEPRECATED bool | Add (WsfRoute *aRoute) |
| bool | Add (std::unique_ptr< WsfRoute > aRoutePtr) |
| bool | AppendShortestPathOnNetwork (RoutePoint aPoint1, RoutePoint aPoint2, WsfRoute &aPath) |
| bool | GenerateShortestPathBetweenWaypoints (const WsfWaypoint &aFromWaypoint, const WsfWaypoint &aToWaypoint, WsfRoute &aPath) |
| bool | GeneratePathOffRouteToRoute (double aStartLat, double aStartLon, double aEndLat, double aEndLon, WsfRoute &aPath) |
| bool | GeneratePathBetweenClosestWaypoints (double aStartLat, double aStartLon, double aEndLat, double aEndLon, WsfRoute &aPath) |
| bool | GeneratePathBetweenClosestSegments (double aStartLat, double aStartLon, double aEndLat, double aEndLon, WsfRoute &aPath, bool aLeaveRouteNetwork=true) |
| bool | FindClosestWaypoint (double aLat, double aLon, WsfWaypoint &aWpt, double &aDistance) |
| Returns the closest waypoint relative to the provided latitude and longitude. | |
| bool | FindClosestSegment (double aLat, double aLon, RoutePoint &aProjectedPoint, double &aDistanceToSegment) |
| unsigned int | GetRouteCount () const |
| WsfRoute & | operator[] (unsigned int aIndex) |
| Return a reference to the route by index in the network. | |
| std::vector< const WsfRoute * > | GetRoutes () const |
| Returns the list of routes in the route network. | |
| void | Append (const RoutePoint &aPoint, WsfRoute &aRoute) |
| void | AppendSubroute (const RoutePoint &aPoint1, const RoutePoint &aPoint2, WsfRoute &aRoute) |
| Append a sub-route between aPoint1 and aPoint2, which share the same route. | |
| int | GetAdjacentNodeIndices (const RoutePoint &aPoint, int *aIndices) |
| void | BuildQuadtree () |
| const RouteGraph & | GetGraph () const |
| 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) |
Static Public Member Functions | |
| static std::unique_ptr< UtScriptClass > | CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr) |
| static bool | CompareWaypointAddrRoute (const WaypointAddr &aLhs, const WaypointAddr &aRhs) |
Public Attributes | |
| WsfStringId | cSTART_NODE_ID |
| WsfStringId | cSTOP_NODE_ID |
Protected Member Functions | |
| WsfRouteNetwork (const WsfRouteNetwork &aSrc) | |
| Copy constructor (for Clone()). | |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
Friends | |
| struct | RouteCostFunc |
A collection of WsfRoute object that represents a connected network (such as a road network).
| using WsfRouteNetwork::RouteGraph = UtGraphT<RouteNode, RouteEdge, false, double> |
| using WsfRouteNetwork::WaypointAddr = std::pair<int, int> |
A waypoint address. Minimal information required to look up a waypoint.
| using WsfRouteNetwork::WaypointAddrList = std::vector<WaypointAddr> |
| WsfRouteNetwork::WsfRouteNetwork | ( | ) |
References cSTART_NODE_ID, cSTOP_NODE_ID, and WsfObject::WsfObject().
Referenced by Clone(), operator=(), WsfRouteNetwork::RouteCostFunc::RouteCostFunc(), and WsfRouteNetwork().
|
override |
|
protected |
Copy constructor (for Clone()).
References cSTART_NODE_ID, cSTOP_NODE_ID, WsfObject::WsfObject(), and WsfRouteNetwork().
| bool WsfRouteNetwork::Add | ( | std::unique_ptr< WsfRoute > | aRoutePtr | ) |
References cSTART_NODE_ID, cSTOP_NODE_ID, WsfWaypoint::GetLat(), and WsfWaypoint::GetLon().
| bool WsfRouteNetwork::Add | ( | WsfRoute * | aRoute | ) |
References Add().
Referenced by Add(), operator=(), and ProcessInput().
| void WsfRouteNetwork::Append | ( | const RoutePoint & | aPoint, |
| WsfRoute & | aRoute ) |
References WsfRoute::Append(), d2, WsfRoute::Empty(), WsfWaypoint::GetDistanceAlongRoute(), WsfWaypoint::GetLat(), WsfWaypoint::GetLon(), WsfRoute::GetWaypointAt(), WsfRoute::GetWaypoints(), WsfRouteNetwork::RoutePoint::mDistanceAlongSegment, WsfRouteNetwork::RoutePoint::mWaypointAddr, WsfWaypoint::SetLat(), and WsfWaypoint::SetLon().
Referenced by AppendShortestPathOnNetwork(), and AppendSubroute().
| bool WsfRouteNetwork::AppendShortestPathOnNetwork | ( | RoutePoint | aPoint1, |
| RoutePoint | aPoint2, | ||
| WsfRoute & | aPath ) |
References Append(), AppendSubroute(), cSTART_NODE_ID, cSTOP_NODE_ID, GetAdjacentNodeIndices(), WsfWaypoint::GetDistanceAlongRoute(), WsfWaypoint::GetNodeId(), WsfWaypoint::GetPositionInRoute(), WsfWaypoint::GetRouteId(), WsfRouteNetwork::RouteEdge::mDistance, WsfRouteNetwork::RoutePoint::mDistanceAlongSegment, WsfRouteNetwork::RouteNode::mSegmentNode, WsfRouteNetwork::RoutePoint::mWaypointAddr, WsfRouteNetwork::RouteNode::mWaypoints, ok, WsfRouteNetwork::RoutePoint::RouteIndex(), and WsfRouteNetwork::RoutePoint::WaypointIndex().
Referenced by GeneratePathBetweenClosestSegments(), GenerateShortestPathBetweenWaypoints(), and operator=().
| void WsfRouteNetwork::AppendSubroute | ( | const RoutePoint & | aPoint1, |
| const RoutePoint & | aPoint2, | ||
| WsfRoute & | aRoute ) |
Append a sub-route between aPoint1 and aPoint2, which share the same route.
References WsfRoute::Append(), Append(), WsfRouteNetwork::RoutePoint::mDistanceAlongSegment, WsfRouteNetwork::RoutePoint::RouteIndex(), and WsfRouteNetwork::RoutePoint::WaypointIndex().
Referenced by AppendShortestPathOnNetwork().
| void WsfRouteNetwork::BuildQuadtree | ( | ) |
Referenced by Initialize(), and RouteCostFunc.
|
overridevirtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements WsfObject.
References WsfRouteNetwork().
|
inlinestatic |
|
static |
Create the 'class' object for the script system. This is invoked once by WsfScriptManager to create the 'class' object that defines the interface to instances of this class from the script system.
Referenced by operator=(), and WsfScriptManager::RegisterTypes().
| bool WsfRouteNetwork::FindClosestSegment | ( | double | aLat, |
| double | aLon, | ||
| RoutePoint & | aProjectedPoint, | ||
| double & | aDistanceToSegment ) |
| bool WsfRouteNetwork::FindClosestWaypoint | ( | double | aLat, |
| double | aLon, | ||
| WsfWaypoint & | aWpt, | ||
| double & | aDistance ) |
Returns the closest waypoint relative to the provided latitude and longitude.
References Initialize().
Referenced by GeneratePathBetweenClosestWaypoints(), and operator=().
| bool WsfRouteNetwork::GeneratePathBetweenClosestSegments | ( | double | aStartLat, |
| double | aStartLon, | ||
| double | aEndLat, | ||
| double | aEndLon, | ||
| WsfRoute & | aPath, | ||
| bool | aLeaveRouteNetwork = true ) |
Creates the following path: ShortestPath(Wpt1, Wpt2) where, Wpt1 - the closest waypoint or segment normal projection to (aStartLat, aStartLon) Wpt2 - the closest waypoint or segment normal projection to (aEndLat, aEndLon) ShortestPath(Wpt1, Wpt2) - the shortest path between Wpt1 to Wpt2 including both Wpt1 and Wpt2. If aLeaveRouteNetwork is true, the mover will go to the specified aEndLat/aEndLon after reaching the closest point on the route network.
References WsfRoute::Append(), AppendShortestPathOnNetwork(), WsfRoute::Clear(), FindClosestSegment(), Initialize(), WsfWaypoint::SetLat(), and WsfWaypoint::SetLon().
Referenced by WsfRoadMover::CreateRoute(), and operator=().
| bool WsfRouteNetwork::GeneratePathBetweenClosestWaypoints | ( | double | aStartLat, |
| double | aStartLon, | ||
| double | aEndLat, | ||
| double | aEndLon, | ||
| WsfRoute & | aPath ) |
Creates the following path: ShortestPath(Wpt1, Wpt2) where, Wpt1 - the closest waypoint to (aStartLat, aStartLon) Wpt2 - the closest waypoint to (aEndLat, aEndLon) ShortestPath(Wpt1, Wpt2) - the shortest path between Wpt1 to Wpt2 including both Wpt1 and Wpt2.
References WsfRoute::Clear(), FindClosestWaypoint(), and GenerateShortestPathBetweenWaypoints().
Referenced by WsfRoadMover::CreateRoute(), GeneratePathOffRouteToRoute(), and operator=().
| bool WsfRouteNetwork::GeneratePathOffRouteToRoute | ( | double | aStartLat, |
| double | aStartLon, | ||
| double | aEndLat, | ||
| double | aEndLon, | ||
| WsfRoute & | aPath ) |
Creates the following path: (aStartLat, aStartLon) -> ShortestPath(Wpt1, Wpt2) -> (aEndLat, aEndLon) where, Wpt1 - the closest waypoint to (aStartLat, aStartLon) Wpt2 - the closest waypoint to (aEndLat, aEndLon) ShortestPath(Wpt1, Wpt2) - the shortest path between Wpt1 to Wpt2 including both Wpt1 and Wpt2.
References WsfRoute::Append(), WsfRoute::Clear(), WsfRoute::Empty(), GeneratePathBetweenClosestWaypoints(), WsfRoute::GetSize(), WsfWaypoint::SetLat(), and WsfWaypoint::SetLon().
Referenced by operator=().
| bool WsfRouteNetwork::GenerateShortestPathBetweenWaypoints | ( | const WsfWaypoint & | aFromWaypoint, |
| const WsfWaypoint & | aToWaypoint, | ||
| WsfRoute & | aPath ) |
References AppendShortestPathOnNetwork(), WsfRoute::Clear(), WsfRoute::FindWaypointIndex(), and WsfWaypoint::GetRouteId().
Referenced by GeneratePathBetweenClosestWaypoints(), and operator=().
| int WsfRouteNetwork::GetAdjacentNodeIndices | ( | const RoutePoint & | aPoint, |
| int * | aIndices ) |
|
inline |
|
inline |
| std::vector< const WsfRoute * > WsfRouteNetwork::GetRoutes | ( | ) | const |
Returns the list of routes in the route network.
Referenced by UT_DEFINE_SCRIPT_METHOD().
| bool WsfRouteNetwork::Initialize | ( | ) |
References BuildQuadtree().
Referenced by FindClosestSegment(), FindClosestWaypoint(), GeneratePathBetweenClosestSegments(), and operator=().
|
delete |
| WsfRoute & WsfRouteNetwork::operator[] | ( | unsigned int | aIndex | ) |
Return a reference to the route by index in the network.
|
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 Add(), WsfScenario::FromInput(), WsfRouteTypes::Get(), and WsfObject::GetName().
|
friend |
References BuildQuadtree().
| WsfStringId WsfRouteNetwork::cSTART_NODE_ID |
Referenced by Add(), AppendShortestPathOnNetwork(), WsfRouteNetwork(), and WsfRouteNetwork().
| WsfStringId WsfRouteNetwork::cSTOP_NODE_ID |
Referenced by Add(), AppendShortestPathOnNetwork(), WsfRouteNetwork(), and WsfRouteNetwork().