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);
65 bool isOneway()
const;
66 bool isDeleted()
const;
76 std::shared_ptr<Data>
myData;
88 class BoostGraphVisitor;
89 friend class BoostGraphVisitor;
96 typedef std::shared_ptr<DtAStarGraph>
Ptr;
98 Ptr shared_from_this();
100 typedef boost::adjacency_list<
123 typedef boost::property<boost::edge_weight_t, double>
Weight;
134 typedef std::list<PathVertex>
List;
138 static double Distance(
const List&);
159 typedef std::list<MultiPathVertex>
List;
172 void addPath(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
176 void addPathToEnd(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
190 explicit Path(
const std::string& = std::string());
206 void addPath(
const Path& pathCollection);
210 bool empty()
const {
return myPathVertices.empty(); }
211 size_t numPaths()
const {
return myPathVertices.size(); }
223 template <
typename T>
246 std::unique_ptr<DtFeatureSet> input,
249 std::string label = std::string());
253 virtual void shutdown();
254 virtual bool isShutdown()
const;
257 virtual bool cancel()
const;
278 double maxSearchRadius,
279 double startProximityThreshold,
280 double stopProximityThreshold,
283 const double offRoadPathWeight = 10.0);
317 void setMaxSearchRadius(
double radius);
318 void setSearchRadius(
double maxRadius,
double minRadius);
325 Results* results = 0,
326 unsigned recursionLevel = 0);
330 bool onPathFeature(
const DtPoint& location,
double offset = 0.5);
332 std::unique_ptr<DtPathFeatureSet> paths()
const;
347 const DtPoint& startingLocation,
const double& searchRadius,
bool* dataAvailable = NULL);
349 virtual std::string label()
const override;
356 void addFeatureToGraph(
358 bool joinToIntersectingEdges,
359 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
363 void addFeatureToGraph(
365 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
375 bool loadTile(
const DtPoint& localLocation,
double timeout = 0);
377 bool loadTileAndBlock(
379 bool loadTileAndBlock(
393 std::shared_ptr<DtPathFeature> path,
394 unsigned& numAddedEdges,
unsigned& numDuplicates);
404 const double tolerance,
411 std::unique_ptr<DtFeatureSet> input,
433 struct GridTile :
public std::enable_shared_from_this<GridTile>
442 size_t operator()(
const EdgeRecord& edge)
const;
513 bool loaded(
double timeout)
const;
520 enum State { None, Loading, Done, Error };
523 typedef tbb::queuing_rw_mutex
Mutex;
531 std::shared_ptr<GridTile> mySubtiles[2][2];
562 template <
typename T>
581 for (
size_t i=0; i !=
size; ++i)
593 while (index >=
size())
601 while (index >=
size())
623 template <
typename T>
636 template <
typename T>
658 double maxSearchRadius,
double startProximityThreshold,
double stopProximityThreshold,
661 virtual void onExecute()
override;
662 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:295
State
Definition: aStarGraph.h:520
GraphTraits::edge_iterator edge_iterator
Definition: aStarGraph.h:118
#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:458
DtFeatureGeometry::Point endPoint
Definition: aStarGraph.h:291
Class DtTerrainInterfaceConfig is a readable-writable class holding terrain interface configuration o...
Definition: terrainInterfaceConfig.h:33
boost::graph_traits< DtBoostGraph > GraphTraits
Definition: aStarGraph.h:110
Definition: aStarGraph.h:654
DtFeatureGeometry::Point startPoint
Definition: aStarGraph.h:290
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks. Functions which register callbacks return a DetachCa...
Definition: featureSet.h:132
FeaturePtr addFeatureRef(const Feature &f)
Definition: featureSetUtils.h:311
DtAStarGraph & myAStarGraph
Definition: aStarGraph.h:515
int myDebuggingGraphicIndex
For debugging output.
Definition: aStarGraph.h:551
std::shared_ptr< const DtProj > CPtr
Definition: proj.h:56
Definition: aStarGraph.h:55
std::list< PathVertex > List
Definition: aStarGraph.h:134
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:194
DtBoostGraph myGraph
Boost graph for path planning.
Definition: aStarGraph.h:430
std::vector< Path > Sequence
Definition: aStarGraph.h:188
boost::lvalue_property_map_tag category
Definition: aStarGraph.h:573
DynamicPropertyMap(T def, size_t size=0)
Definition: aStarGraph.h:585
DtFeatureSet::DetachCallback myDetacherCallbackFn
Definition: aStarGraph.h:530
std::vector< TilePtr > TilePtrVector
Definition: aStarGraph.h:436
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:637
Vertex data passed back from makePath. location is the location of the current vertex in local coordi...
Definition: aStarGraph.h:132
DtRailSegment are segments entities can follow when using the rail movement system.
Definition: railSegment.h:20
tbb::mutex LoadingMutex
Definition: aStarGraph.h:517
voidpf void uLong size
Definition: ioapi.h:39
GraphTraits::vertex_iterator vertex_iterator
Definition: aStarGraph.h:117
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:424
double stopProximityThreshold
The radius to the destination location within which the graph search must end to be successful...
Definition: aStarGraph.h:299
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
MultiPathVertex::List myPathVertices
Definition: aStarGraph.h:219
std::atomic< State > myState
Definition: aStarGraph.h:521
Mutex myEdgesMutex
Definition: aStarGraph.h:533
double minOffFeatureDistanceToDestination
The closest distance to the destination at which the closest feature is found. The remaining path to ...
Definition: aStarGraph.h:305
List nextVertices
Definition: aStarGraph.h:181
Definition: featureGeometry.h:61
Mutex myMutex
Definition: aStarGraph.h:525
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
DtProj::CPtr myLocalProj
For converting local coordinates passed in from the user.
Definition: aStarGraph.h:422
Definition: aStarGraph.h:86
boost::function< bool()> CancelCheck
Definition: aStarGraph.h:233
GridTile::TilePtr myLoadedTiles
Points to one top-level (level = 0) tile. This tile will have 4 subtiles, one for each quadrant...
Definition: aStarGraph.h:542
double myStartProximityThreshold
Definition: aStarGraph.h:669
std::list< DtWeightFactor > DtWeightFactorsList
Definition: aStarGraph.h:229
Entry for a feature set in the debugger.
Definition: featuresDebugger.h:55
edge_descriptor myEdgeDescriptor
Definition: aStarGraph.h:447
const unsigned myLevel
Definition: aStarGraph.h:457
size_t size() const
Definition: aStarGraph.h:607
double myOffRoadPathWeight
Definition: aStarGraph.h:672
std::list< vertex_descriptor > VertexList
Definition: aStarGraph.h:120
MAKVRinTerra::DtAStarGraph::Path path
Definition: aStarGraph.h:651
DtPoint localLocation
Definition: aStarGraph.h:145
std::string description() const
Definition: aStarGraph.h:213
DtWeightFactorsList weightFactors
Definition: aStarGraph.h:306
DtTerrainInterfaceConfig myTerrainInterfaceConfig
Definition: aStarGraph.h:544
std::string myLabel
Definition: aStarGraph.h:548
std::atomic< bool > myShutdownFlag
Definition: aStarGraph.h:546
Handle< PointType > Point
Definition: featureGeometry.h:70
This is actually a collection of paths, i.e. vectors of points.
Definition: aStarGraph.h:185
EdgeSet myEdgeSet
Definition: aStarGraph.h:534
Sequence::reference reference
Definition: aStarGraph.h:572
DtPoint myLocalStart
Definition: aStarGraph.h:666
Definition: aStarGraph.h:44
const std::unique_ptr< DtFeatureSet > myInputFeatureSet
Feature source for this graph.
Definition: aStarGraph.h:417
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:528
Definition: aStarGraph.h:438
A rectangular area of the world with feature edges from the input feature set.
Definition: aStarGraph.h:433
A MultiPathVertex is a PathVertex with a list of next vertices. (dreece: This seems to be a branching...
Definition: aStarGraph.h:157
DefaultFactory myDefaultFactory
Definition: aStarGraph.h:618
double offRoadPathWeight
Definition: aStarGraph.h:307
MultiPathVertex::List & pathVertices()
Definition: aStarGraph.h:216
Handle< PathType > Path
Definition: featureGeometry.h:71
std::shared_ptr< DtAStarGraph > Ptr
Definition: aStarGraph.h:96
DtBoostGraph::edge_descriptor edge_descriptor
Definition: aStarGraph.h:115
size_t key_type
Definition: aStarGraph.h:570
double directPathCost
A computed parameter. The cost (offroad weight * start-to-end distance) of going directly to the dest...
Definition: aStarGraph.h:311
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:648
DtPathFeature::CPtr nextEdgeFeature
Definition: aStarGraph.h:147
boost::optional< DtFeatureGeometry::Area > searchArea
Definition: aStarGraph.h:292
std::shared_ptr< Data > myData
Definition: aStarGraph.h:74
std::vector< DtPathFeature::CPtr > FeatureVector
Definition: aStarGraph.h:60
DtPoint myLocalDestination
Definition: aStarGraph.h:667
void clear()
Definition: aStarGraph.h:612
EdgeInfo myEdgeInfo
Definition: aStarGraph.h:448
LoadingMutex myLoadingMutex
Definition: aStarGraph.h:519
std::shared_ptr< const DtPathFeature > CPtr
Definition: pathFeature.h:21
Definition: pathFeature.h:99
double myStopProximityThreshold
Definition: aStarGraph.h:670
boost::function< T(size_t)> DefaultFactory
Definition: aStarGraph.h:575
Definition: pathFeature.h:17
const MultiPathVertex::List & pathVertices() const
Definition: aStarGraph.h:215
const DtProj::Bounds myBounds
Bounds define the extent of this tile.
Definition: aStarGraph.h:461
double myMaxSearchRadius
Definition: aStarGraph.h:668
DynamicPropertyMap(const DefaultFactory &def, size_t size=0)
Definition: aStarGraph.h:577
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
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:454
boost::function< double(edge_descriptor)> EdgeWeightAdjustor
Definition: aStarGraph.h:231
DynamicPropertyMap< unsigned > VertexBoolMap
Definition: aStarGraph.h:224
GraphMutex myGraphMutex
Synchronize access to boost graph.
Definition: aStarGraph.h:427
const DtFeatureGeometry::Area myBoundsGeometry
Definition: aStarGraph.h:462
DtPoint location
Definition: aStarGraph.h:49
T & operator[](size_t index)
Definition: aStarGraph.h:591
Sequence::value_type value_type
Definition: aStarGraph.h:571
tbb::queuing_rw_mutex Mutex
Definition: aStarGraph.h:523
vertex_descriptor vertex
Definition: aStarGraph.h:146
PathVertex pathVertex
Definition: aStarGraph.h:180
T & operator[](size_t index) const
Definition: aStarGraph.h:599
std::shared_ptr< GridTile > TilePtr
Definition: aStarGraph.h:435
CancelCheck myCancelCheck
Definition: aStarGraph.h:553
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:288
bool empty() const
Definition: aStarGraph.h:210
Definition: featuresDebugger.h:33
std::list< MultiPathVertex > List
Definition: aStarGraph.h:159
std::shared_ptr< Sequence > myValues
Definition: aStarGraph.h:619
voidpf uLong offset
Definition: ioapi.h:42
std::pair< DtQuery, double > DtWeightFactor
Definition: aStarGraph.h:228
Definition: aStarGraph.h:440
DtAStarGraph::Ptr myPathFinder
Definition: aStarGraph.h:665
std::string myDescription
Definition: aStarGraph.h:220
std::vector< T > Sequence
Definition: aStarGraph.h:565
static T CreateDefault(T def, size_t)
Definition: aStarGraph.h:567
Represents a feature geometry.
Definition: featureGeometry.h:40
size_t numPaths() const
Definition: aStarGraph.h:211
DtAStarGraph::DtWeightFactorsList myWeightFactors
Definition: aStarGraph.h:671
boost::property< boost::edge_weight_t, double > Weight
Definition: aStarGraph.h:123
CancelCheck cancelCheck
Definition: aStarGraph.h:308
boost::adjacency_list< boost::setS, boost::vecS, boost::directedS, VertexInfo, EdgeInfo, boost::no_property, boost::vecS > DtBoostGraph
Definition: aStarGraph.h:108
DtAStarGraph.
Definition: aStarGraph.h:224
DtBoostGraph::vertex_descriptor vertex_descriptor
Note that this is an integer, and can be printed with d.
Definition: aStarGraph.h:113