本文整理汇总了C++中Index::ForEachInRectForMWM方法的典型用法代码示例。如果您正苦于以下问题:C++ Index::ForEachInRectForMWM方法的具体用法?C++ Index::ForEachInRectForMWM怎么用?C++ Index::ForEachInRectForMWM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index::ForEachInRectForMWM方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPossibleTurns
// OSRM graph contains preprocessed edges without proper information about adjecency.
// So, to determine we must read the nearest geometry and check its adjacency by OSRM road graph.
void GetPossibleTurns(Index const & index, NodeID node, m2::PointD const & ingoingPoint,
m2::PointD const & junctionPoint, RoutingMapping & routingMapping,
TTurnCandidates & candidates)
{
double const kReadCrossEpsilon = 1.0E-4;
// Geting nodes by geometry.
vector<NodeID> geomNodes;
helpers::Point2Node p2n(routingMapping, geomNodes);
index.ForEachInRectForMWM(
p2n, m2::RectD(junctionPoint.x - kReadCrossEpsilon, junctionPoint.y - kReadCrossEpsilon,
junctionPoint.x + kReadCrossEpsilon, junctionPoint.y + kReadCrossEpsilon),
scales::GetUpperScale(), routingMapping.GetMwmId());
sort(geomNodes.begin(), geomNodes.end());
geomNodes.erase(unique(geomNodes.begin(), geomNodes.end()), geomNodes.end());
// Filtering virtual edges.
vector<NodeID> adjacentNodes;
for (EdgeID const e : routingMapping.m_dataFacade.GetAdjacentEdgeRange(node))
{
QueryEdge::EdgeData const data = routingMapping.m_dataFacade.GetEdgeData(e, node);
if (data.forward && !data.shortcut)
{
adjacentNodes.push_back(routingMapping.m_dataFacade.GetTarget(e));
ASSERT_NOT_EQUAL(routingMapping.m_dataFacade.GetTarget(e), SPECIAL_NODEID, ());
}
}
示例2: GetTurnGeometry
/*!
* \brief GetTurnGeometry looks for all the road network edges near ingoingPoint.
* GetTurnGeometry fills candidates with angles of all the incoming and outgoint segments.
* \warning GetTurnGeometry should be used carefully because it's a time-consuming function.
* \warning In multilevel crossroads there is an insignificant possibility that candidates
* is filled with redundant segments of roads of different levels.
*/
void GetTurnGeometry(m2::PointD const & junctionPoint, m2::PointD const & ingoingPoint,
TGeomTurnCandidate & candidates, RoutingMapping const & mapping,
Index const & index)
{
Point2Geometry getter(junctionPoint, ingoingPoint, candidates);
index.ForEachInRectForMWM(
getter, MercatorBounds::RectByCenterXYAndSizeInMeters(junctionPoint, kFeaturesNearTurnMeters),
scales::GetUpperScale(), mapping.GetMwmId());
}