本文整理汇总了C++中CGESTUREptr::is_dslash方法的典型用法代码示例。如果您正苦于以下问题:C++ CGESTUREptr::is_dslash方法的具体用法?C++ CGESTUREptr::is_dslash怎么用?C++ CGESTUREptr::is_dslash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGESTUREptr
的用法示例。
在下文中一共展示了CGESTUREptr::is_dslash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1:
//! Given a set of enclosed face, activate the widget to sweep out a
//! shape. Checks for errors, returns true on success.
bool
SWEEP_DISK::setup(CGESTUREptr& gest, double dur)
{
static bool debug =
Config::get_var_bool("DEBUG_SWEEP_SETUP",false) || debug_all;
if (!(gest && gest->is_dslash())) {
err_adv(debug, "SWEEP_DISK::setup: bad gesture");
return false;
}
// XXX - shouldn't require it is a Panel:
Panel* p = dynamic_cast<Panel*>(Bsurface::hit_ctrl_surface(gest->start()));
if (!p) {
err_adv(debug, "SWEEP_DISK::setup: non-panel");
return false;
}
Bface_list faces = p->bfaces();
_boundary = faces.get_boundary();
if (_boundary.num_line_strips() != 1) {
err_adv(debug, "SWEEP_DISK::setup: error: boundary is not a single piece");
return false;
}
// Get the best-fit plane, rejecting if the boundary Wpt_list
// doesn't lie within 0.1 of its total length from the plane:
if (!_boundary.verts().pts().get_plane(_plane, 0.1)) {
err_adv(debug,"SWEEP_DISK::setup: Error: can't find plane");
return false;
}
// Find the center
Wpt o = _boundary.verts().pts().average();
// decide guideline direction (normal to plane):
Wvec n = _plane.normal();
if (VIEW::eye_vec(o) * n > 0)
n = -n;
// decide the length for the guideline:
double len = world_length(o, GUIDE_LEN);
// compute guideline endpoint:
Wpt b = o + n.normalized()*len;
// try basic setup
if (!SWEEP_BASE::setup(dynamic_pointer_cast<LMESH>(faces.mesh()), o, b, dur))
return false;
// ******** From here on we accept it ********
_enclosed_faces = faces;
return true;
}