24 #include <boost/graph/adjacency_list.hpp>
25 #include <boost/graph/properties.hpp>
26 #include <boost/graph/graph_traits.hpp>
27 #include <boost/function.hpp>
28 #include <boost/unordered_set.hpp>
30 #include <tbb/queuing_mutex.h>
31 #include <tbb/queuing_rw_mutex.h>
32 #include <tbb/atomic.h>
33 #include <tbb/compat/condition_variable>
34 #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 boost::shared_ptr<Data>
myData;
82 class BoostGraphVisitor;
83 friend class BoostGraphVisitor;
85 struct RedrawCallback;
86 friend struct RedrawCallback;
93 typedef boost::shared_ptr<DtAStarGraph>
Ptr;
95 Ptr shared_from_this();
97 typedef boost::adjacency_list<
118 typedef boost::property<boost::edge_weight_t, double>
Weight;
126 typedef std::list<PathVertex>
List;
128 static double Distance(
const List&);
142 typedef std::list<MultiPathVertex>
List;
152 void addPath(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
154 void addPathToEnd(PathVertex::List::const_iterator, PathVertex::List::const_iterator);
159 const DtProj& localProj)
const;
170 explicit Path(
const std::string& = std::string());
175 void addPath(
const Path&);
179 bool empty()
const {
return myPathVertices.empty(); }
180 size_t numPaths()
const {
return myPathVertices.size(); }
189 const DtProj& localProj)
const;
196 template <
typename T>
212 std::auto_ptr<DtFeatureSet> input,
215 std::string label = std::string());
219 virtual void shutdown();
220 virtual bool isShutdown()
const;
235 double maxSearchRadius,
236 double startProximityThreshold,
237 double stopProximityThreshold,
257 void setMaxSearchRadius(
double radius);
258 void setSearchRadius(
double maxRadius,
double minRadius);
265 Results* results = 0,
266 unsigned recursionLevel = 0);
270 bool onPathFeature(
const DtPoint& location,
double offset = 0.5);
272 std::auto_ptr<DtPathFeatureSet> paths()
const;
288 const DtPoint& startingLocation,
289 const double& searchRadius,
290 bool* dataAvailable = NULL);
292 bool isDrawing()
const;
293 void setDrawing(
bool);
295 bool isSearchDrawing()
const;
296 void setSearchDrawing(
bool);
298 bool isLoadDrawing()
const;
299 void setLoadDrawing(
bool);
301 std::string label()
const;
306 void addFeatureToGraph(
308 bool joinToIntersectingEdges,
309 const boost::optional<DtFeatureGeometry>& searchArea = boost::none_t(),
312 void addFeatureToGraph(
314 const boost::optional<DtFeatureGeometry>& searchArea = boost::none_t(),
319 bool loadTile(
const DtPoint& localLocation,
double timeout = 0);
321 bool loadTileAndBlock(
323 bool loadTileAndBlock(
330 std::auto_ptr<DtFeatureSet> input,
353 struct GridTile :
public boost::enable_shared_from_this<GridTile>
355 typedef boost::shared_ptr<GridTile>
Ptr;
362 size_t operator()(
const EdgeRecord& edge)
const;
400 bool loaded(
double timeout)
const;
410 typedef tbb::queuing_rw_mutex
Mutex;
415 boost::shared_ptr<GridTile> subtiles[2][2];
449 template <
typename T>
468 for (
size_t i=0; i !=
size; ++i)
480 while (index >=
size())
488 while (index >=
size())
509 template <
typename T>
521 template <
typename T>
545 const DtPoint& localDestination,
546 double maxSearchRadius,
547 double startProximityThreshold,
548 double stopProximityThreshold,