public int getWindingRule() { return path.getWindingRule(); }
private static void drawSingle(EpsGraphics eps, double x, double y, final PathIterator path) { eps.newpath(); final double coord[] = new double[6]; while (path.isDone() == false) { final int code = path.currentSegment(coord); if (code == PathIterator.SEG_MOVETO) { eps.moveto(coord[0] + x, coord[1] + y); } else if (code == PathIterator.SEG_LINETO) { eps.lineto(coord[0] + x, coord[1] + y); } else if (code == PathIterator.SEG_CLOSE) { eps.closepath(); } else if (code == PathIterator.SEG_CUBICTO) { eps.curveto(coord[0] + x, coord[1] + y, coord[2] + x, coord[3] + y, coord[4] + x, coord[5] + y); } else if (code == PathIterator.SEG_QUADTO) { eps.quadto(coord[0] + x, coord[1] + y, coord[2] + x, coord[3] + y); } else { throw new UnsupportedOperationException("code=" + code); } path.next(); } eps.fill(path.getWindingRule()); }
static void drawPathIterator(SvgGraphics svg, double x, double y, PathIterator path) { svg.newpath(); final double coord[] = new double[6]; while (path.isDone() == false) { final int code = path.currentSegment(coord); if (code == PathIterator.SEG_MOVETO) { svg.moveto(coord[0] + x, coord[1] + y); } else if (code == PathIterator.SEG_LINETO) { svg.lineto(coord[0] + x, coord[1] + y); } else if (code == PathIterator.SEG_CLOSE) { svg.closepath(); } else if (code == PathIterator.SEG_CUBICTO) { svg.curveto(coord[0] + x, coord[1] + y, coord[2] + x, coord[3] + y, coord[4] + x, coord[5] + y); } else if (code == PathIterator.SEG_QUADTO) { svg.quadto(coord[0] + x, coord[1] + y, coord[2] + x, coord[3] + y); } else { throw new UnsupportedOperationException("code=" + code); } path.next(); } svg.fill(path.getWindingRule()); }
public CachedPathIteratorFactory(PathIterator iterator) { mWindingRule = iterator.getWindingRule();
public int getWindingRule() { return delegate.getWindingRule(); }
public int getWindingRule() { return delegate.getWindingRule(); }
double[] coords = new double[6]; int pathSegmentType = pi.currentSegment(coords); int windingRule = pi.getWindingRule(); gp.setWindingRule(windingRule); if (pathSegmentType == PathIterator.SEG_MOVETO) {
double[] coords = new double[6]; int pathSegmentType = pi.currentSegment(coords); int windingRule = pi.getWindingRule(); gp.setWindingRule(windingRule); if (pathSegmentType == PathIterator.SEG_MOVETO) {
final GeneralPath path = new GeneralPath(it.getWindingRule()); final Point2D.Float ctrl = new Point2D.Float(); final double[] buffer = new double[6];
/** * Create an inverted path iterator from a standard one, keeping the winding rule. * * @param original original iterator */ public ReversePathIterator (PathIterator original) { this(original, original.getWindingRule()); }
/** * Returns the winding rule specified by the original iterator. */ @Override public int getWindingRule() { return iterator.getWindingRule(); }
/** * Create an inverted path iterator from a standard one, keeping the winding * rule. * * @param original original iterator */ public ReversePathIterator( final PathIterator original ) { this( original, original.getWindingRule() ); }
@Override public int getWindingRule() { return current.getWindingRule(); }
/** * Create an inverted path iterator from a standard one, keeping the winding rule. * * @param original * original iterator */ public ReversePathIterator( PathIterator original ) { this( original, original.getWindingRule() ); }
@Override public final int getWindingRule() { return src.getWindingRule(); }
public int getWindingRule() { return path.getWindingRule(); }
public int getWindingRule() { return pi.getWindingRule(); }
public void testCreateDynamicMark() throws Exception { PointSymbolizer symb = sf.createPointSymbolizer(); Mark myMark = sf.createMark(); final String ttfUrl = "ttf://Serif#${symb}"; myMark.setWellKnownName(ff.literal(ttfUrl)); symb.getGraphic().addMark(myMark); MarkStyle2D ms = (MarkStyle2D) sld.createStyle(feature, symb, range); assertNotNull(ms.getShape()); // make sure the style has been recognized as dynamic SymbolizerKey key = new SymbolizerKey(symb, range); assertTrue(sld.dynamicSymbolizers.containsKey(key)); Shape expected = new TTFMarkFactory().getShape(null, ff.literal("ttf://Serif#0xF054"), feature); // no general path equality implemented, we have to check manually PathIterator piExpected = expected.getPathIterator(new AffineTransform()); PathIterator pi = ms.getShape().getPathIterator(new AffineTransform()); double[] coordsExpected = new double[6]; double[] coords = new double[6]; assertEquals(piExpected.getWindingRule(), pi.getWindingRule()); while (!piExpected.isDone()) { assertFalse(pi.isDone()); piExpected.currentSegment(coordsExpected); pi.currentSegment(coords); assertEquals(coordsExpected[0], coords[0], 0.00001); assertEquals(coordsExpected[1], coords[1], 0.00001); piExpected.next(); pi.next(); } assertTrue(pi.isDone()); }
public static boolean isEvenOdd(Shape s) { return s.getPathIterator(null).getWindingRule() == PathIterator.WIND_EVEN_ODD; } }
public static boolean isEvenOdd(Shape s) { return s.getPathIterator(null).getWindingRule() == PathIterator.WIND_EVEN_ODD; } }