23 #include <boost/graph/adjacency_list.hpp>
24 #include <boost/graph/properties.hpp>
25 #include <boost/graph/graph_traits.hpp>
26 #include <boost/function.hpp>
27 #include <boost/unordered_set.hpp>
29 #include <tbb/queuing_mutex.h>
30 #include <tbb/queuing_rw_mutex.h>
31 #include <tbb/atomic.h>
32 #include <tbb/compat/condition_variable>
33 #include <tbb/mutex.h>
38 namespace MAKVRinTerra
40 class DtAStarGraphDebugger;
46 explicit VertexInfo(
const DtPoint& point);
64 bool isOneway()
const;
65 bool isDeleted()
const;
75 boost::shared_ptr<Data>
myData;
81 class BoostGraphVisitor;
82 friend class BoostGraphVisitor;
89 typedef boost::shared_ptr<DtAStarGraph>
Ptr;
91 Ptr shared_from_this();
93 typedef boost::adjacency_list<
114 typedef boost::property<boost::edge_weight_t, double>
Weight;
122 typedef std::list<PathVertex>
List;
124 static double Distance(
const List&);
139 typedef std::list<MultiPathVertex>
List;
149 void addPath(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
151 void addPathToEnd(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
163 explicit Path(
const std::string& = std::string());
168 void addPath(
const Path&);
172 bool empty()
const {
return myPathVertices.empty(); }
173 size_t numPaths()
const {
return myPathVertices.size(); }
185 template <
typename T>
201 std::auto_ptr<DtFeatureSet> input,
204 std::string label = std::string());
208 virtual void shutdown();
209 virtual bool isShutdown()
const;
224 double maxSearchRadius,
225 double startProximityThreshold,
226 double stopProximityThreshold,
246 void setMaxSearchRadius(
double radius);
247 void setSearchRadius(
double maxRadius,
double minRadius);
254 Results* results = 0,
255 unsigned recursionLevel = 0);
259 bool onPathFeature(
const DtPoint& location,
double offset = 0.5);
261 std::auto_ptr<DtPathFeatureSet> paths()
const;
277 const DtPoint& startingLocation,
278 const double& searchRadius,
279 bool* dataAvailable = NULL);
281 std::string label()
const;
289 void addFeatureToGraph(
291 bool joinToIntersectingEdges,
292 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
296 void addFeatureToGraph(
298 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
308 bool loadTile(
const DtPoint& localLocation,
double timeout = 0);
311 bool loadTileAndBlock(
313 bool loadTileAndBlock(
327 boost::shared_ptr<DtPathFeature> path,
328 unsigned& numAddedEdges,
unsigned& numDuplicates);
338 const double tolerance,
347 std::auto_ptr<DtFeatureSet> input,
366 struct GridTile :
public boost::enable_shared_from_this<GridTile>
375 size_t operator()(
const EdgeRecord& edge)
const;
444 bool loaded(
double timeout)
const;
451 enum State { None, Loading, Done, Error };
454 typedef tbb::queuing_rw_mutex
Mutex;
462 boost::shared_ptr<GridTile> mySubtiles[2][2];
485 template <
typename T>
504 for (
size_t i=0; i !=
size; ++i)
516 while (index >=
size())
524 while (index >=
size())
545 template <
typename T>
557 template <
typename T>
581 const DtPoint& localDestination,
582 double maxSearchRadius,
583 double startProximityThreshold,
584 double stopProximityThreshold,
Represents a set of DtFeature objects or others which conform to the DtFeature concept.
Definition: featureSet.h:101
Concrete job class which manages a weak pointer to it's job map entry. Using this job will require th...
Definition: asyncJob.h:92
double startProximityThreshold
Definition: aStarGraph.h:237
State
Definition: aStarGraph.h:451
GraphTraits::edge_iterator edge_iterator
Definition: aStarGraph.h:109
#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:392
DtFeatureGeometry::Point endPoint
Definition: aStarGraph.h:235
Class DtTerrainInterfaceConfig is a readable-writable class holding terrain interface configuration o...
Definition: terrainInterfaceConfig.h:32
boost::graph_traits< DtBoostGraph > GraphTraits
Definition: aStarGraph.h:103
Definition: aStarGraph.h:575
DtFeatureGeometry::Point startPoint
Definition: aStarGraph.h:234
boost::function< void()> DetachCallback
Callback type for disconnecting other callbacks. Functions which register callbacks return a DetachCa...
Definition: featureSet.h:125
FeaturePtr addFeatureRef(const Feature &f)
Definition: featureSetUtils.h:308
DtAStarGraph & myAStarGraph
Definition: aStarGraph.h:446
boost::shared_ptr< Sequence > myValues
Definition: aStarGraph.h:542
int myDebuggingGraphicIndex
For debugging output.
Definition: aStarGraph.h:482
Definition: aStarGraph.h:54
tbb::atomic< bool > myShutdownFlag
Definition: aStarGraph.h:477
tbb::atomic< State > myState
Definition: aStarGraph.h:452
std::list< PathVertex > List
Definition: aStarGraph.h:122
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:197
DtBoostGraph myGraph
Boost graph for path planning.
Definition: aStarGraph.h:364
std::vector< Path > Sequence
Definition: aStarGraph.h:161
boost::lvalue_property_map_tag category
Definition: aStarGraph.h:496
DynamicPropertyMap(T def, size_t size=0)
Definition: aStarGraph.h:508
DtFeatureSet::DetachCallback myDetacherCallbackFn
Definition: aStarGraph.h:461
DtFeatureSetWrapper< DtFeatureSet, boost::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:459
std::vector< TilePtr > TilePtrVector
Definition: aStarGraph.h:369
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:558
Vertex data passed back from makePath. location is the location of the current vertex in local coordi...
Definition: aStarGraph.h:120
tbb::mutex LoadingMutex
Definition: aStarGraph.h:448
voidpf void uLong size
Definition: ioapi.h:39
GraphTraits::vertex_iterator vertex_iterator
Definition: aStarGraph.h:108
FeaturePtr addFeature(Feature *f)
these functions make it easier to take the address of addFeature
Definition: featureSetUtils.h:306
tbb::queuing_rw_mutex GraphMutex
Definition: aStarGraph.h:358
double stopProximityThreshold
Definition: aStarGraph.h:238
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
MultiPathVertex::List myPathVertices
Definition: aStarGraph.h:181
boost::shared_ptr< DtAStarGraph > Ptr
Definition: aStarGraph.h:89
Mutex myEdgesMutex
Definition: aStarGraph.h:464
List nextVertices
Definition: aStarGraph.h:155
Definition: featureGeometry.h:60
Mutex myMutex
Definition: aStarGraph.h:456
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:60
DtProj::CPtr myLocalProj
For converting local coordinates passed in from the user.
Definition: aStarGraph.h:356
Definition: aStarGraph.h:79
boost::function< bool()> CancelCheck
Definition: aStarGraph.h:195
GridTile::TilePtr myLoadedTiles
Points to one top-level (level = 0) tile. This tile will have 4 subtiles, one for each quadrant...
Definition: aStarGraph.h:473
double myStartProximityThreshold
Definition: aStarGraph.h:595
std::list< DtWeightFactor > DtWeightFactorsList
Definition: aStarGraph.h:191
Entry for a feature set in the debugger.
Definition: featuresDebugger.h:55
edge_descriptor myEdgeDescriptor
Definition: aStarGraph.h:380
const unsigned myLevel
Definition: aStarGraph.h:391
size_t size() const
Definition: aStarGraph.h:530
std::list< vertex_descriptor > VertexList
Definition: aStarGraph.h:111
boost::shared_ptr< GridTile > TilePtr
Definition: aStarGraph.h:368
MAKVRinTerra::DtAStarGraph::Path path
Definition: aStarGraph.h:572
DtPoint localLocation
Definition: aStarGraph.h:131
std::string description() const
Definition: aStarGraph.h:175
DtWeightFactorsList weightFactors
Definition: aStarGraph.h:239
DtTerrainInterfaceConfig myTerrainInterfaceConfig
Definition: aStarGraph.h:475
std::string myLabel
Definition: aStarGraph.h:479
Handle< PointType > Point
Definition: featureGeometry.h:69
Definition: aStarGraph.h:158
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
EdgeSet myEdgeSet
Definition: aStarGraph.h:465
Sequence::reference reference
Definition: aStarGraph.h:495
boost::shared_ptr< const DtPathFeature > CPtr
Definition: pathFeature.h:21
DtPoint myLocalStart
Definition: aStarGraph.h:592
Definition: aStarGraph.h:43
Definition: aStarGraph.h:371
Definition: aStarGraph.h:366
A MultiPathVertex is a PathVertex with a list of next vertices.
Definition: aStarGraph.h:137
DefaultFactory myDefaultFactory
Definition: aStarGraph.h:541
MultiPathVertex::List & pathVertices()
Definition: aStarGraph.h:178
boost::shared_ptr< const DtProj > CPtr
Definition: proj.h:48
Handle< PathType > Path
Definition: featureGeometry.h:70
DtBoostGraph::edge_descriptor edge_descriptor
Definition: aStarGraph.h:106
size_t key_type
Definition: aStarGraph.h:493
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:569
DtPathFeature::CPtr nextEdgeFeature
Definition: aStarGraph.h:133
boost::optional< DtFeatureGeometry::Area > searchArea
Definition: aStarGraph.h:236
std::vector< DtPathFeature::CPtr > FeatureVector
Definition: aStarGraph.h:59
DtPoint myLocalDestination
Definition: aStarGraph.h:593
void clear()
Definition: aStarGraph.h:535
EdgeInfo myEdgeInfo
Definition: aStarGraph.h:381
LoadingMutex myLoadingMutex
Definition: aStarGraph.h:450
Definition: pathFeature.h:106
double myStopProximityThreshold
Definition: aStarGraph.h:596
boost::function< T(size_t)> DefaultFactory
Definition: aStarGraph.h:498
Definition: pathFeature.h:17
const MultiPathVertex::List & pathVertices() const
Definition: aStarGraph.h:177
const DtProj::Bounds myBounds
Definition: aStarGraph.h:390
double myMaxSearchRadius
Definition: aStarGraph.h:594
DynamicPropertyMap(const DefaultFactory &def, size_t size=0)
Definition: aStarGraph.h:500
boost::shared_ptr< Data > myData
Definition: aStarGraph.h:73
Source feature sets are used to create your own feature sets with your own features.
Definition: featureSetUtils.h:286
std::vector< EdgeRecord > EdgeSet
fixme change to unordered set
Definition: aStarGraph.h:387
boost::function< double(edge_descriptor)> EdgeWeightAdjustor
Definition: aStarGraph.h:193
boost::scoped_ptr< DtFeatureSet > myInputFeatureSet
Feature source for this graph.
Definition: aStarGraph.h:353
DynamicPropertyMap< unsigned > VertexBoolMap
Definition: aStarGraph.h:186
GraphMutex myGraphMutex
Synchronize access to boost graph.
Definition: aStarGraph.h:361
const DtFeatureGeometry::Area myBoundsGeometry
Definition: aStarGraph.h:393
DtPoint location
Definition: aStarGraph.h:48
T & operator[](size_t index)
Definition: aStarGraph.h:514
Sequence::value_type value_type
Definition: aStarGraph.h:494
tbb::queuing_rw_mutex Mutex
Definition: aStarGraph.h:454
vertex_descriptor vertex
Definition: aStarGraph.h:132
PathVertex pathVertex
Definition: aStarGraph.h:154
T & operator[](size_t index) const
Definition: aStarGraph.h:522
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:37
Definition: aStarGraph.h:232
bool empty() const
Definition: aStarGraph.h:172
Definition: featuresDebugger.h:33
std::list< MultiPathVertex > List
Definition: aStarGraph.h:139
voidpf uLong offset
Definition: ioapi.h:42
std::pair< DtQuery, double > DtWeightFactor
Definition: aStarGraph.h:190
Definition: aStarGraph.h:373
DtAStarGraph::Ptr myPathFinder
Definition: aStarGraph.h:591
std::string myDescription
Definition: aStarGraph.h:182
std::vector< T > Sequence
Definition: aStarGraph.h:488
static T CreateDefault(T def, size_t)
Definition: aStarGraph.h:490
Represents a feature geometry.
Definition: featureGeometry.h:39
size_t numPaths() const
Definition: aStarGraph.h:173
DtAStarGraph::DtWeightFactorsList myWeightFactors
Definition: aStarGraph.h:597
boost::property< boost::edge_weight_t, double > Weight
Definition: aStarGraph.h:114
CancelCheck cancelCheck
Definition: aStarGraph.h:240
boost::adjacency_list< boost::setS, boost::vecS, boost::directedS, VertexInfo, EdgeInfo, boost::no_property, boost::vecS > DtBoostGraph
Definition: aStarGraph.h:101
Definition: aStarGraph.h:186
DtBoostGraph::vertex_descriptor vertex_descriptor
Definition: aStarGraph.h:105