public class GeomUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
GeomUtil.HitResult
A lightweigtht description of a intersection between a shape and
line.
|
Modifier and Type | Field and Description |
---|---|
float |
EDGE_SCALE
The tolerance for determining direction change
|
float |
EPSILON
The tolerance for determining changes and steps
|
GeomUtilListener |
listener
The listener to notify of operations
|
int |
MAX_POINTS
The maximum number of points returned by an operation - prevents full lockups
|
Constructor and Description |
---|
GeomUtil() |
Modifier and Type | Method and Description |
---|---|
Line |
getLine(Shape shape,
float sx,
float sy,
int e)
Get a line between two points in a shape
|
Line |
getLine(Shape shape,
int s,
int e)
Get a line between two points in a shape
|
GeomUtil.HitResult |
intersect(Shape shape,
Line line)
Intersect a line with a shape
|
static int |
rationalPoint(Shape shape,
int p)
Rationalise a point in terms of a given shape
|
void |
setListener(GeomUtilListener listener)
Set the listener to be notified of geometry based operations
|
Shape[] |
subtract(Shape target,
Shape missing)
Subtract one shape from another - note this is experimental and doesn't
currently handle islands
|
Shape[] |
union(Shape target,
Shape other)
Join to shapes together.
|
public float EPSILON
public float EDGE_SCALE
public int MAX_POINTS
public GeomUtilListener listener
public Shape[] subtract(Shape target, Shape missing)
target
- The target to be subtracted frommissing
- The shape to subtractpublic void setListener(GeomUtilListener listener)
listener
- The listener to be notified of geometry based operationspublic Shape[] union(Shape target, Shape other)
target
- The target shape to union withother
- The additional shape to unionpublic GeomUtil.HitResult intersect(Shape shape, Line line)
shape
- The shape to compareline
- The line to intersect against the shapepublic static int rationalPoint(Shape shape, int p)
shape
- The shapep
- The index of the pointpublic Line getLine(Shape shape, int s, int e)
shape
- The shapes
- The index of the start pointe
- The index of the end point