Top Inners Fields Constructors Methods
jogamp.graph.geom.plane

public Class Crossing

extends Object
Class Inheritance
Imports
com.jogamp.opengl.math.FloatUtil

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Crossing.CubicCurve

CubicCurve class provides basic functionality to find curve crossing and calculating bounds

public static class
Crossing.QuadCurve

QuadCurve class provides basic functionality to find curve crossing and calculating bounds

Field Summary

Modifier and TypeField and Description
public static final int
CROSSING

Rectangle cross segment

pack-priv static final float
DELTA

Allowable tolerance for bounds comparison

pack-priv static final float
ROOT_DELTA

If roots have distance less then ROOT_DELTA they are double

pack-priv static final int
UNKNOWN

Unknown crossing result

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static int
crossBound(final float[] bound, final int bc, final float py1, final float py2)

Returns are bounds intersect or not intersect rectangle

public static int
crossCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float x, final float y)

Returns how many times ray from point (x,y) cross cubic curve

public static int
crossLine(final float x1, final float y1, final float x2, final float y2, final float x, final float y)

Returns how many times ray from point (x,y) cross line.

public static int
crossPath(final PathIterator p, final float x, final float y)

Returns how many times ray from point (x,y) cross path

public static int
crossQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float x, final float y)

Returns how many times ray from point (x,y) cross quard curve

public static int
crossShape(final Path2D s, final float x, final float y)

Returns how many times ray from point (x,y) cross shape

pack-priv static int

Returns:

new roots count
fixRoots
(final float[]
- the roots
res
,
final int
- the roots count
rc
)

Excludes float roots.

public static int
intersectCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2)

Returns how many times rectangle stripe cross cubic curve or the are intersect

public static int
intersectLine(final float x1, final float y1, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2)

Returns how many times rectangle stripe cross line or the are intersect

public static int
intersectPath(final PathIterator p, final float x, final float y, final float w, final float h)

Returns how many times rectangle stripe cross path or the are intersect

public static int
intersectQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2)

Returns how many times rectangle stripe cross quad curve or the are intersect

public static int
intersectShape(final Path2D s, final float x, final float y, final float w, final float h)

Returns how many times rectangle stripe cross shape or the are intersect

public static boolean
isInsideEvenOdd(final int cross)

Returns true if cross count correspond inside location for even-odd path rule

public static boolean
isInsideNonZero(final int cross)

Returns true if cross count correspond inside location for non zero path rule

public static boolean
isZero(final float val)

Returns true if value enough small

public static int

Returns:

a number of roots
solveCubic
(final float[]
- the coefficients of the equation
eqn
,
final float[]
- the roots of the equation
res
)

Solves cubic equation

public static int

Returns:

a number of roots
solveQuad
(final float[]
- the coefficients of the equation
eqn
,
final float[]
- the roots of the equation
res
)

Solves quadratic equation

pack-priv static void
sortBound(final float[] bound, final int bc)

Sort bound array

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CROSSINGback to summary
public static final int CROSSING

Rectangle cross segment

DELTAback to summary
pack-priv static final float DELTA

Allowable tolerance for bounds comparison

ROOT_DELTAback to summary
pack-priv static final float ROOT_DELTA

If roots have distance less then ROOT_DELTA they are double

UNKNOWNback to summary
pack-priv static final int UNKNOWN

Unknown crossing result

Constructor Detail

Crossingback to summary
public Crossing()

Method Detail

crossBoundback to summary
pack-priv static int crossBound(final float[] bound, final int bc, final float py1, final float py2)

Returns are bounds intersect or not intersect rectangle

crossCubicback to summary
public static int crossCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float x, final float y)

Returns how many times ray from point (x,y) cross cubic curve

crossLineback to summary
public static int crossLine(final float x1, final float y1, final float x2, final float y2, final float x, final float y)

Returns how many times ray from point (x,y) cross line.

crossPathback to summary
public static int crossPath(final PathIterator p, final float x, final float y)

Returns how many times ray from point (x,y) cross path

crossQuadback to summary
public static int crossQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float x, final float y)

Returns how many times ray from point (x,y) cross quard curve

crossShapeback to summary
public static int crossShape(final Path2D s, final float x, final float y)

Returns how many times ray from point (x,y) cross shape

fixRootsback to summary
pack-priv static int fixRoots(final float[] res, final int rc)

Excludes float roots. Roots are float if they lies enough close with each other.

Parameters
res:float[]

- the roots

rc:int

- the roots count

Returns:int

new roots count

intersectCubicback to summary
public static int intersectCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2)

Returns how many times rectangle stripe cross cubic curve or the are intersect

intersectLineback to summary
public static int intersectLine(final float x1, final float y1, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2)

Returns how many times rectangle stripe cross line or the are intersect

intersectPathback to summary
public static int intersectPath(final PathIterator p, final float x, final float y, final float w, final float h)

Returns how many times rectangle stripe cross path or the are intersect

intersectQuadback to summary
public static int intersectQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2)

Returns how many times rectangle stripe cross quad curve or the are intersect

intersectShapeback to summary
public static int intersectShape(final Path2D s, final float x, final float y, final float w, final float h)

Returns how many times rectangle stripe cross shape or the are intersect

isInsideEvenOddback to summary
public static boolean isInsideEvenOdd(final int cross)

Returns true if cross count correspond inside location for even-odd path rule

isInsideNonZeroback to summary
public static boolean isInsideNonZero(final int cross)

Returns true if cross count correspond inside location for non zero path rule

isZeroback to summary
public static boolean isZero(final float val)

Returns true if value enough small

solveCubicback to summary
public static int solveCubic(final float[] eqn, final float[] res)

Solves cubic equation

Parameters
eqn:float[]

- the coefficients of the equation

res:float[]

- the roots of the equation

Returns:int

a number of roots

solveQuadback to summary
public static int solveQuad(final float[] eqn, final float[] res)

Solves quadratic equation

Parameters
eqn:float[]

- the coefficients of the equation

res:float[]

- the roots of the equation

Returns:int

a number of roots

sortBoundback to summary
pack-priv static void sortBound(final float[] bound, final int bc)

Sort bound array

jogamp.graph.geom.plane back to summary

public Class Crossing.CubicCurve

extends Object
Class Inheritance

CubicCurve class provides basic functionality to find curve crossing and calculating bounds

Field Summary

Modifier and TypeField and Description
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float

Constructor Summary

AccessConstructor and Description
public
CubicCurve(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
addBound(final float[] bound, int bc, final float[] res, final int rc, final float minX, final float maxX, final boolean changeId, int id)

pack-priv int
cross(final float[] res, final int rc, final float py1, final float py2)

pack-priv int
solveExtremX(final float[] res)

pack-priv int
solveExtremY(final float[] res)

pack-priv int
solvePoint(final float[] res, final float px)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

axback to summary
pack-priv float ax
Axback to summary
pack-priv float Ax
Ax3back to summary
pack-priv float Ax3
ayback to summary
pack-priv float ay
Ayback to summary
pack-priv float Ay
bxback to summary
pack-priv float bx
Bxback to summary
pack-priv float Bx
Bx2back to summary
pack-priv float Bx2
byback to summary
pack-priv float by
Byback to summary
pack-priv float By
cxback to summary
pack-priv float cx
Cxback to summary
pack-priv float Cx
cyback to summary
pack-priv float cy
Cyback to summary
pack-priv float Cy

Constructor Detail

CubicCurveback to summary
public CubicCurve(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2)

Method Detail

addBoundback to summary
pack-priv int addBound(final float[] bound, int bc, final float[] res, final int rc, final float minX, final float maxX, final boolean changeId, int id)
crossback to summary
pack-priv int cross(final float[] res, final int rc, final float py1, final float py2)
solveExtremXback to summary
pack-priv int solveExtremX(final float[] res)
solveExtremYback to summary
pack-priv int solveExtremY(final float[] res)
solvePointback to summary
pack-priv int solvePoint(final float[] res, final float px)
jogamp.graph.geom.plane back to summary

public Class Crossing.QuadCurve

extends Object
Class Inheritance

QuadCurve class provides basic functionality to find curve crossing and calculating bounds

Field Summary

Modifier and TypeField and Description
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float
pack-priv float

Constructor Summary

AccessConstructor and Description
public
QuadCurve(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
addBound(final float[] bound, int bc, final float[] res, final int rc, final float minX, final float maxX, final boolean changeId, int id)

pack-priv int
cross(final float[] res, final int rc, final float py1, final float py2)

pack-priv int
solveExtrem(final float[] res)

pack-priv int
solvePoint(final float[] res, final float px)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

axback to summary
pack-priv float ax
Axback to summary
pack-priv float Ax
ayback to summary
pack-priv float ay
Ayback to summary
pack-priv float Ay
bxback to summary
pack-priv float bx
Bxback to summary
pack-priv float Bx
byback to summary
pack-priv float by
Byback to summary
pack-priv float By

Constructor Detail

QuadCurveback to summary
public QuadCurve(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2)

Method Detail

addBoundback to summary
pack-priv int addBound(final float[] bound, int bc, final float[] res, final int rc, final float minX, final float maxX, final boolean changeId, int id)
crossback to summary
pack-priv int cross(final float[] res, final int rc, final float py1, final float py2)
solveExtremback to summary
pack-priv int solveExtrem(final float[] res)
solvePointback to summary
pack-priv int solvePoint(final float[] res, final float px)