本文整理汇总了C++中Graph::GetEdge方法的典型用法代码示例。如果您正苦于以下问题:C++ Graph::GetEdge方法的具体用法?C++ Graph::GetEdge怎么用?C++ Graph::GetEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph::GetEdge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawTrail
void DrawTrail(const Trail& tr, const Graph& g)
{
if (tr.empty())
{
return;
}
int prev = tr[0];
for (unsigned int i = 1; i < tr.size(); i++)
{
const GraphEdge& edge = g.GetEdge(tr[i], prev);
prev = tr[i];
DrawEdge(edge, g);
}
}
示例2: doExport
void doExport()
{
Map *map = new Map(gDefaultMap);
map->Scale(512, 512);
msa = new MapSectorAbstraction(map, 8);
msa->ToggleDrawAbstraction(1);
Graph *g = msa->GetAbstractGraph(1);
printf("g\n%d %d\n", g->GetNumNodes(), g->GetNumEdges());
for (int x = 0; x < g->GetNumNodes(); x++)
{
node *n = g->GetNode(x);
int x1, y1;
msa->GetTileFromNode(n, x1, y1);
printf("%d %d %d\n", x, x1, y1);
}
for (int x = 0; x < g->GetNumEdges(); x++)
{
edge *e = g->GetEdge(x);
printf("%d %d\n", e->getFrom(), e->getTo());//, (int)(100.0*e->GetWeight())); // %d 0
}
exit(0);
}