Package com.itextpdf.awt.geom.gl
Class Crossing
- java.lang.Object
-
- com.itextpdf.awt.geom.gl.Crossing
-
public class Crossing extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Crossing.CubicCurve
CubicCurve class provides basic functionality to find curve crossing and calculating boundsstatic class
Crossing.QuadCurve
QuadCurve class provides basic functionality to find curve crossing and calculating bounds
-
Field Summary
Fields Modifier and Type Field Description static int
CROSSING
Rectangle cross segment(package private) static double
DELTA
Allowable tolerance for bounds comparison(package private) static double
ROOT_DELTA
If roots have distance less thenROOT_DELTA
they are double(package private) static int
UNKNOWN
Unknown crossing result
-
Constructor Summary
Constructors Constructor Description Crossing()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static int
crossBound(double[] bound, int bc, double py1, double py2)
Returns are bounds intersect or not intersect rectanglestatic int
crossCubic(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2, double x, double y)
Returns how many times ray from point (x,y) cross cubic curvestatic int
crossLine(double x1, double y1, double x2, double y2, double x, double y)
Returns how many times ray from point (x,y) cross line.static int
crossPath(PathIterator p, double x, double y)
Returns how many times ray from point (x,y) cross pathstatic int
crossQuad(double x1, double y1, double cx, double cy, double x2, double y2, double x, double y)
Returns how many times ray from point (x,y) cross quard curvestatic int
crossShape(Shape s, double x, double y)
Returns how many times ray from point (x,y) cross shape(package private) static int
fixRoots(double[] res, int rc)
Excludes double roots.static int
intersectCubic(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2, double rx1, double ry1, double rx2, double ry2)
Returns how many times rectangle stripe cross cubic curve or the are intersectstatic int
intersectLine(double x1, double y1, double x2, double y2, double rx1, double ry1, double rx2, double ry2)
Returns how many times rectangle stripe cross line or the are intersectstatic int
intersectPath(PathIterator p, double x, double y, double w, double h)
Returns how many times rectangle stripe cross path or the are intersectstatic int
intersectQuad(double x1, double y1, double cx, double cy, double x2, double y2, double rx1, double ry1, double rx2, double ry2)
Returns how many times rectangle stripe cross quad curve or the are intersectstatic int
intersectShape(Shape s, double x, double y, double w, double h)
Returns how many times rectangle stripe cross shape or the are intersectstatic boolean
isInsideEvenOdd(int cross)
Returns true if cross count correspond inside location for even-odd path rulestatic boolean
isInsideNonZero(int cross)
Returns true if cross count correspond inside location for non zero path rulestatic boolean
isZero(double val)
Returns true if value enough smallstatic int
solveCubic(double[] eqn, double[] res)
Solves cubic equationstatic int
solveQuad(double[] eqn, double[] res)
Solves quadratic equation(package private) static void
sortBound(double[] bound, int bc)
Sort bound array
-
-
-
Field Detail
-
DELTA
static final double DELTA
Allowable tolerance for bounds comparison- See Also:
- Constant Field Values
-
ROOT_DELTA
static final double ROOT_DELTA
If roots have distance less thenROOT_DELTA
they are double- See Also:
- Constant Field Values
-
CROSSING
public static final int CROSSING
Rectangle cross segment- See Also:
- Constant Field Values
-
UNKNOWN
static final int UNKNOWN
Unknown crossing result- See Also:
- Constant Field Values
-
-
Method Detail
-
solveQuad
public static int solveQuad(double[] eqn, double[] res)
Solves quadratic equation- Parameters:
eqn
- - the coefficients of the equationres
- - the roots of the equation- Returns:
- a number of roots
-
solveCubic
public static int solveCubic(double[] eqn, double[] res)
Solves cubic equation- Parameters:
eqn
- - the coefficients of the equationres
- - the roots of the equation- Returns:
- a number of roots
-
fixRoots
static int fixRoots(double[] res, int rc)
Excludes double roots. Roots are double if they lies enough close with each other.- Parameters:
res
- - the rootsrc
- - the roots count- Returns:
- new roots count
-
crossLine
public static int crossLine(double x1, double y1, double x2, double y2, double x, double y)
Returns how many times ray from point (x,y) cross line.
-
crossQuad
public static int crossQuad(double x1, double y1, double cx, double cy, double x2, double y2, double x, double y)
Returns how many times ray from point (x,y) cross quard curve
-
crossCubic
public static int crossCubic(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2, double x, double y)
Returns how many times ray from point (x,y) cross cubic curve
-
crossPath
public static int crossPath(PathIterator p, double x, double y)
Returns how many times ray from point (x,y) cross path
-
crossShape
public static int crossShape(Shape s, double x, double y)
Returns how many times ray from point (x,y) cross shape
-
isZero
public static boolean isZero(double val)
Returns true if value enough small
-
sortBound
static void sortBound(double[] bound, int bc)
Sort bound array
-
crossBound
static int crossBound(double[] bound, int bc, double py1, double py2)
Returns are bounds intersect or not intersect rectangle
-
intersectLine
public static int intersectLine(double x1, double y1, double x2, double y2, double rx1, double ry1, double rx2, double ry2)
Returns how many times rectangle stripe cross line or the are intersect
-
intersectQuad
public static int intersectQuad(double x1, double y1, double cx, double cy, double x2, double y2, double rx1, double ry1, double rx2, double ry2)
Returns how many times rectangle stripe cross quad curve or the are intersect
-
intersectCubic
public static int intersectCubic(double x1, double y1, double cx1, double cy1, double cx2, double cy2, double x2, double y2, double rx1, double ry1, double rx2, double ry2)
Returns how many times rectangle stripe cross cubic curve or the are intersect
-
intersectPath
public static int intersectPath(PathIterator p, double x, double y, double w, double h)
Returns how many times rectangle stripe cross path or the are intersect
-
intersectShape
public static int intersectShape(Shape s, double x, double y, double w, double h)
Returns how many times rectangle stripe cross shape or the are intersect
-
isInsideNonZero
public static boolean isInsideNonZero(int cross)
Returns true if cross count correspond inside location for non zero path rule
-
isInsideEvenOdd
public static boolean isInsideEvenOdd(int cross)
Returns true if cross count correspond inside location for even-odd path rule
-
-