Package sec.sun.awt.geom
Class Curve
java.lang.Object
sec.sun.awt.geom.Curve
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intThe rectangle intersection test counts the number of times that the path crosses through the shadow that the rectangle projects to the right towards (x => +INFINITY).static final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longdiffbits(double y1, double y2) static booleanfairlyClose(double v1, double v2) static voidinsertCubic(Vector curves, double x0, double y0, double[] coords) static voidinsertLine(Vector curves, double x0, double y0, double x1, double y1) static voidinsertMove(Vector curves, double x, double y) static voidinsertQuad(Vector curves, double x0, double y0, double[] coords) static doublenext(double v) static intorderof(double x1, double x2) static intpointCrossingsForCubic(double px, double py, double x0, double y0, double xc0, double yc0, double xc1, double yc1, double x1, double y1, int level) Calculates the number of times the cubic from (x0,y0) to (x1,y1) crosses the ray extending to the right from (px,py).static intpointCrossingsForLine(double px, double py, double x0, double y0, double x1, double y1) Calculates the number of times the line from (x0,y0) to (x1,y1) crosses the ray extending to the right from (px,py).static intpointCrossingsForPath(PathIterator pi, double px, double py) Calculates the number of times the given path crosses the ray extending to the right from (px,py).static intpointCrossingsForQuad(double px, double py, double x0, double y0, double xc, double yc, double x1, double y1, int level) Calculates the number of times the quad from (x0,y0) to (x1,y1) crosses the ray extending to the right from (px,py).static doubleprev(double v) static intrectCrossingsForCubic(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double xc0, double yc0, double xc1, double yc1, double x1, double y1, int level) Accumulate the number of times the cubic crosses the shadow extending to the right of the rectangle.static intrectCrossingsForLine(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double x1, double y1) Accumulate the number of times the line crosses the shadow extending to the right of the rectangle.static intrectCrossingsForPath(PathIterator pi, double rxmin, double rymin, double rxmax, double rymax) Accumulate the number of times the path crosses the shadow extending to the right of the rectangle.static intrectCrossingsForQuad(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double xc, double yc, double x1, double y1, int level) Accumulate the number of times the quad crosses the shadow extending to the right of the rectangle.static doubleround(double v) static longsigneddiffbits(double y1, double y2) static intsolveQuadratic(double[] eqn, double[] res) Solves the quadratic whose coefficients are in theeqnarray and places the non-complex roots into theresarray, returning the number of roots.
-
Field Details
-
INCREASING
- See Also:
-
DECREASING
- See Also:
-
RECT_INTERSECTS
The rectangle intersection test counts the number of times that the path crosses through the shadow that the rectangle projects to the right towards (x => +INFINITY). During processing of the path it actually counts every time the path crosses either or both of the top and bottom edges of that shadow. If the path enters from the top, the count is incremented. If it then exits back through the top, the same way it came in, the count is decremented and there is no impact on the winding count. If, instead, the path exits out the bottom, then the count is incremented again and a full pass through the shadow is indicated by the winding count having been incremented by 2. Thus, the winding count that it accumulates is actually double the real winding count. Since the path is continuous, the final answer should be a multiple of 2, otherwise there is a logic error somewhere. If the path ever has a direct hit on the rectangle, then a special value is returned. This special value terminates all ongoing accumulation on up through the call chain and ends up getting returned to the calling function which can then produce an answer directly. For intersection tests, the answer is always "true" if the path intersects the rectangle. For containment tests, the answer is always "false" if the path intersects the rectangle. Thus, no further processing is ever needed if an intersection occurs.- See Also:
-
TMIN
- See Also:
-
-
Constructor Details
-
Curve
public Curve()
-
-
Method Details
-
insertMove
-
insertLine
-
insertQuad
-
insertCubic
-
pointCrossingsForPath
Calculates the number of times the given path crosses the ray extending to the right from (px,py). If the point lies on a part of the path, then no crossings are counted for that intersection. +1 is added for each crossing where the Y coordinate is increasing -1 is added for each crossing where the Y coordinate is decreasing The return value is the sum of all crossings for every segment in the path. The path must start with a SEG_MOVETO, otherwise an exception is thrown. The caller must check p[xy] for NaN values. The caller may also reject infinite p[xy] values as well. -
pointCrossingsForLine
public static int pointCrossingsForLine(double px, double py, double x0, double y0, double x1, double y1) Calculates the number of times the line from (x0,y0) to (x1,y1) crosses the ray extending to the right from (px,py). If the point lies on the line, then no crossings are recorded. +1 is returned for a crossing where the Y coordinate is increasing -1 is returned for a crossing where the Y coordinate is decreasing -
pointCrossingsForQuad
public static int pointCrossingsForQuad(double px, double py, double x0, double y0, double xc, double yc, double x1, double y1, int level) Calculates the number of times the quad from (x0,y0) to (x1,y1) crosses the ray extending to the right from (px,py). If the point lies on a part of the curve, then no crossings are counted for that intersection. the level parameter should be 0 at the top-level call and will count up for each recursion level to prevent infinite recursion +1 is added for each crossing where the Y coordinate is increasing -1 is added for each crossing where the Y coordinate is decreasing -
pointCrossingsForCubic
public static int pointCrossingsForCubic(double px, double py, double x0, double y0, double xc0, double yc0, double xc1, double yc1, double x1, double y1, int level) Calculates the number of times the cubic from (x0,y0) to (x1,y1) crosses the ray extending to the right from (px,py). If the point lies on a part of the curve, then no crossings are counted for that intersection. the level parameter should be 0 at the top-level call and will count up for each recursion level to prevent infinite recursion +1 is added for each crossing where the Y coordinate is increasing -1 is added for each crossing where the Y coordinate is decreasing -
rectCrossingsForPath
public static int rectCrossingsForPath(PathIterator pi, double rxmin, double rymin, double rxmax, double rymax) Accumulate the number of times the path crosses the shadow extending to the right of the rectangle. See the comment for the RECT_INTERSECTS constant for more complete details. The return value is the sum of all crossings for both the top and bottom of the shadow for every segment in the path, or the special value RECT_INTERSECTS if the path ever enters the interior of the rectangle. The path must start with a SEG_MOVETO, otherwise an exception is thrown. The caller must check r[xy]{min,max} for NaN values. -
rectCrossingsForLine
public static int rectCrossingsForLine(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double x1, double y1) Accumulate the number of times the line crosses the shadow extending to the right of the rectangle. See the comment for the RECT_INTERSECTS constant for more complete details. -
rectCrossingsForQuad
public static int rectCrossingsForQuad(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double xc, double yc, double x1, double y1, int level) Accumulate the number of times the quad crosses the shadow extending to the right of the rectangle. See the comment for the RECT_INTERSECTS constant for more complete details. -
rectCrossingsForCubic
public static int rectCrossingsForCubic(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double xc0, double yc0, double xc1, double yc1, double x1, double y1, int level) Accumulate the number of times the cubic crosses the shadow extending to the right of the rectangle. See the comment for the RECT_INTERSECTS constant for more complete details. -
round
-
orderof
-
signeddiffbits
-
diffbits
-
prev
-
next
-
fairlyClose
-
solveQuadratic
Solves the quadratic whose coefficients are in theeqnarray and places the non-complex roots into theresarray, returning the number of roots. The quadratic solved is represented by the equation:eqn = {C, B, A}; ax^2 + bx + c = 0A return value of-1is used to distinguish a constant equation, which might be always 0 or never 0, from an equation that has no zeroes.- Parameters:
eqn- the specified array of coefficients to use to solve the quadratic equationres- the array that contains the non-complex roots resulting from the solution of the quadratic equation- Returns:
- the number of roots, or
-1if the equation is a constant. - Since:
- 1.3
-