Catalano.Math.Geometry
Class RamerDouglasPeucker
- java.lang.Object
-
- Catalano.Math.Geometry.RamerDouglasPeucker
-
- All Implemented Interfaces:
- IShapeOptimizer
public class RamerDouglasPeucker extends java.lang.Object implements IShapeOptimizer
Ramer-Douglas-Peucker. Douglas–Peucker algorithm and iterative end-point fit algorithm, is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points.
-
-
Constructor Summary
Constructors Constructor and Description RamerDouglasPeucker()Initializes a new instance of the RamerDouglasPeucker class.RamerDouglasPeucker(double distanceThreshold)Initializes a new instance of the RamerDouglasPeucker class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetDistanceThreshold()Get distance threshold.java.util.List<IntPoint>OptimizeShape(java.util.List<IntPoint> shape)Optimize specified shape.voidsetDistanceThreshold(double distanceThreshold)Distance threshold.
-
-
-
Constructor Detail
-
RamerDouglasPeucker
public RamerDouglasPeucker()
Initializes a new instance of the RamerDouglasPeucker class.
-
RamerDouglasPeucker
public RamerDouglasPeucker(double distanceThreshold)
Initializes a new instance of the RamerDouglasPeucker class.- Parameters:
distanceThreshold- Distance threshold.
-
-
Method Detail
-
getDistanceThreshold
public double getDistanceThreshold()
Get distance threshold.- Returns:
- Distance threshold.
-
setDistanceThreshold
public void setDistanceThreshold(double distanceThreshold)
Distance threshold.- Parameters:
distanceThreshold- Distance threshold.
-
OptimizeShape
public java.util.List<IntPoint> OptimizeShape(java.util.List<IntPoint> shape)
Description copied from interface:IShapeOptimizerOptimize specified shape.- Specified by:
OptimizeShapein interfaceIShapeOptimizer- Parameters:
shape- Shape to be optimized.- Returns:
- Returns final optimized shape, which may have reduced amount of points.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG