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&);
138 typedef std::list<MultiPathVertex>
List;
148 void addPath(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
150 void addPathToEnd(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
162 explicit Path(
const std::string& = std::string());
167 void addPath(
const Path&);
171 bool empty()
const {
return myPathVertices.empty(); }
172 size_t numPaths()
const {
return myPathVertices.size(); }
184 template <
typename T>
200 std::auto_ptr<DtFeatureSet> input,
203 std::string label = std::string());
207 virtual void shutdown();
208 virtual bool isShutdown()
const;
223 double maxSearchRadius,
224 double startProximityThreshold,
225 double stopProximityThreshold,
245 void setMaxSearchRadius(
double radius);
246 void setSearchRadius(
double maxRadius,
double minRadius);
253 Results* results = 0,
254 unsigned recursionLevel = 0);
258 bool onPathFeature(
const DtPoint& location,
double offset = 0.5);
260 std::auto_ptr<DtPathFeatureSet> paths()
const;
276 const DtPoint& startingLocation,
277 const double& searchRadius,
278 bool* dataAvailable = NULL);
280 std::string label()
const;
285 void addFeatureToGraph(
287 bool joinToIntersectingEdges,
288 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
290 void addFeatureToGraph(
292 const boost::optional<DtFeatureGeometry>& searchArea = boost::none);
296 bool loadTile(
const DtPoint& localLocation,
double timeout = 0);
298 bool loadTileAndBlock(
300 bool loadTileAndBlock(
305 std::auto_ptr<DtFeatureSet> input,
324 struct GridTile :
public boost::enable_shared_from_this<GridTile>
326 typedef boost::shared_ptr<GridTile>
Ptr;
333 size_t operator()(
const EdgeRecord& edge)
const;
368 bool loaded(
double timeout)
const;
375 enum State { None, Loading, Done, Error };
378 typedef tbb::queuing_rw_mutex
Mutex;
383 boost::shared_ptr<GridTile> subtiles[2][2];
401 template <
typename T>
420 for (
size_t i=0; i !=
size; ++i)
432 while (index >=
size())
440 while (index >=
size())
461 template <
typename T>
473 template <
typename T>
497 const DtPoint& localDestination,
498 double maxSearchRadius,
499 double startProximityThreshold,
500 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:236
State
Definition: aStarGraph.h:375
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
Mutex edgesMutex
Definition: aStarGraph.h:385
DtFeatureGeometry::Point endPoint
Definition: aStarGraph.h:234
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:491
const DtProj::Bounds bounds
Definition: aStarGraph.h:348
DtFeatureGeometry::Point startPoint
Definition: aStarGraph.h:233
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
boost::shared_ptr< Sequence > myValues
Definition: aStarGraph.h:458
Definition: aStarGraph.h:54
tbb::atomic< bool > myShutdownFlag
Definition: aStarGraph.h:396
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:322
Mutex mutex
Definition: aStarGraph.h:380
std::vector< Path > Sequence
Definition: aStarGraph.h:160
boost::lvalue_property_map_tag category
Definition: aStarGraph.h:412
DynamicPropertyMap(T def, size_t size=0)
Definition: aStarGraph.h:424
DtAStarGraph & graph
Definition: aStarGraph.h:370
EdgeSet edges
Definition: aStarGraph.h:386
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:474
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:372
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
edge_descriptor descriptor
Definition: aStarGraph.h:338
tbb::queuing_rw_mutex GraphMutex
Definition: aStarGraph.h:316
double stopProximityThreshold
Definition: aStarGraph.h:237
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
MultiPathVertex::List myPathVertices
Definition: aStarGraph.h:180
boost::shared_ptr< DtAStarGraph > Ptr
Definition: aStarGraph.h:89
List nextVertices
Definition: aStarGraph.h:154
Definition: featureGeometry.h:60
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:314
Definition: aStarGraph.h:79
boost::function< bool()> CancelCheck
Definition: aStarGraph.h:194
double myStartProximityThreshold
Definition: aStarGraph.h:511
std::list< DtWeightFactor > DtWeightFactorsList
Definition: aStarGraph.h:190
Entry for a feature set in the debugger.
Definition: featuresDebugger.h:55
EdgeInfo info
Definition: aStarGraph.h:339
size_t size() const
Definition: aStarGraph.h:446
std::list< vertex_descriptor > VertexList
Definition: aStarGraph.h:111
MAKVRinTerra::DtAStarGraph::Path path
Definition: aStarGraph.h:488
DtPoint localLocation
Definition: aStarGraph.h:131
std::string description() const
Definition: aStarGraph.h:174
DtWeightFactorsList weightFactors
Definition: aStarGraph.h:238
DtTerrainInterfaceConfig myTerrainInterfaceConfig
Definition: aStarGraph.h:394
std::string myLabel
Definition: aStarGraph.h:398
Handle< PointType > Point
Definition: featureGeometry.h:69
Definition: aStarGraph.h:157
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
const unsigned level
Definition: aStarGraph.h:349
Sequence::reference reference
Definition: aStarGraph.h:411
boost::shared_ptr< const DtPathFeature > CPtr
Definition: pathFeature.h:21
DtPoint myLocalStart
Definition: aStarGraph.h:508
Definition: aStarGraph.h:43
Definition: aStarGraph.h:329
Definition: aStarGraph.h:324
Definition: aStarGraph.h:136
boost::shared_ptr< GridTile > Ptr
Definition: aStarGraph.h:326
DefaultFactory myDefaultFactory
Definition: aStarGraph.h:457
MultiPathVertex::List & pathVertices()
Definition: aStarGraph.h:177
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:409
Base class for result of job.
Definition: asyncJobServer.h:43
const unsigned maxLevel
Definition: aStarGraph.h:350
template <typename t>=""> void put(DtAStarGraph::DynamicPropertyMap<T>* map, size_t index...
Definition: aStarGraph.h:485
DtPathFeature::CPtr nextEdgeFeature
Definition: aStarGraph.h:133
boost::optional< DtFeatureGeometry::Area > searchArea
Definition: aStarGraph.h:235
std::vector< Ptr > PtrVector
Definition: aStarGraph.h:327
std::vector< DtPathFeature::CPtr > FeatureVector
Definition: aStarGraph.h:59
DtPoint myLocalDestination
Definition: aStarGraph.h:509
void clear()
Definition: aStarGraph.h:451
LoadingMutex loadingMutex
Definition: aStarGraph.h:374
Definition: pathFeature.h:106
double myStopProximityThreshold
Definition: aStarGraph.h:512
boost::function< T(size_t)> DefaultFactory
Definition: aStarGraph.h:414
Definition: pathFeature.h:17
const MultiPathVertex::List & pathVertices() const
Definition: aStarGraph.h:176
double myMaxSearchRadius
Definition: aStarGraph.h:510
DynamicPropertyMap(const DefaultFactory &def, size_t size=0)
Definition: aStarGraph.h:416
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:345
boost::function< double(edge_descriptor)> EdgeWeightAdjustor
Definition: aStarGraph.h:192
boost::scoped_ptr< DtFeatureSet > myInputFeatureSet
Feature source for this graph.
Definition: aStarGraph.h:311
DynamicPropertyMap< unsigned > VertexBoolMap
Definition: aStarGraph.h:185
const DtFeatureGeometry::Area geometry
Definition: aStarGraph.h:351
GraphMutex myGraphMutex
Synchronize access to boost graph.
Definition: aStarGraph.h:319
DtPoint location
Definition: aStarGraph.h:48
T & operator[](size_t index)
Definition: aStarGraph.h:430
Sequence::value_type value_type
Definition: aStarGraph.h:410
tbb::queuing_rw_mutex Mutex
Definition: aStarGraph.h:378
vertex_descriptor vertex
Definition: aStarGraph.h:132
PathVertex pathVertex
Definition: aStarGraph.h:153
T & operator[](size_t index) const
Definition: aStarGraph.h:438
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:37
Definition: aStarGraph.h:231
bool empty() const
Definition: aStarGraph.h:171
Definition: featuresDebugger.h:33
std::list< MultiPathVertex > List
Definition: aStarGraph.h:138
voidpf uLong offset
Definition: ioapi.h:42
std::pair< DtQuery, double > DtWeightFactor
Definition: aStarGraph.h:189
Definition: aStarGraph.h:331
DtAStarGraph::Ptr myPathFinder
Definition: aStarGraph.h:507
GridTile::Ptr myLoadedTiles
Used to track which tiles are loaded.
Definition: aStarGraph.h:392
std::string myDescription
Definition: aStarGraph.h:181
std::vector< T > Sequence
Definition: aStarGraph.h:404
static T CreateDefault(T def, size_t)
Definition: aStarGraph.h:406
Represents a feature geometry.
Definition: featureGeometry.h:39
size_t numPaths() const
Definition: aStarGraph.h:172
DtAStarGraph::DtWeightFactorsList myWeightFactors
Definition: aStarGraph.h:513
boost::property< boost::edge_weight_t, double > Weight
Definition: aStarGraph.h:114
DtFeatureSetWrapper< DtFeatureSet, boost::shared_ptr > featureSet
Definition: aStarGraph.h:381
DtFeatureSet::DetachCallback detacher
Definition: aStarGraph.h:382
CancelCheck cancelCheck
Definition: aStarGraph.h:239
boost::adjacency_list< boost::setS, boost::vecS, boost::directedS, VertexInfo, EdgeInfo, boost::no_property, boost::vecS > DtBoostGraph
Definition: aStarGraph.h:101
tbb::atomic< State > state
Definition: aStarGraph.h:376
Definition: aStarGraph.h:185
DtBoostGraph::vertex_descriptor vertex_descriptor
Definition: aStarGraph.h:105