本文整理汇总了C++中scoped_ptr::get_vertex_by_coord方法的典型用法代码示例。如果您正苦于以下问题:C++ scoped_ptr::get_vertex_by_coord方法的具体用法?C++ scoped_ptr::get_vertex_by_coord怎么用?C++ scoped_ptr::get_vertex_by_coord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scoped_ptr
的用法示例。
在下文中一共展示了scoped_ptr::get_vertex_by_coord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mysearch
void mysearch(float x1, float y1, float x2, float y2) {
if (g_proutes == NULL) {
return;
}
//std::cout << "I see routes..." << std::endl;
const vertex_id start = g_proutes->get_vertex_by_coord(vis_coord(x1, y1));
const vertex_id end = g_proutes->get_vertex_by_coord(vis_coord(x2, y2));
g_orig_path.clear();
g_path.clear();
//std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
g_proutes->get_path(start, end, g_orig_path);
g_path.resize(g_orig_path.size() * 2);
//std::cout << "starting giving " << g_orig_path.size() << " of them..."<< std::endl;
//std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
//std::cout << start << " " << end << std::endl;
for (size_t i = 0; i < g_orig_path.size(); ++i)
{
g_path[i * 2 + 0] = static_cast<float>(g_orig_path[i].x);
g_path[i * 2 + 1] = static_cast<float>(g_orig_path[i].y);
//std::cout << static_cast<float>(g_orig_path[i].x) << " " <<
// static_cast<float>(g_orig_path[i].y) << std::endl;
}
}