本文整理汇总了C++中CellList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ CellList::push_back方法的具体用法?C++ CellList::push_back怎么用?C++ CellList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CellList
的用法示例。
在下文中一共展示了CellList::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: emit
// Return the list of cells crossed when moving from the start point
// to the end point.
CellList emit()
{
CellList cells;
int gridX = xcell(m_xstart);
int gridY = ycell(m_ystart);
int xlast = xcell(m_xend);
int ylast = ycell(m_yend);
cells.push_back( {gridX, gridY} );
while (gridX != xlast || gridY != ylast)
{
if (m_tMaxX < m_tMaxY)
{
m_tMaxX += m_tDeltaX;
gridX += m_stepX;
}
else
{
m_tMaxY += m_tDeltaY;
gridY += m_stepY;
}
cells.push_back( { gridX, gridY } );
}
return cells;
}
示例2: cellList
SqlitePage::CellList SqlitePage::cellList() {
CellList cellList;
CellPointers cellPtrs = cellPointers();
for (CellPointers::iterator pos = cellPtrs.begin();
pos != cellPtrs.end(); ++pos) {
CellInfo cellInfo;
cellInfo.offset = *pos;
base::varint_t vint_playload = parseVarint(page_.begin() + *pos, page_.end());
base::varint_t vint_rowid = parseVarint(page_.begin() + *pos + vint_playload.length, page_.end());
cellInfo.length = vint_playload.value + vint_playload.length + vint_rowid.length;
cellList.push_back(cellInfo);
}
return cellList;
}
示例3:
void ForestTechniqueManager::Cell::bin()
{
// put trees in appropriate cells.
TreeList treesNotAssigned;
for(TreeList::iterator titr=_trees.begin();
titr!=_trees.end();
++titr)
{
Tree* tree = titr->get();
bool assigned = false;
for(CellList::iterator citr=_cells.begin();
citr!=_cells.end() && !assigned;
++citr)
{
if ((*citr)->contains(tree->_position))
{
(*citr)->addTree(tree);
assigned = true;
}
}
if (!assigned) treesNotAssigned.push_back(tree);
}
// put the unassigned trees back into the original local tree list.
_trees.swap(treesNotAssigned);
// prune empty cells.
CellList cellsNotEmpty;
for(CellList::iterator citr=_cells.begin();
citr!=_cells.end();
++citr)
{
if (!((*citr)->_trees.empty()))
{
cellsNotEmpty.push_back(*citr);
}
}
_cells.swap(cellsNotEmpty);
}
示例4: visit
virtual void visit(AstCell* nodep, AstNUser*) {
// Must do ifaces first, so push to list and do in proper order
m_cellps.push_back(nodep);
}