本文整理汇总了C++中PathVector::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ PathVector::erase方法的具体用法?C++ PathVector::erase怎么用?C++ PathVector::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathVector
的用法示例。
在下文中一共展示了PathVector::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: split_vec
static void split_vec(PathVector &full_vec, PathVector &new_vec,
const Path &split_path){
PathVector old_full;
old_full.insert(old_full.begin(),full_vec.begin(),full_vec.end());
full_vec.erase(full_vec.begin(),full_vec.end());
for( PathVector::const_iterator path=old_full.begin() ; path!=old_full.end()
; path++ ){
if(starts_with(*path,split_path))
new_vec.push_back(*path);
else
full_vec.push_back(*path);
}
}
示例2: merge
QList<QPoint> ValidPathCreator::createPath(PathVector const & components)
{
if (components.size() == 0) {
return QList<QPoint>();
}
PathVector paths;
foreach (PointVector component, components)
{
int j = 0;
while (j < paths.size())
{
if (getDistance(paths[j], component) == 0) {
component = merge(paths[j], component, 0);
paths.erase(paths.begin() + j);
} else {
j++;
}
}
paths.push_back(component);
}