当前位置: 首页>>代码示例>>C++>>正文


C++ Index::ForEachInRectForMWM方法代码示例

本文整理汇总了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, ());
    }
  }
开发者ID:rossanag,项目名称:omim,代码行数:31,代码来源:turns_generator.cpp

示例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());
}
开发者ID:rossanag,项目名称:omim,代码行数:16,代码来源:turns_generator.cpp


注:本文中的Index::ForEachInRectForMWM方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。