20 #include <boost/graph/adjacency_list.hpp>
21 #include <boost/graph/properties.hpp>
22 #include <boost/graph/graph_traits.hpp>
23 #include <boost/function.hpp>
24 #include <tbb/spin_rw_mutex.h>
28 namespace MAKVRinTerra
34 : location(0.0, 0.0, 0.0)
53 : feature(p.getPathPtr())
71 : x(xIndex), y(yIndex) { }
77 else if (x == rhs.
x && y < rhs.
y)
94 typedef boost::property<boost::edge_weight_t, double>
Weight;
96 typedef boost::adjacency_list<
108 typedef std::list<boost::graph_traits<DtBoostGraph>::vertex_descriptor>
VertexList;
116 PathVertex() : localLocation(0.0, 0.0, 0.0), nextEdgeFeature() { }
118 : localLocation(l), nextEdgeFeature(f) { }
123 typedef std::list<PathVertex>
Path;
134 : myTolerance(tolerance) { }
142 if (
DtALMOST(lhs.
z(), rhs.
z(), myTolerance) || lhs.
z() > rhs.
z())
148 return lhs.
y() < rhs.
y();
150 return lhs.
x() < rhs.
x();
164 , myBestPointOnNetwork()
165 , myBestEdgeDistance(std::numeric_limits<double>::infinity())
193 boost::shared_ptr<DtTerrainInterfaceConfig> config);
199 DtPoint locationForVertex(
const vertex_descriptor& vertex);
201 vertex_descriptor vertexForLocation(
const DtPoint& localLocation);
211 Path makePath(
const DtPoint& startLocation,
const DtPoint& endLocation,
212 const double& maxSearchRadius,
const double& startProximityThreshold,
213 DtWeightFactorsListPtr weightFactors, boost::function<
bool ()> cancelCheck,
218 bool onPathFeature(
const DtPoint& location,
double offset = 0.5);
227 void loadTile(
const DtGridKey& key, tbb::spin_rw_mutex::scoped_lock&,
228 boost::function<
bool ()> cancelCheck);
230 DtBoostGraph* graph();
232 std::auto_ptr<DtPathFeatureSet> paths()
const
234 return std::auto_ptr<DtPathFeatureSet>(myInputPathFeatureSet->clone());
252 const double& searchRadius,
bool* dataAvailable = NULL);
256 int numFeatures()
const;
261 Path makePath(
const vertex_descriptor& source,
const vertex_descriptor& destination,
262 double maxSearchRadius, DtWeightFactorsListPtr weightFactors,
263 tbb::spin_rw_mutex::scoped_lock& lock, boost::function<
bool ()> cancelCheck,
264 AstarSearchResults& astarResults, ReturnCode& pathFindResult);
270 const double& searchRadius, vertex_descriptor& edgeA, vertex_descriptor& edgeB,
284 bool determineStartAndEndVertices(
const DtPoint& startLocation,
const DtPoint& endLocation,
285 vertex_descriptor& startEdgeVertexToUse, vertex_descriptor& startEdgeOtherVertex,
286 vertex_descriptor& endEdgeVertexToUse, vertex_descriptor& endEdgeOtherVertex,
335 const double& maxSearchRadius,
const double& startProximityThreshold,
338 , myPathFinder(pathFinder)
339 , myLocalStart(localStart)
340 , myLocalDestination(localDestination)
341 , myMaxSearchRadius(maxSearchRadius)
342 , myStartProximityThreshold(startProximityThreshold)
343 , myWeightFactors(factors)
353 DtVerbose <<
"Job canceled before path plan." << std::endl;
358 DtAsyncJobMap::accessor a;
359 myJobServer->accessor(a, myId);
367 DtWarn <<
"Job " << myId <<
" in invalid state " << entry->
status() << std::endl;
374 myLocalStart, myLocalDestination, myMaxSearchRadius,
375 myStartProximityThreshold, myWeightFactors, boost::ref(cancelCheck),
376 myPathFindReturnCode);
379 result->returnCode = myPathFindReturnCode;
383 DtAsyncJobMap::accessor a;
384 myJobServer->accessor(a, myId);
386 entry->
setResult(std::auto_ptr<DtAsyncJobResult>(result));
394 DtAsyncJobMap::accessor a;
395 myJobServer->accessor(a, myId);
398 result->returnCode = myPathFindReturnCode;
399 entry->
setResult(std::auto_ptr<DtAsyncJobResult>(result));