|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.erichseifert.gral.util.GeometryUtils
public abstract class GeometryUtils
Abstract class that represents a collection of utility functions concerning geometry.
Field Summary | |
---|---|
static double |
EPSILON
Precision |
static double |
EPSILON_SQ
Precision squared |
Constructor Summary | |
---|---|
GeometryUtils()
|
Method Summary | |
---|---|
static Area |
grow(Shape s,
double offset)
Expand or shrink a shape in all directions by a defined offset. |
static Area |
grow(Shape s,
double offset,
int join,
float miterlimit)
Expand or shrink a shape in all directions by a defined offset. |
static Point2D |
intersection(Line2D l1,
Line2D l2)
Returns the intersection point of two lines. |
static List<Point2D> |
intersection(Shape s1,
Shape s2)
Returns all intersection points of two shapes. |
static Area |
punch(Shape shape,
double gap,
boolean rounded,
Iterable<DataPoint> dataPoints)
Subtract all shapes of data points from another shape to yield gaps. |
static Line2D[] |
shapeToLines(Shape path,
boolean swapped)
Returns the line fragments of the specified Shape. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double EPSILON
public static final double EPSILON_SQ
Constructor Detail |
---|
public GeometryUtils()
Method Detail |
---|
public static Line2D[] shapeToLines(Shape path, boolean swapped)
path
- Shape to be divided.swapped
- Invert segment direction.
public static List<Point2D> intersection(Shape s1, Shape s2)
s1
- First shapes2
- Second shape
public static Point2D intersection(Line2D l1, Line2D l2)
l1
- First linel2
- Second line
null
if
no intersection was foundpublic static Area grow(Shape s, double offset)
s
- Shapeoffset
- Offset
public static Area grow(Shape s, double offset, int join, float miterlimit)
s
- Shapeoffset
- Offset to expand/shrinkjoin
- Method for handling edges (see BasicStroke)miterlimit
- Limit for miter joining method
public static Area punch(Shape shape, double gap, boolean rounded, Iterable<DataPoint> dataPoints)
shape
- Shape from which to subtract.gap
- Size of the gap.rounded
- Gap corners will be rounded if true
.dataPoints
- Collection of data points
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |