本文整理汇总了C++中CBvert_list::back方法的典型用法代码示例。如果您正苦于以下问题:C++ CBvert_list::back方法的具体用法?C++ CBvert_list::back怎么用?C++ CBvert_list::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBvert_list
的用法示例。
在下文中一共展示了CBvert_list::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clear
bool
BvertGrid::build(
CBvert_list& bottom, // bottom row
CBvert_list& top, // top row
CBvert_list& left, // left column
CBvert_list& right // right column
)
{
// Vertices of bottom and top run left to right.
// On the left and right they run bottom to top.
// Check everything is righteous:
if (bottom.size() < 2 ||
bottom.size() != top.size() ||
left.size() < 2 ||
left.size() != right.size() ||
bottom.front() != left.front() ||
bottom.back() != right.front() ||
top.front() != left.back() ||
top.back() != right.back() ||
!bottom.same_mesh() ||
!top.same_mesh() ||
!left.same_mesh() ||
!right.same_mesh() ||
bottom.mesh() == nullptr) {
err_msg("BvertGrid::build: can't deal with CRAP input");
std::ostream_iterator<Bvert*> err_it (std::cerr, ", ");
cerr << "bottom: ";
std::copy(bottom.begin(), bottom.end(), err_it);
cerr << endl;
cerr << "top: ";
std::copy(top.begin(), top.end(), err_it);
cerr << endl;
cerr << "left: ";
std::copy(left.begin(), left.end(), err_it);
cerr << endl;
cerr << "right: ";
std::copy(right.begin(), right.end(), err_it);
cerr << endl;
return false;
}
// Wipe the old:
clear();
// Build the new...
// bottom row:
_grid.push_back(bottom);
BMESHptr m = bottom.mesh(); assert(m);
// Internal rows:
for (Bvert_list::size_type j=1; j<left.size()-1; j++) {
Bvert_list row; // vertices for row j
row.push_back(left[j]); // add first vertex for row j
for (Bvert_list::size_type i=1; i<bottom.size()-1; i++)
row.push_back(m->add_vertex()); // add internal vertices
row.push_back(right[j]); // add last vertex for row j
_grid.push_back(row);
}
// top row:
_grid.push_back(top);
// Now compute cached values:
cache();
return true;
}