Пример #1
0
/*****************************************************************
 * XformPen
 *****************************************************************/
XformPen::XformPen(
   CGEST_INTptr &gest_int,
   CEvent &d,
   CEvent &m,
   CEvent &u) :
   Pen(str_ptr("xform"), gest_int, d, m, u)
{
   // Set up GESTURE FSA (First matched will be executed)

   _draw_start += DrawArc(new GarbageGuard,  drawCB(&XformPen::garbage_cb));
   _draw_start += DrawArc(new DoubleTapGuard,drawCB(&XformPen::double_tap_cb));
   _draw_start += DrawArc(new       TapGuard,drawCB(&XformPen::       tap_cb));
   _draw_start += DrawArc(new StrokeGuard,   drawCB(&XformPen::stroke_cb));
}
Пример #2
0
NPRPen::NPRPen(
   CGEST_INTptr &gest_int,
   CEvent& d, CEvent& m, CEvent& u,
   CEvent& shift_down, CEvent& shift_up,
   CEvent& ctrl_down,  CEvent& ctrl_up) :
   Pen("Basecoat",
       gest_int, d, m, u,
       shift_down, shift_up, 
       ctrl_down, ctrl_up)
{
                
   // gestures we recognize:
   _draw_start += DrawArc(new TapGuard,      drawCB(&NPRPen::tap_cb));
   _draw_start += DrawArc(new SlashGuard,    drawCB(&NPRPen::slash_cb));
   _draw_start += DrawArc(new LineGuard,     drawCB(&NPRPen::line_cb));
   _draw_start += DrawArc(new ScribbleGuard, drawCB(&NPRPen::scribble_cb));
   _draw_start += DrawArc(new LassoGuard,    drawCB(&NPRPen::lasso_cb));
   _draw_start += DrawArc(new StrokeGuard,   drawCB(&NPRPen::stroke_cb));

   // let's us override the drawing of gestures:

   _gesture_drawer = new FooGestureDrawer();
        
   _prev_gesture_drawer = nullptr;

   // ui vars:
   _curr_npr_tex = nullptr;

   _ui = new NPRPenUI(this);
   assert(_ui);


}
Пример #3
0
pathPlan::pathPlan(obstacles *obs,simGLView* glView)
:
simGLObject(glView),
m_blocks(obs),
m_CS(NULL),
m_range(0),
m_margin(SPACEMARGIN),
m_step(0.25),
m_visibilityType(false),
m_goalOccluded(NULL),
m_efficiencyLimit(0.3),
m_spinProgress(6),
m_spinProgressBase(0),
m_state(PS_SEARCHING),
m_drawSwitch(true),
m_linkViewIndex(0)
{
	// create callbacks to all the drawing methods, these are added to/removed from the display list
	// make sure these remain in order to match with the enumeration
	ACallback<pathPlan> drawCB(this, &pathPlan::drawDebugPath);	m_drawingList << drawCB;
	drawCB.SetCallback(this,&pathPlan::drawCrowFlyLine); 		m_drawingList << drawCB;
	drawCB.SetCallback(this,&pathPlan::drawCurrentSearchPath);	m_drawingList << drawCB;
	drawCB.SetCallback(this,&pathPlan::drawRangeFan);			m_drawingList << drawCB;
	drawCB.SetCallback(this,&pathPlan::drawPathBaseLine);		m_drawingList << drawCB;
	drawCB.SetCallback(this,&pathPlan::drawLightTrail);			m_drawingList << drawCB;
	drawCB.SetCallback(this,&pathPlan::drawPathBuildLine);		m_drawingList << drawCB;
	
	m_GP.length = 0;
	m_GP.time = 0;
	m_GP.efficiency = 0;
	
	displayBuildPath(false);
	displayPath(false);
	displayLightTrail(false);
	displayCrowFly(false);
	displayDebug(false);
	displayCspace(false);
}