public abstract class AbstractSmoother extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractSmoother.InterpPoint
Class to hold interpolation parameters for a given point.
|
| Modifier and Type | Field and Description |
|---|---|
protected SmootherControl |
control
The current SmootherControl instance.
|
static SmootherControl |
DEFAULT_CONTROL
Default smoothing control.
|
protected org.locationtech.jts.geom.GeometryFactory |
geomFactory
The current
GeometryFactory being used. |
protected Map<Integer,WeakReference<AbstractSmoother.InterpPoint[]>> |
lookup
Cache of previously calculated interpolation parameters
|
| Constructor and Description |
|---|
AbstractSmoother(org.locationtech.jts.geom.GeometryFactory geomFactory)
Creates a new smoother that will use the given
GeometryFactory. |
| Modifier and Type | Method and Description |
|---|---|
protected org.locationtech.jts.geom.Coordinate[] |
cubicBezier(org.locationtech.jts.geom.Coordinate start,
org.locationtech.jts.geom.Coordinate end,
org.locationtech.jts.geom.Coordinate ctrl1,
org.locationtech.jts.geom.Coordinate ctrl2,
int nv)
Calculates vertices along a cubic Bazier curve given start point, end point
and two control points.
|
protected AbstractSmoother.InterpPoint[] |
getInterpPoints(int npoints)
Gets the interpolation parameters for a Bezier curve approximated
by the given number of vertices.
|
void |
setControl(SmootherControl control)
Sets a new
Control object to for smoothing. |
public static final SmootherControl DEFAULT_CONTROL
protected SmootherControl control
protected final org.locationtech.jts.geom.GeometryFactory geomFactory
GeometryFactory being used.protected Map<Integer,WeakReference<AbstractSmoother.InterpPoint[]>> lookup
public AbstractSmoother(org.locationtech.jts.geom.GeometryFactory geomFactory)
GeometryFactory.geomFactory - factory to use for creating smoothed objectsIllegalArgumentException - if geomFactory is nullpublic void setControl(SmootherControl control)
Control object to for smoothing.control - the control to use for smoothing; if null the
default control will be setprotected org.locationtech.jts.geom.Coordinate[] cubicBezier(org.locationtech.jts.geom.Coordinate start,
org.locationtech.jts.geom.Coordinate end,
org.locationtech.jts.geom.Coordinate ctrl1,
org.locationtech.jts.geom.Coordinate ctrl2,
int nv)
start - start positionend - end positionctrl1 - first control pointctrl2 - second control pointnv - number of vertices including the start and end pointsprotected AbstractSmoother.InterpPoint[] getInterpPoints(int npoints)
npoints - number of verticesInterpPoint objects holding the parameter valuesCopyright © 2009–2020. All rights reserved.