本文整理汇总了C++中CGESTUREptr::is_stroke方法的典型用法代码示例。如果您正苦于以下问题:C++ CGESTUREptr::is_stroke方法的具体用法?C++ CGESTUREptr::is_stroke怎么用?C++ CGESTUREptr::is_stroke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGESTUREptr
的用法示例。
在下文中一共展示了CGESTUREptr::is_stroke方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
bool
PAPER_DOLL::init(CGESTUREptr& g)
{
if (!(g && g->is_stroke()))
return false;
if (g->below_min_length() || g->below_min_spread())
return false;
if (!g->is_ellipse()) {
err_adv(debug, "PAPER_DOLL::init: non-ellipse");
return false;
}
Panel* p = dynamic_cast<Panel*>(
Bsurface::get_surface(get_top_level(VisRefImage::get_faces(g->pts())))
);
err_adv(debug, "PAPER_DOLL::init: %s panel", p?"found":"could not find");
if (!(p && p->is_selected())) {
err_adv(debug, "PAPER_DOLL::init: ellipse not over selected panel");
return false;
}
assert(p && p->bfaces().size() > 0);
Bface_list faces = Bface_list::reachable_faces(p->bfaces().front());
assert(!faces.empty());
if (!faces.is_planar(deg2rad(1.0))) {
err_adv(debug, "PAPER_DOLL::init: region is not planar");
return false;
}
EdgeStrip boundary = faces.get_boundary();
if (boundary.empty()) {
err_adv(debug, "PAPER_DOLL::init: region has no boundary");
return false;
}
Bsurface_list surfs = Bsurface::get_surfaces(faces);
if (!are_all_bsurfaces<Panel>(surfs)) {
err_adv(debug, "PAPER_DOLL::init: region not all panels");
return 0;
}
err_adv(debug, "PAPER_DOLL::init: proceeding...");
err_adv(debug, " boundary edges: %d, components: %d, panels: %d",
boundary.edges().size(), boundary.num_line_strips(), surfs.num()
);
if (get_instance()->build_primitive(faces)) {
err_adv(debug, " ... succeeded");
return true;
}
err_adv(debug, " ... failed");
return false;
}
示例2:
bool
OVERSKETCH::init(CGESTUREptr& g)
{
if (!(g && g->is_stroke()))
return false;
if (g->below_min_length() || g->below_min_spread())
return false;
if (get_instance()->find_matching_sil(g))
return true;
// add more cases here...
return false;
}