@Test public void testCreateShape() throws TransformException { final Shape sourceShape = new RoundRectangle2D.Double(-20, -10, 100, 80, 4, 5); final Shape targetShape = ((MathTransform2D) transform).createTransformedShape(sourceShape); final Shape expectedShape = new AffineTransform(SCALE_X, 0, 0, SCALE_Y, TRANSLATE_X, TRANSLATE_Y).createTransformedShape(sourceShape); assertShapeEquals(null, expectedShape, targetShape, 1E-10, 1E-10); }
@Override public Shape createTransformedShape(final Shape shape) throws TransformException { final PathIterator it = shape.getPathIterator(null); final Path2D path = new Path2D.Double(it.getWindingRule()); final double[] b = new double[6]; while (!it.isDone()) { final int mode = it.currentSegment(b); switch (mode) { case PathIterator.SEG_CLOSE: path.closePath(); break; case PathIterator.SEG_MOVETO: transform(b, 0, b, 0, 1); path.moveTo (b[0], b[1]); break; case PathIterator.SEG_LINETO: transform(b, 0, b, 0, 1); path.lineTo (b[0], b[1]); break; case PathIterator.SEG_QUADTO: transform(b, 0, b, 0, 2); path.quadTo (b[0], b[1], b[2], b[3]); break; case PathIterator.SEG_CUBICTO: transform(b, 0, b, 0, 3); path.curveTo(b[0], b[1], b[2], b[3], b[4], b[5]); break; default: throw new AssertionError(mode); } it.next(); } return path; }
SimpleTransform2D extends SimpleTransform implements MathTransform2D { @Override public Shape createTransformedShape(final Shape shape) throws TransformException { final PathIterator it = shape.getPathIterator(null); final Path2D path = new Path2D.Double(it.getWindingRule()); final double[] b = new double[6]; while (!it.isDone()) { final int mode = it.currentSegment(b); switch (mode) { case PathIterator.SEG_CLOSE: path.closePath(); break; case PathIterator.SEG_MOVETO: transform(b, 0, b, 0, 1); path.moveTo (b[0], b[1]); break; case PathIterator.SEG_LINETO: transform(b, 0, b, 0, 1); path.lineTo (b[0], b[1]); break; case PathIterator.SEG_QUADTO: transform(b, 0, b, 0, 2); path.quadTo (b[0], b[1], b[2], b[3]); break; case PathIterator.SEG_CUBICTO: transform(b, 0, b, 0, 3); path.curveTo(b[0], b[1], b[2], b[3], b[4], b[5]); break; default: throw new AssertionError(mode); } it.next(); } return path; } }
SimpleTransform2D extends SimpleTransform implements MathTransform2D { @Override public Shape createTransformedShape(final Shape shape) throws TransformException { final PathIterator it = shape.getPathIterator(null); final Path2D path = new Path2D.Double(it.getWindingRule()); final double[] b = new double[6]; while (!it.isDone()) { final int mode = it.currentSegment(b); switch (mode) { case PathIterator.SEG_CLOSE: path.closePath(); break; case PathIterator.SEG_MOVETO: transform(b, 0, b, 0, 1); path.moveTo (b[0], b[1]); break; case PathIterator.SEG_LINETO: transform(b, 0, b, 0, 1); path.lineTo (b[0], b[1]); break; case PathIterator.SEG_QUADTO: transform(b, 0, b, 0, 2); path.quadTo (b[0], b[1], b[2], b[3]); break; case PathIterator.SEG_CUBICTO: transform(b, 0, b, 0, 3); path.curveTo(b[0], b[1], b[2], b[3], b[4], b[5]); break; default: throw new AssertionError(mode); } it.next(); } return path; } protected  SimpleTransform2D(final Citation authority, final String name,
            final CoordinateReferenceSystem sourceCRS,
            final CoordinateReferenceSystem targetCRS); }
SimpleTransform2D extends SimpleTransform implements MathTransform2D { @Override public Shape createTransformedShape(final Shape shape) throws TransformException { final PathIterator it = shape.getPathIterator(null); final Path2D path = new Path2D.Double(it.getWindingRule()); final double[] b = new double[6]; while (!it.isDone()) { final int mode = it.currentSegment(b); switch (mode) { case PathIterator.SEG_CLOSE: path.closePath(); break; case PathIterator.SEG_MOVETO: transform(b, 0, b, 0, 1); path.moveTo (b[0], b[1]); break; case PathIterator.SEG_LINETO: transform(b, 0, b, 0, 1); path.lineTo (b[0], b[1]); break; case PathIterator.SEG_QUADTO: transform(b, 0, b, 0, 2); path.quadTo (b[0], b[1], b[2], b[3]); break; case PathIterator.SEG_CUBICTO: transform(b, 0, b, 0, 3); path.curveTo(b[0], b[1], b[2], b[3], b[4], b[5]); break; default: throw new AssertionError(mode); } it.next(); } return path; } protected  SimpleTransform2D(final Citation authority, final String name,
            final CoordinateReferenceSystem sourceCRS,
            final CoordinateReferenceSystem targetCRS); @Override final int getSourceDimensions(); @Override final int getTargetDimensions(); @Override DirectPosition transform(final DirectPosition ptSrc, DirectPosition ptDst); @Override abstract Point2D transform(Point2D ptSrc, Point2D ptDst); @Override Shape createTransformedShape(final Shape shape); @Override Matrix derivative(final DirectPosition point); @Override Matrix derivative(final Point2D point); @Override MathTransform2D inverse(); }
SimpleTransform2D extends SimpleTransform implements MathTransform2D { @Override public Shape createTransformedShape(final Shape shape) throws TransformException { final PathIterator it = shape.getPathIterator(null); final Path2D path = new Path2D.Double(it.getWindingRule()); final double[] b = new double[6]; while (!it.isDone()) { final int mode = it.currentSegment(b); switch (mode) { case PathIterator.SEG_CLOSE: path.closePath(); break; case PathIterator.SEG_MOVETO: transform(b, 0, b, 0, 1); path.moveTo (b[0], b[1]); break; case PathIterator.SEG_LINETO: transform(b, 0, b, 0, 1); path.lineTo (b[0], b[1]); break; case PathIterator.SEG_QUADTO: transform(b, 0, b, 0, 2); path.quadTo (b[0], b[1], b[2], b[3]); break; case PathIterator.SEG_CUBICTO: transform(b, 0, b, 0, 3); path.curveTo(b[0], b[1], b[2], b[3], b[4], b[5]); break; default: throw new AssertionError(mode); } it.next(); } return path; } protected  SimpleTransform2D(final Citation authority, final String name,
            final CoordinateReferenceSystem sourceCRS,
            final CoordinateReferenceSystem targetCRS); @Override final int getSourceDimensions(); @Override final int getTargetDimensions(); @Override DirectPosition transform(final DirectPosition ptSrc, DirectPosition ptDst); @Override abstract Point2D transform(Point2D ptSrc, Point2D ptDst); @Override Shape createTransformedShape(final Shape shape); @Override Matrix derivative(final DirectPosition point); @Override Matrix derivative(final Point2D point); @Override MathTransform2D inverse();  }