本文整理汇总了C++中CBvert_list::pts方法的典型用法代码示例。如果您正苦于以下问题:C++ CBvert_list::pts方法的具体用法?C++ CBvert_list::pts怎么用?C++ CBvert_list::pts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBvert_list
的用法示例。
在下文中一共展示了CBvert_list::pts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
bool
OVERSKETCH::apply_offsets(CBvert_list& sil_verts, const vector<double>& sil_offsets)
{
// XXX - preliminary...
assert(sil_verts.size() == sil_offsets.size());
// Expand region around oversketched silhouette verts.
// XXX - Should compute the one-ring size, not use "3"
Bface_list region = sil_verts.one_ring_faces().n_ring_faces(3);
// Find the minimum distance to the silhouette verts from the
// outer boundary of the region
Wpt_list sil_path = sil_verts.pts();
double R = min_dist(region.get_boundary().verts().pts(), sil_path);
Bvert_list region_verts = region.get_verts();
Wpt_list new_locs = region_verts.pts();
vector<double> offsets;
for (Bvert_list::size_type i=0; i<region_verts.size(); i++) {
Wpt foo;
int k = -1;
double d = sil_path.closest(region_verts[i]->loc(), foo, k);
if (k < 0 || k >= (int)sil_offsets.size()) {
err_adv(debug, "OVERSKETCH::apply_offsets: error: can't find closest");
continue;
}
double s = swell_profile(d/R);
double h = sil_offsets[k] * s;
// err_adv(debug, " d: %f, d/R: %f, s: %f", d, d/R, s);
offsets.push_back(h);
new_locs[i] += region_verts[i]->norm()*h;
// WORLD::show(region_verts[i]->loc(), new_locs[i], 1);
}
// now apply new locs
// FIT_VERTS_CMDptr cmd = make_shared<FIT_VERTS_CMD>(region_verts, new_locs);
SUBDIV_OFFSET_CMDptr cmd = make_shared<SUBDIV_OFFSET_CMD>(region_verts, offsets);
cmd->doit();
WORLD::add_command(cmd);
return true;
}