001: /*
002:
003: Licensed to the Apache Software Foundation (ASF) under one or more
004: contributor license agreements. See the NOTICE file distributed with
005: this work for additional information regarding copyright ownership.
006: The ASF licenses this file to You under the Apache License, Version 2.0
007: (the "License"); you may not use this file except in compliance with
008: the License. You may obtain a copy of the License at
009:
010: http://www.apache.org/licenses/LICENSE-2.0
011:
012: Unless required by applicable law or agreed to in writing, software
013: distributed under the License is distributed on an "AS IS" BASIS,
014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: See the License for the specific language governing permissions and
016: limitations under the License.
017:
018: */
019: package org.apache.batik.ext.awt.geom;
020:
021: import java.awt.geom.PathIterator;
022:
023: /**
024: * The <code>ExtendedPathIterator</code> class represents a geometric
025: * path constructed from straight lines, quadratic and cubic (Bezier)
026: * curves and elliptical arcs. This interface is identical to that of
027: * PathIterator except it can return SEG_ARCTO from currentSegment,
028: * also the array of values passed to currentSegment must be of length
029: * 7 or an error will be thrown.
030: *
031: * This does not extend PathIterator as it would break the interface
032: * contract for that class.
033: *
034: * @author <a href="mailto:deweese@apache.org">Thomas DeWeese</a>
035: * @version $Id: ExtendedPathIterator.java 475477 2006-11-15 22:44:28Z cam $
036: */
037: public interface ExtendedPathIterator {
038:
039: /**
040: * The segment type constant that specifies that the preceding
041: * subpath should be closed by appending a line segment back to
042: * the point corresponding to the most recent SEG_MOVETO.
043: */
044: int SEG_CLOSE = PathIterator.SEG_CLOSE;
045:
046: /**
047: * The segment type constant for a point that specifies the end
048: * point of a line to be drawn from the most recently specified
049: * point. */
050: int SEG_MOVETO = PathIterator.SEG_MOVETO;
051:
052: /**
053: * The segment type constant for a point that specifies the end
054: * point of a line to be drawn from the most recently specified
055: * point.
056: */
057: int SEG_LINETO = PathIterator.SEG_LINETO;
058:
059: /**
060: * The segment type constant for the pair of points that specify a
061: * quadratic parametric curve to be drawn from the most recently
062: * specified point. The curve is interpolated by solving the
063: * parametric control equation in the range (t=[0..1]) using the
064: * most recently specified (current) point (CP), the first control
065: * point (P1), and the final interpolated control point (P2).
066: */
067: int SEG_QUADTO = PathIterator.SEG_QUADTO;
068:
069: /**
070: * The segment type constant for the set of 3 points that specify
071: * a cubic parametric curve to be drawn from the most recently
072: * specified point. The curve is interpolated by solving the
073: * parametric control equation in the range (t=[0..1]) using the
074: * most recently specified (current) point (CP), the first control
075: * point (P1), the second control point (P2), and the final
076: * interpolated control point (P3).
077: */
078: int SEG_CUBICTO = PathIterator.SEG_CUBICTO;
079:
080: /** The segment type constant for an elliptical arc. This consists of
081: * Seven values [rx, ry, angle, largeArcFlag, sweepFlag, x, y].
082: * rx, ry are the radious of the ellipse.
083: * angle is angle of the x axis of the ellipse.
084: * largeArcFlag is zero if the smaller of the two arcs are to be used.
085: * sweepFlag is zero if the 'left' branch is taken one otherwise.
086: * x and y are the destination for the ellipse. */
087: int SEG_ARCTO = 4321;
088:
089: /** The winding rule constant for specifying an even-odd rule for
090: * determining the interior of a path. The even-odd rule specifies
091: * that a point lies inside the path if a ray drawn in any
092: * direction from that point to infinity is crossed by path
093: * segments an odd number of times.
094: */
095: int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD;
096:
097: /**
098: * The winding rule constant for specifying a non-zero rule for
099: * determining the interior of a path. The non-zero rule specifies
100: * that a point lies inside the path if a ray drawn in any
101: * direction from that point to infinity is crossed by path
102: * segments a different number of times in the counter-clockwise
103: * direction than the clockwise direction.
104: */
105: int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO;
106:
107: int currentSegment();
108:
109: int currentSegment(double[] coords);
110:
111: int currentSegment(float[] coords);
112:
113: int getWindingRule();
114:
115: boolean isDone();
116:
117: void next();
118: }
|