public class GenericQuadSubdivCriterion extends Object implements QuadSubdivisionCriterion
QuadSubdivisionCriterion which does its job by using a
provided QuadFlatnessAlgorithm and a tolerance:
the criterion will ask for yet one subdivision whenever
algorithm returns a flatness value that's greater than
the required tolerance.| Modifier and Type | Field and Description |
|---|---|
protected QuadFlatnessAlgorithm |
flatnessAlgo
The flatness algorithm.
|
protected double |
sqTol
Squared tolerance, for the
QuadFlatnessAlgorithm
that prefers
working with squared distances. |
protected double |
tol
The tolerance.
|
| Constructor and Description |
|---|
GenericQuadSubdivCriterion()
Initialises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and a tolerance of 1.0e-5. |
GenericQuadSubdivCriterion(double tolerance)
Initialises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and the provided tolerance. |
GenericQuadSubdivCriterion(QuadFlatnessAlgorithm algo)
Initialises
a new instance the provided flatness algo
and a tolerance of 1.0e-5. |
GenericQuadSubdivCriterion(QuadFlatnessAlgorithm algo,
double tolerance)
Initialises
using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldSplit(QuadCurve2D curve)
Returns
true whenever the flatnessAlgo
returns a value greater than the required tolerance. |
protected QuadFlatnessAlgorithm flatnessAlgo
protected double tol
protected double sqTol
QuadFlatnessAlgorithm
that prefers
working with squared distances.public GenericQuadSubdivCriterion()
Initialises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and a tolerance of 1.0e-5.public GenericQuadSubdivCriterion(double tolerance)
Initialises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and the provided tolerance.public GenericQuadSubdivCriterion(QuadFlatnessAlgorithm algo)
Initialises
a new instance the provided flatness algo
and a tolerance of 1.0e-5.public GenericQuadSubdivCriterion(QuadFlatnessAlgorithm algo, double tolerance)
Initialises
using the provided parameters.public boolean shouldSplit(QuadCurve2D curve)
true whenever the flatnessAlgo
returns a value greater than the required tolerance.
If the flatness algorithm prefers
the computation of squared distances, the comparison is
made against the squared tolerance.shouldSplit in interface QuadSubdivisionCriterionCopyright © 2016. All rights reserved.