本文整理汇总了C++中CGESTUREptr::is_tap方法的典型用法代码示例。如果您正苦于以下问题:C++ CGESTUREptr::is_tap方法的具体用法?C++ CGESTUREptr::is_tap怎么用?C++ CGESTUREptr::is_tap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGESTUREptr
的用法示例。
在下文中一共展示了CGESTUREptr::is_tap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
int
TRACE::tap_cb(CGESTUREptr& gest, DrawState*& s)
{
assert (gest->is_tap());
if (_calib_mode_flag) {
// we are in calibration point
XYpt sample = gest->end();
_samples[_cur_calib_pt_index] = sample;
cerr << "recorded sample " << _cur_calib_pt_index << endl;
_cur_calib_pt_index++;
/* seems impractical to distort image, leaving this at 2 - alexni
if (_cur_calib_pt_index == 4) {
*/
if (_cur_calib_pt_index == 2) {
// if we have sampled four points, we are done with calibration
_calib_mode_flag = false;
_calibrated = true;
WORLD::message("Calibration complete");
}
return 1;
} else return 0;
}
示例2: cancel_cb
int
SELECT_WIDGET::tap_cb(CGESTUREptr& g, DrawState*& s)
{
err_adv(debug, "SELECT_WIDGET::tap_cb()");
assert(g && g->is_tap());
if (_mode==SLASH_SEL)
{
//pattern editing
Bface* f = find_face(g->start(),0.25,MIN_PIX_AREA);
if (f) {
if (select_list.contains(f)||select_list.contains(f->quad_partner()))
{
//get whichever part of the quad is in the selection list
int temp = select_list.contains(f) ? select_list.get_index(f)+1 : select_list.get_index(f->quad_partner())+1 ;
if (temp>end_face) //user selected the end face
{
end_face=temp;
}
else //user is selecting a pattern
{
if (pattern<temp)
pattern=temp;
//select/deselect face
if (temp < MAX_PATTERN_SIZE)
pattern_array[temp]=!pattern_array[temp];
}
return 1;
}
else
cerr << "tap found a NULL face !" << endl;
}
return cancel_cb(g,s);
}
else
{
// Tap a selected face near the middle to deselect it:
if (try_deselect_face(g->center(), 0.25))
return 1;
// Tap edge to deselect
if (try_deselect_edge(g->center()))
return 1;
}
// Otherwise, turn off SELECT_WIDGET
return cancel_cb(g,s);
}