@Override public boolean apply(final Layer la, final Area roi, final mpicbg.models.CoordinateTransform ict) throws Exception { double[] fp = null; mpicbg.models.CoordinateTransform chain = null; Area localroi = null; AffineTransform inverse = null; for (final Item item : al_items) { final long[] p_layer = item.p_layer; final double[][] p = item.p; for (int i = 0; i < item.n_points; i++) { if (p_layer[i] == la.getId()) { if (null == localroi) { inverse = this.at.createInverse(); localroi = roi.createTransformedArea(inverse); } if (localroi.contains(p[0][i], p[1][i])) { if (null == chain) { chain = M.wrap(this.at, ict, inverse); fp = new double[2]; } // Transform the point M.apply(chain, p, i, fp); } } } } if (null != chain) calculateBoundingBox(la); return true; }
@Override public boolean apply(final VectorDataTransform vdt) throws Exception { final double[] fp = new double[2]; final VectorDataTransform vlocal = vdt.makeLocalTo(this); for (final Item item : al_items) { for (int i = 0; i < item.n_points; i++) { if (vdt.layer.getId() == item.p_layer[i]) { for (final VectorDataTransform.ROITransform rt : vlocal.transforms) { if (rt.roi.contains(item.p[0][i], item.p[1][i])) { // Transform the point M.apply(rt.ct, item.p, i, fp); break; } } } } } calculateBoundingBox(vlocal.layer); return true; }