本文整理汇总了C++中Searcher::pushResult方法的典型用法代码示例。如果您正苦于以下问题:C++ Searcher::pushResult方法的具体用法?C++ Searcher::pushResult怎么用?C++ Searcher::pushResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Searcher
的用法示例。
在下文中一共展示了Searcher::pushResult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: search
void search(const Rect& rect, Searcher& search) const
{
/*if (rect.contains(bounds) && childrenPoints.size() >= search.searchSize()) {
pushChildrenPointsUnchecked(rect, search);
return;
}*/
for (auto p = points, end = points + pointCount; p < end; p++) {
if (p->rank > search.maxAcceptedRank())
break; // nothing to do here anymore
if (rect.contains(p))
search.pushResult(p);
}
if (others[0] != others[1])
{
if (level & 1)
{
if (others[0]->minRank <= others[1]->minRank)
{
if (rect.lx <= middle && others[0]->minRank < search.maxAcceptedRank())
others[0]->search(rect, search);
if (rect.hx >= middle && others[1]->minRank < search.maxAcceptedRank())
others[1]->search(rect, search);
}
else
{
if (rect.hx >= middle && others[1]->minRank < search.maxAcceptedRank())
others[1]->search(rect, search);
if (rect.lx <= middle && others[0]->minRank < search.maxAcceptedRank())
others[0]->search(rect, search);
}
}
else
{
if (others[0]->minRank <= others[1]->minRank)
{
if (rect.ly <= middle && others[0]->minRank < search.maxAcceptedRank())
others[0]->search(rect, search);
if (rect.hy >= middle && others[1]->minRank < search.maxAcceptedRank())
others[1]->search(rect, search);
}
else
{
if (rect.hy >= middle && others[1]->minRank < search.maxAcceptedRank())
others[1]->search(rect, search);
if (rect.ly <= middle && others[0]->minRank < search.maxAcceptedRank())
others[0]->search(rect, search);
}
}
}
}