abstract class AbstractConvexHullGenerator2D extends java.lang.Object implements ConvexHullGenerator2D
Modifier and Type | Field and Description |
---|---|
private static double |
DEFAULT_TOLERANCE
Default value for tolerance.
|
private boolean |
includeCollinearPoints
Indicates if collinear points on the hull shall be present in the output.
|
private double |
tolerance
Tolerance below which points are considered identical.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractConvexHullGenerator2D(boolean includeCollinearPoints)
Simple constructor.
|
protected |
AbstractConvexHullGenerator2D(boolean includeCollinearPoints,
double tolerance)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract java.util.Collection<Vector2D> |
findHullVertices(java.util.Collection<Vector2D> points)
Find the convex hull vertices from the set of input points.
|
ConvexHull2D |
generate(java.util.Collection<Vector2D> points)
Builds the convex hull from the set of input points.
|
double |
getTolerance()
Get the tolerance below which points are considered identical.
|
boolean |
isIncludeCollinearPoints()
Returns if collinear points on the hull will be added as hull vertices.
|
private static final double DEFAULT_TOLERANCE
private final double tolerance
private final boolean includeCollinearPoints
false
, only the extreme points are added to the hull.protected AbstractConvexHullGenerator2D(boolean includeCollinearPoints)
The default tolerance (1e-10) will be used to determine identical points.
includeCollinearPoints
- indicates if collinear points on the hull shall be
added as hull verticesprotected AbstractConvexHullGenerator2D(boolean includeCollinearPoints, double tolerance)
includeCollinearPoints
- indicates if collinear points on the hull shall be
added as hull verticestolerance
- tolerance below which points are considered identicalpublic double getTolerance()
public boolean isIncludeCollinearPoints()
true
if collinear points are added as hull vertices, or false
if only extreme points are present.public ConvexHull2D generate(java.util.Collection<Vector2D> points) throws NullArgumentException, ConvergenceException
generate
in interface ConvexHullGenerator2D
generate
in interface ConvexHullGenerator<Euclidean2D,Vector2D>
points
- the set of input pointsNullArgumentException
- if the input collection is null
ConvergenceException
- if generator fails to generate a convex hull for
the given set of input pointsCopyright (c) 2003-2014 Apache Software Foundation