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


C++ Segment::GetMwmId方法代码示例

本文整理汇总了C++中Segment::GetMwmId方法的典型用法代码示例。如果您正苦于以下问题:C++ Segment::GetMwmId方法的具体用法?C++ Segment::GetMwmId怎么用?C++ Segment::GetMwmId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Segment的用法示例。


在下文中一共展示了Segment::GetMwmId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DebugPrint

inline std::string DebugPrint(Segment const & segment)
{
  std::ostringstream out;
  out << std::boolalpha << "Segment(" << segment.GetMwmId() << ", " << segment.GetFeatureId() << ", "
      << segment.GetSegmentIdx() << ", " << segment.IsForward() << ")";
  return out.str();
}
开发者ID:milchakov,项目名称:omim,代码行数:7,代码来源:segment.hpp

示例2: GetOutgoingEdgeList

void CrossMwmGraph::GetOutgoingEdgeList(Segment const & s, vector<SegmentEdge> & edges)
{
  CHECK(IsTransition(s, false /* isEnter */),
        ("The segment is not a transition segment. IsTransition(", s, ", false) returns false."));
  edges.clear();

  if (TransitGraph::IsTransitSegment(s))
  {
    if (TransitCrossMwmSectionExists(s.GetMwmId()))
      m_crossMwmTransitGraph.GetOutgoingEdgeList(s, edges);
    return;
  }

  if (CrossMwmSectionExists(s.GetMwmId()))
    m_crossMwmIndexGraph.GetOutgoingEdgeList(s, edges);
}
开发者ID:milchakov,项目名称:omim,代码行数:16,代码来源:cross_mwm_graph.cpp

示例3: GetTwinFeature

void CrossMwmGraph::GetTwinFeature(Segment const & segment, bool isOutgoing, vector<Segment> & twins)
{
  std::vector<uint32_t> const & transitSegmentIds =
    m_crossMwmIndexGraph.GetTransitSegmentId(segment.GetMwmId(), segment.GetFeatureId());

  for (auto transitSegmentId : transitSegmentIds)
  {
    Segment const transitSegment(segment.GetMwmId(), segment.GetFeatureId(),
                                 transitSegmentId, segment.IsForward());

    if (!IsTransition(transitSegment, isOutgoing))
      continue;

    GetTwins(transitSegment, isOutgoing, twins);
    break;
  }
}
开发者ID:milchakov,项目名称:omim,代码行数:17,代码来源:cross_mwm_graph.cpp

示例4: GetTwins

void CrossMwmGraph::GetTwins(Segment const & s, bool isOutgoing, vector<Segment> & twins)
{
  CHECK(IsTransition(s, isOutgoing),
        ("The segment", s, "is not a transition segment for isOutgoing ==", isOutgoing));
  // Note. There's an extremely rare case when a segment is ingoing and outgoing at the same time.
  // |twins| is not filled for such cases. For details please see a note in
  // CrossMwmGraph::GetOutgoingEdgeList().
  if (IsTransition(s, !isOutgoing))
    return;

  twins.clear();

  vector<NumMwmId> neighbors;
  bool allNeighborsHaveCrossMwmSection = false;
  GetAllLoadedNeighbors(s.GetMwmId(), neighbors, allNeighborsHaveCrossMwmSection);
  MwmStatus const currentMwmStatus = GetCrossMwmStatus(s.GetMwmId());
  CHECK_NOT_EQUAL(currentMwmStatus, MwmStatus::NotLoaded,
                  ("Current mwm is not loaded. Mwm:", m_numMwmIds->GetFile(s.GetMwmId()),
                   "currentMwmStatus:", currentMwmStatus));

  if (TransitGraph::IsTransitSegment(s) && TransitCrossMwmSectionExists(s.GetMwmId()))
  {
    DeserializeTransitTransitions(neighbors);
    m_crossMwmTransitGraph.GetTwinsByCrossMwmId(s, isOutgoing, neighbors, twins);
  }
  else if (allNeighborsHaveCrossMwmSection && currentMwmStatus == MwmStatus::SectionExists)
  {
    DeserializeTransitions(neighbors);
    m_crossMwmIndexGraph.GetTwinsByCrossMwmId(s, isOutgoing, neighbors, twins);
  }
  else
  {
    // TODO (@gmoryes)
    //  May be we should add ErrorCode about "NeedUpdateMaps" and return it here.
    //  but until we haven't it, lets do nothing.
    return;
  }

  for (Segment const & t : twins)
    CHECK_NOT_EQUAL(s.GetMwmId(), t.GetMwmId(), ());
}
开发者ID:milchakov,项目名称:omim,代码行数:41,代码来源:cross_mwm_graph.cpp


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