bool Picture::intersects (BoxObj& userb, Graphic* gs) { if (!IsEmpty()) { Iterator i; FullGraphic gstemp; Transformer ttemp; BoxObj b; getBox(b, gs); if (b.Intersects(userb)) { gstemp.SetTransformer(&ttemp); for (First(i); !Done(i); Next(i)) { Graphic* gr = GetGraphic(i); concatGraphic(gr, gr, gs, &gstemp); if (intersectsGraphic(gr, userb, &gstemp)) { gstemp.SetTransformer(nil); return true; } } gstemp.SetTransformer(nil); /* to avoid deleting ttemp explicitly*/ } } return false; }
boolean BSplineSelection::intersects (BoxObj& userb, Graphic* gs) { BoxObj b; getBox(b, gs); if (b.Intersects(userb)) { if (intersectsGraphic(ifillbspline, userb, gs)) { return true; } else if (intersectsGraphic(bspline, userb, gs)) { return true; } else if (LeftAints(lx0, ly0, lx1, ly1, userb, gs)) { return true; } else if (RightAints(rx0, ry0, rx1, ry1, userb, gs)) { return true; } } return false; }