25 #include <boost/graph/adjacency_list.hpp>
26 #include <boost/graph/properties.hpp>
27 #include <boost/graph/graph_traits.hpp>
28 #include <boost/function.hpp>
30 #include <tbb/queuing_mutex.h>
31 #include <tbb/queuing_rw_mutex.h>
33 #include <tbb/mutex.h>
39 namespace MAKVRinTerra
41 class DtAStarGraphDebugger;
47 explicit VertexInfo(
const DtPoint& point);
66 bool isOneway()
const;
67 bool isDeleted()
const;
77 std::shared_ptr<Data>
myData;
91 class BoostGraphVisitor;
92 friend class BoostGraphVisitor;
99 typedef std::shared_ptr<DtAStarGraph>
Ptr;
101 Ptr shared_from_this();
103 typedef boost::adjacency_list<
126 typedef boost::property<boost::edge_weight_t, double>
Weight;
156 std::string printString()
const;
196 void addBranch(PathVertexData::VertexList::const_iterator, PathVertexData::VertexList::const_iterator);
205 void addPathToEndOfEachBranch(PathVertexData::VertexList::const_iterator, PathVertexData::VertexList::const_iterator);
226 explicit PathList(
const std::string& = std::string());
242 void addPath(
const PathList& pathCollection);
247 bool empty()
const {
return myPathCollection.empty(); }
248 size_t numPaths()
const {
return myPathCollection.size(); }
262 template <
typename T>
285 std::unique_ptr<DtFeatureSet> input,
288 std::string label = std::string());
292 virtual void shutdown();
293 virtual bool isShutdown()
const;
296 virtual bool cancel()
const;
320 double maxSearchRadius,
321 double startProximityThreshold,
322 double stopProximityThreshold,
325 const double offRoadPathWeight = 10.0);
359 void setMaxSearchRadius(
double radius);
360 void setSearchRadius(
double maxRadius,
double minRadius);
367 Results* results = 0,
368 unsigned recursionLevel = 0);
374 bool onPathFeature(
const DtPoint& location,
double offset = 0.5);
376 std::unique_ptr<DtPathFeatureSet> paths()
const;
391 const DtPoint& startingLocation,
const double& searchRadius,
bool* dataAvailable = NULL);
393 virtual std::string label()
const override;
400 void addFeatureToGraph(
402 bool joinToIntersectingEdges,
403 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
407 void addFeatureToGraph(
409 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
419 bool loadTile(
const DtPoint& localLocation,
double timeout = 0);
421 bool loadTileAndBlock(
423 bool loadTileAndBlock(
437 std::shared_ptr<DtPathFeature> path,
438 unsigned& numAddedEdges,
unsigned& numDuplicates);
448 const double tolerance,
455 std::unique_ptr<DtFeatureSet> input,
480 struct GridTile :
public std::enable_shared_from_this<GridTile>
489 size_t operator()(
const EdgeRecord& edge)
const;
560 bool loaded(
double timeout)
const;
567 enum State { None, Loading, Done, Error };
570 typedef tbb::queuing_rw_mutex
Mutex;
578 std::shared_ptr<GridTile> mySubtiles[2][2];
612 template <
typename T>
631 for (
size_t i=0; i !=
size; ++i)
643 while (index >=
size())
651 while (index >=
size())
673 template <
typename T>
686 template <
typename T>
711 double maxSearchRadius,
double startProximityThreshold,
double stopProximityThreshold,
714 virtual void onExecute()
override;
715 virtual void onException()
override;
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:105
Concrete job class which manages a weak pointer to it's job map entry. Using this job will require th...
Definition: asyncJob.h:89
double startProximityThreshold
The radius from the start point within which the feature data will be searched for a start feature...
Definition: aStarGraph.h:337
State
Definition: aStarGraph.h:567
GraphTraits::edge_iterator edge_iterator
Definition: aStarGraph.h:121
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
const unsigned myMaxLevel
Definition: aStarGraph.h:505
bool empty() const
Definition: aStarGraph.h:247
DtFeatureGeometry::Point endPoint
Definition: aStarGraph.h:333
Class DtTerrainInterfaceConfig is a readable-writable class holding terrain interface configuration o...
Definition: terrainInterfaceConfig.h:33
boost::graph_traits< DtBoostGraph > GraphTraits
Definition: aStarGraph.h:113
PathVertexData vertexData
Definition: aStarGraph.h:209
The asynchronous job for making a path. The parameters for the path search are passed in the construc...
Definition: aStarGraph.h:707
DtFeatureGeometry::Point startPoint
Definition: aStarGraph.h:332
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks. Functions which register callbacks return a DetachCa...
Definition: featureSet.h:132
double length(const dvec3 &theVec)
Definition: DtVecUtils.h:20
FeaturePtr addFeatureRef(const Feature &f)
Definition: featureSetUtils.h:311
DtAStarGraph & myAStarGraph
Definition: aStarGraph.h:562
int myDebuggingGraphicIndex
For debugging output.
Definition: aStarGraph.h:600
std::shared_ptr< const DtProj > CPtr
Definition: proj.h:56
Properties on each edge in the A* graph. Each edge corresponds to a path feature, and the properties ...
Definition: aStarGraph.h:56
std::vector< PathList > Sequence
Definition: aStarGraph.h:224
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:194
DtBoostGraph myGraph
Boost graph for path planning.
Definition: aStarGraph.h:474
boost::lvalue_property_map_tag category
Definition: aStarGraph.h:623
DynamicPropertyMap(T def, size_t size=0)
Definition: aStarGraph.h:635
DtFeatureSet::DetachCallback myDetacherCallbackFn
Definition: aStarGraph.h:577
MAKVRinTerra::DtAStarGraph::PathList path
Definition: aStarGraph.h:701
std::vector< TilePtr > TilePtrVector
Definition: aStarGraph.h:483
void put(DtAStarGraph::DynamicPropertyMap< T > &map, size_t index, const T &value)
template <typename t>=""> T get(const DtAStarGraph::DynamicPropertyMap<T>* map, size_t index) { retur...
Definition: aStarGraph.h:687
DtRailSegment are segments entities can follow when using the rail movement system.
Definition: railSegment.h:20
tbb::mutex LoadingMutex
Definition: aStarGraph.h:564
voidpf void uLong size
Definition: ioapi.h:39
GraphTraits::vertex_iterator vertex_iterator
Definition: aStarGraph.h:120
FeaturePtr addFeature(Feature *f)
these functions make it easier to take the address of addFeature
Definition: featureSetUtils.h:309
tbb::queuing_rw_mutex GraphMutex
Definition: aStarGraph.h:468
double stopProximityThreshold
The radius to the destination location within which the graph search must end to be successful...
Definition: aStarGraph.h:341
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
std::atomic< State > myState
Definition: aStarGraph.h:568
Mutex myEdgesMutex
Definition: aStarGraph.h:580
double minOffFeatureDistanceToDestination
The closest distance to the destination at which the closest feature is found. The remaining path to ...
Definition: aStarGraph.h:347
Definition: featureGeometry.h:65
Mutex myMutex
Definition: aStarGraph.h:572
virtual FeaturePtr addFeaturePtr(Feature *feature)
These functions are used to add features to the feature sets. The argument is the feature being added...
Definition: featureSet.h:64
SetOfPaths branches
Definition: aStarGraph.h:210
DtProj::CPtr myLocalProj
For converting local coordinates passed in from the user.
Definition: aStarGraph.h:466
DtAStarGraph holds all the classes used to read in feature data tile-wise, create a Boost Graph...
Definition: aStarGraph.h:89
This is the data associated with a vertex of the path returned from makePath (in a Path class...
Definition: aStarGraph.h:146
boost::function< bool()> CancelCheck
Definition: aStarGraph.h:272
GridTile::TilePtr myLoadedTiles
Points to one top-level (level = 0) tile. This tile will have 4 subtiles, one for each quadrant...
Definition: aStarGraph.h:589
double myStartProximityThreshold
Definition: aStarGraph.h:722
std::list< DtWeightFactor > DtWeightFactorsList
Definition: aStarGraph.h:268
Entry for a feature set in the debugger.
Definition: featuresDebugger.h:55
edge_descriptor myEdgeDescriptor
Definition: aStarGraph.h:494
const unsigned myLevel
Definition: aStarGraph.h:504
size_t size() const
Definition: aStarGraph.h:657
double myOffRoadPathWeight
Definition: aStarGraph.h:725
std::list< vertex_descriptor > VertexList
Definition: aStarGraph.h:123
DtWeightFactorsList weightFactors
Definition: aStarGraph.h:348
MultiPathVertex::SetOfPaths & pathVertices()
Definition: aStarGraph.h:253
DtTerrainInterfaceConfig myTerrainInterfaceConfig
Definition: aStarGraph.h:593
std::string myLabel
Definition: aStarGraph.h:597
std::atomic< bool > myShutdownFlag
Definition: aStarGraph.h:595
Handle< PointType > Point
Definition: featureGeometry.h:74
std::string description() const
Definition: aStarGraph.h:250
EdgeSet myEdgeSet
Definition: aStarGraph.h:581
Sequence::reference reference
Definition: aStarGraph.h:622
size_t numPaths() const
Definition: aStarGraph.h:248
DtPoint myLocalStart
Definition: aStarGraph.h:719
Definition: aStarGraph.h:44
const std::unique_ptr< DtFeatureSet > myInputFeatureSet
Feature source for this graph.
Definition: aStarGraph.h:461
DtFeatureSetWrapper< DtFeatureSet, std::shared_ptr > myFeatureSet
A feature set that is the AStarGraph's input feature set, but clipped to the geometry of this tile...
Definition: aStarGraph.h:575
Definition: aStarGraph.h:485
A rectangular area of the world with feature edges from the input feature set.
Definition: aStarGraph.h:480
A MultiPathVertex is vertex with a list of next vertices, thus it is the root of a subtree...
Definition: aStarGraph.h:179
MultiPathVertex::SetOfPaths myPathCollection
Definition: aStarGraph.h:256
DefaultFactory myDefaultFactory
Definition: aStarGraph.h:668
double offRoadPathWeight
Definition: aStarGraph.h:349
Handle< PathType > Path
Definition: featureGeometry.h:75
std::shared_ptr< DtAStarGraph > Ptr
Definition: aStarGraph.h:99
DtBoostGraph::edge_descriptor edge_descriptor
Definition: aStarGraph.h:118
std::list< PathVertexData > VertexList
Definition: aStarGraph.h:148
size_t key_type
Definition: aStarGraph.h:620
double directPathCost
A computed parameter. The cost (offroad weight * start-to-end distance) of going directly to the dest...
Definition: aStarGraph.h:353
Base class for result of job.
Definition: asyncJobServer.h:43
template <typename t>=""> void put(DtAStarGraph::DynamicPropertyMap<T>* map, size_t index...
Definition: aStarGraph.h:698
boost::optional< DtFeatureGeometry::Area > searchArea
Definition: aStarGraph.h:334
std::shared_ptr< Data > myData
Definition: aStarGraph.h:75
std::vector< DtPathFeature::CPtr > FeatureVector
Definition: aStarGraph.h:61
DtPoint myLocalDestination
Definition: aStarGraph.h:720
void clear()
Definition: aStarGraph.h:662
EdgeInfo myEdgeInfo
Definition: aStarGraph.h:495
LoadingMutex myLoadingMutex
Definition: aStarGraph.h:566
std::shared_ptr< const DtPathFeature > CPtr
Definition: pathFeature.h:21
DtPathFeature::CPtr nextEdgeFeature
Definition: aStarGraph.h:165
Definition: pathFeature.h:99
double myStopProximityThreshold
Definition: aStarGraph.h:723
boost::function< T(size_t)> DefaultFactory
Definition: aStarGraph.h:625
Definition: pathFeature.h:17
const DtProj::Bounds myBounds
Bounds define the extent of this tile.
Definition: aStarGraph.h:508
double myMaxSearchRadius
Definition: aStarGraph.h:721
DtPoint localLocation
Definition: aStarGraph.h:163
DynamicPropertyMap(const DefaultFactory &def, size_t size=0)
Definition: aStarGraph.h:627
This is the class that is returned from makePath. It contains a collection of independent paths (sequ...
Definition: aStarGraph.h:221
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:287
std::vector< EdgeRecord > EdgeSet
fixme change to unordered set
Definition: aStarGraph.h:501
boost::function< double(edge_descriptor)> EdgeWeightAdjustor
Definition: aStarGraph.h:270
DynamicPropertyMap< unsigned > VertexBoolMap
Definition: aStarGraph.h:263
GraphMutex myGraphMutex
Synchronize access to boost graph.
Definition: aStarGraph.h:471
const DtFeatureGeometry::Area myBoundsGeometry
Definition: aStarGraph.h:509
DtPoint location
Definition: aStarGraph.h:49
T & operator[](size_t index)
Definition: aStarGraph.h:641
Sequence::value_type value_type
Definition: aStarGraph.h:621
tbb::queuing_rw_mutex Mutex
Definition: aStarGraph.h:570
T & operator[](size_t index) const
Definition: aStarGraph.h:649
std::shared_ptr< GridTile > TilePtr
Definition: aStarGraph.h:482
CancelCheck myCancelCheck
Definition: aStarGraph.h:602
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:36
The parameters for the graph search.
Definition: aStarGraph.h:330
Definition: featuresDebugger.h:33
std::shared_ptr< Sequence > myValues
Definition: aStarGraph.h:669
voidpf uLong offset
Definition: ioapi.h:42
std::pair< DtQuery, double > DtWeightFactor
Definition: aStarGraph.h:267
Definition: aStarGraph.h:487
std::list< MultiPathVertex > SetOfPaths
Definition: aStarGraph.h:181
DtAStarGraph::Ptr myPathFinder
Definition: aStarGraph.h:718
std::string myDescription
Definition: aStarGraph.h:257
std::vector< T > Sequence
Definition: aStarGraph.h:615
static T CreateDefault(T def, size_t)
Definition: aStarGraph.h:617
Represents a feature geometry.
Definition: featureGeometry.h:44
DtAStarGraph::DtWeightFactorsList myWeightFactors
Definition: aStarGraph.h:724
boost::property< boost::edge_weight_t, double > Weight
Definition: aStarGraph.h:126
const MultiPathVertex::SetOfPaths & pathVertices() const
Definition: aStarGraph.h:252
vertex_descriptor vertex
Definition: aStarGraph.h:164
CancelCheck cancelCheck
Definition: aStarGraph.h:350
boost::adjacency_list< boost::setS, boost::vecS, boost::directedS, VertexInfo, EdgeInfo, boost::no_property, boost::vecS > DtBoostGraph
Definition: aStarGraph.h:111
This serves as a map from vertex indices to properties of type T. The A* algorithm saves graph search...
Definition: aStarGraph.h:263
DtBoostGraph::vertex_descriptor vertex_descriptor
Note that this is an integer, and can be printed with d.
Definition: aStarGraph.h:116