/*tenta fixar alguns ingredientes*/ void prefix(){ int up_1,up_3,i; for(i=0;i<n;i++){ up_1=up1(i); up_3=up3(i); if(up_1==1 || up_3==1) fixed[i]=1; if(up_1==0 || up_3==0) fixed[i]=0; } }
interh(i,c) { int kl, kr; if (fullbot[i]== '=' || (dboxflg && (i==0 || i>= nlin-1))) { if (c==ncol) return(LEFT); if (c==0) return(RIGHT); return(THRU); } if (i>=nlin) return(0); kl = c>0 ? thish (i,c-1) : 0; if (kl<=1 && i>0 && allh(up1(i))) kl = c>0 ? thish(up1(i),c-1) : 0; kr = thish(i,c); if (kr<=1 && i>0 && allh(up1(i))) kr = c>0 ? thish(up1(i), c) : 0; if (kl== '=' && kr == '=') return(THRU); if (kl== '=') return(LEFT); if (kr== '=') return(RIGHT); return(0); }
// "dual" edge-drop problems // cylinder: zero diam edge/ellipse, r-radius cylinder, find r-offset == cl (ITO surface XY-slice is a circle) // sphere: zero diam cylinder. ellipse around edge, find offset == cl (ITO surface slice is ellipse) (?) // toroid: radius2 diam edge, radius1 cylinder, find radius1-offset-ellipse=cl (ITO surf slice is offset ellipse) (this is the offset-ellipse problem) // cone: ??? (how is this an ellipse??) bool MillingCutter::singleEdgeDrop(CLPoint& cl, const Point& p1, const Point& p2, double d) const { Point v = p2 - p1; // vector along edge, from p1 -> p2 Point vxy( v.x, v.y, 0.0); vxy.xyNormalize(); // normalized XY edge vector // figure out u-coordinates of p1 and p2 (i.e. x-coord in the rotated system) Point sc = cl.xyClosestPoint( p1, p2 ); assert( ( (cl-sc).xyNorm() - d ) < 1E-6 ); // edge endpoints in the new coordinate system, in these coordinates, CL is at origo Point up1( (p1-sc).dot(vxy) , d, p1.z); // d, distance to line, is the y-coord in the rotated system Point up2( (p2-sc).dot(vxy) , d, p2.z); CC_CLZ_Pair contact = this->singleEdgeDropCanonical( up1, up2 ); // the subclass handles this CCPoint cc_tmp( sc + contact.first * vxy, EDGE); // translate back into original coord-system cc_tmp.z_projectOntoEdge(p1,p2); return cl.liftZ_if_InsidePoints( contact.second , cc_tmp , p1, p2); }
int main() { { std::vector<std::shared_ptr<a>> v1 ; std::shared_ptr<a> up1( new a ) ; std::shared_ptr<a> up2( new a ) ; v1.push_back( up1 ) ; v1.push_back( up2 ) ; } std::cout << "Boo\n" ; }
TEST_F(MouseControllerUnitTestBase, ShiftCapture) { MouseController mc(root); EXPECT_EQ(nullptr, mc.capture()); MouseEvent down1(kET_MOUSE_DOWN, kMB_LEFT, root, Point::Make(45, 45), Point::Make(45, 45), 0); mc.handleEvent(down1); EXPECT_EQ(v31, mc.capture()); MouseEvent move1(kET_MOUSE_MOVE, kMB_NONE, root, Point::Make(29, 20), Point::Make(29, 20), 0); mc.handleEvent(move1); EXPECT_EQ(v31, mc.capture()); EXPECT_EQ(v31, mc.over()); MouseEvent up1(kET_MOUSE_UP, kMB_LEFT, root, Point::Make(29, 20), Point::Make(29, 20), 0); mc.handleEvent(up1); EXPECT_EQ(nullptr, mc.capture()); //鼠标弹起后 要切换over EXPECT_EQ(v2, mc.over()); }