本文整理汇总了C++中Indices::back方法的典型用法代码示例。如果您正苦于以下问题:C++ Indices::back方法的具体用法?C++ Indices::back怎么用?C++ Indices::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indices
的用法示例。
在下文中一共展示了Indices::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: indexCellPath
Octree::Indices Octree::indexCellPath(const Locations& path) {
// First through the allocated cells
Indices cellPath = indexConcreteCellPath(path);
// Catch up from the last allocated cell on the path
auto currentIndex = cellPath.back();
for (int l = (Index) cellPath.size(); l < (Index) path.size(); l++) {
auto& location = path[l];
// Allocate the new index & connect it to the parent
auto newIndex = allocateCell(currentIndex, location);
// One more cell index on the path, moving on
currentIndex = newIndex;
cellPath.push_back(currentIndex);
// Except !!! if we actually couldn't allocate anymore
if (newIndex == INVALID_CELL) {
// no more cellID available, stop allocating
// THe last index added is INVALID_CELL so the caller will know we failed allocating everything
break;
}
}
return cellPath;
}