void BSplineSelection::getExtent (float& l, float& b, float& cx, float& cy, float& tol, Graphic* gs) { Extent e; if (extentCached()) { getCachedExtent(e.left, e.bottom, e.cx, e.cy, e.tol); } else { FullGraphic gstmp; concatGSGraphic(ifillbspline, this, gs, &gstmp); getExtentGraphic( ifillbspline, e.left, e.bottom, e.cx, e.cy, e.tol, &gstmp ); Extent te; concatGSGraphic(bspline, this, gs, &gstmp); getExtentGraphic( bspline, te.left, te.bottom, te.cx, te.cy, te.tol, &gstmp ); e.Merge(te); cacheExtent(e.left, e.bottom, e.cx, e.cy, e.tol); } float right = 2*e.cx - e.left; float top = 2*e.cy - e.bottom; float dummy = 0; transformRect(e.left, e.bottom, right, top, l, b, dummy, dummy, gs); transform(e.cx, e.cy, cx, cy, gs); tol = MergeArrowHeadTol(e.tol, gs); }
void Picture::getExtent ( float& l, float& b, float& cx, float& cy, float& tol, Graphic* gs ) { Extent e; float right, top, dummy1, dummy2; if (extentCached()) { getCachedExtent(e._left, e._bottom, e._cx, e._cy, e._tol); } else { if (IsEmpty()) { l = b = cx = cy = tol = 0.0; return; } else { Iterator i; FullGraphic gstemp; Transformer ttemp; Extent te; gstemp.SetTransformer(&ttemp); First(i); Graphic* gr = GetGraphic(i); concatGSGraphic(gr, gr, gs, &gstemp); concatTransformerGraphic(gr, nil, gr->GetTransformer(), &ttemp); getExtentGraphic(gr, e._left,e._bottom,e._cx,e._cy,e._tol,&gstemp); for (Next(i); !Done(i); Next(i)) { gr = GetGraphic(i); concatGSGraphic(gr, gr, gs, &gstemp); concatTransformerGraphic(gr,nil, gr->GetTransformer(), &ttemp); getExtentGraphic( gr, te._left, te._bottom, te._cx, te._cy, te._tol, &gstemp ); e.Merge(te); } cacheExtent(e._left, e._bottom, e._cx, e._cy, e._tol); gstemp.SetTransformer(nil); // to avoid deleting ttemp explicitly } } right = 2*e._cx - e._left; top = 2*e._cy - e._bottom; transformRect(e._left, e._bottom, right, top, l, b, dummy1, dummy2, gs); transform(e._cx, e._cy, cx, cy, gs); tol = e._tol; }