本文整理汇总了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();
}
示例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);
}
示例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;
}
}
示例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(), ());
}