public void transform (Transform t) { t.transform(points, 0, points, 0, pointSize / 2); }
@Override // from IRay2 public Ray2 transform (Transform transform, Ray2 result) { transform.transformPoint(origin, result.origin); transform.transform(direction, result.direction).normalizeLocal(); return result; }
public void transform (Transform t) { t.transform(points, 0, points, 0, pointSize / 2); }
@Override // from IRay2 public Ray2 transform (Transform transform, Ray2 result) { transform.transformPoint(origin, result.origin); transform.transform(direction, result.direction).normalizeLocal(); return result; }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type = p.types[typeIndex]; int count = Path.pointShift[type]; System.arraycopy(p.points, pointIndex, coords, 0, count); if (t != null) { t.transform(coords, 0, coords, 0, count / 2); } pointIndex += count; return type; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type = p.types[typeIndex]; int count = Path.pointShift[type]; System.arraycopy(p.points, pointIndex, coords, 0, count); if (t != null) { t.transform(coords, 0, coords, 0, count / 2); } pointIndex += count; return type; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } if (index == POINTS.length) { return SEG_CLOSE; } int j = 0; float[] p = POINTS[index]; for (int i = 0; i < p.length; i += 4) { coords[j++] = x + p[i + 0] * width + p[i + 1] * aw; coords[j++] = y + p[i + 2] * height + p[i + 3] * ah; } if (t != null) { t.transform(coords, 0, coords, 0, j / 2); } return TYPES[index]; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type; if (index == 0) { type = SEG_MOVETO; coords[0] = x1; coords[1] = y1; } else { type = SEG_LINETO; coords[0] = x2; coords[1] = y2; } if (t != null) { t.transform(coords, 0, coords, 0, 1); } return type; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } if (index == POINTS.length) { return SEG_CLOSE; } int j = 0; float[] p = POINTS[index]; for (int i = 0; i < p.length; i += 4) { coords[j++] = x + p[i + 0] * width + p[i + 1] * aw; coords[j++] = y + p[i + 2] * height + p[i + 3] * ah; } if (t != null) { t.transform(coords, 0, coords, 0, j / 2); } return TYPES[index]; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type; if (index == 0) { type = SEG_MOVETO; coords[0] = x1; coords[1] = y1; } else { type = SEG_LINETO; coords[0] = x2; coords[1] = y2; } if (t != null) { t.transform(coords, 0, coords, 0, 1); } return type; } }
@Override @SuppressWarnings("fallthrough") public int currentSegment (float[] c) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int count = 0; // the fallthrough below is on purpose switch (_rules[curRuleIndex]) { case PathIterator.SEG_CUBICTO: c[4] = _coords[curCoordIndex + 4]; c[5] = _coords[curCoordIndex + 5]; count = 1; case PathIterator.SEG_QUADTO: c[2] = _coords[curCoordIndex + 2]; c[3] = _coords[curCoordIndex + 3]; count += 1; case PathIterator.SEG_MOVETO: case PathIterator.SEG_LINETO: c[0] = _coords[curCoordIndex]; c[1] = _coords[curCoordIndex + 1]; count += 1; } if (transform != null) { transform.transform(c, 0, c, 0, count); } return _rules[curRuleIndex]; } }
@Override @SuppressWarnings("fallthrough") public int currentSegment (float[] c) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int count = 0; // the fallthrough below is on purpose switch (_rules[curRuleIndex]) { case PathIterator.SEG_CUBICTO: c[4] = _coords[curCoordIndex + 4]; c[5] = _coords[curCoordIndex + 5]; count = 1; case PathIterator.SEG_QUADTO: c[2] = _coords[curCoordIndex + 2]; c[3] = _coords[curCoordIndex + 3]; count += 1; case PathIterator.SEG_MOVETO: case PathIterator.SEG_LINETO: c[0] = _coords[curCoordIndex]; c[1] = _coords[curCoordIndex + 1]; count += 1; } if (transform != null) { transform.transform(c, 0, c, 0, count); } return _rules[curRuleIndex]; } }
t.transform(coords, 0, coords, 0, count);
t.transform(coords, 0, coords, 0, count);
/** * Converts the supplied point from coordinates relative to the specified * child layer to coordinates relative to the specified parent layer. The * results are stored into {@code into}, which is returned for convenience. */ public static Point layerToParent(Layer layer, Layer parent, IPoint point, Point into) { into.set(point); while (layer != parent) { if (layer == null) { throw new IllegalArgumentException( "Failed to find parent, perhaps you passed parent, layer instead of " + "layer, parent?"); } into.x -= layer.originX(); into.y -= layer.originY(); layer.transform().transform(into, into); layer = layer.parent(); } return into; }
@Override protected final void paintImpl (Surface surf) { if (disableClip()) paintClipped(surf); else { Transform tx = surf.tx(); float originX = originX(), originY = originY(); tx.translate(originX, originY); tx.transform(pos.set(-originX, -originY), pos); tx.transform(size.set(width, height), size); tx.translate(-originX, -originY); if (size.x < 0) { size.x = -size.x; pos.x -= size.x; } if (size.y < 0) { size.y = -size.y; pos.y -= size.y; } boolean nonEmpty = surf.startClipped( (int)pos.x, (int)pos.y, Math.round(size.x), Math.round(size.y)); try { if (nonEmpty) paintClipped(surf); } finally { surf.endClipped(); } } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type; int count; if (index == 0) { type = SEG_MOVETO; coords[0] = c.x1(); coords[1] = c.y1(); count = 1; } else { type = SEG_QUADTO; coords[0] = c.ctrlX(); coords[1] = c.ctrlY(); coords[2] = c.x2(); coords[3] = c.y2(); count = 2; } if (t != null) { t.transform(coords, 0, coords, 0, count); } return type; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type; int count; if (index == 0) { type = SEG_MOVETO; coords[0] = c.x1(); coords[1] = c.y1(); count = 1; } else { type = SEG_QUADTO; coords[0] = c.ctrlX(); coords[1] = c.ctrlY(); coords[2] = c.x2(); coords[3] = c.y2(); count = 2; } if (t != null) { t.transform(coords, 0, coords, 0, count); } return type; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type; int count; if (index == 0) { type = SEG_MOVETO; coords[0] = c.x1(); coords[1] = c.y1(); count = 1; } else { type = SEG_CUBICTO; coords[0] = c.ctrlX1(); coords[1] = c.ctrlY1(); coords[2] = c.ctrlX2(); coords[3] = c.ctrlY2(); coords[4] = c.x2(); coords[5] = c.y2(); count = 3; } if (t != null) { t.transform(coords, 0, coords, 0, count); } return type; } }
@Override public int currentSegment (float[] coords) { if (isDone()) { throw new NoSuchElementException("Iterator out of bounds"); } int type; int count; if (index == 0) { type = SEG_MOVETO; coords[0] = c.x1(); coords[1] = c.y1(); count = 1; } else { type = SEG_CUBICTO; coords[0] = c.ctrlX1(); coords[1] = c.ctrlY1(); coords[2] = c.ctrlX2(); coords[3] = c.ctrlY2(); coords[4] = c.x2(); coords[5] = c.y2(); count = 3; } if (t != null) { t.transform(coords, 0, coords, 0, count); } return type; } }