当前位置: 首页>>代码示例>>C++>>正文


C++ CGESTUREptr::is_tap方法代码示例

本文整理汇总了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;

}
开发者ID:QuLogic,项目名称:jot-lib,代码行数:25,代码来源:trace.cpp

示例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);
}
开发者ID:ArnaudGastinel,项目名称:jot-lib,代码行数:59,代码来源:select_widget.C


注:本文中的CGESTUREptr::is_tap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。