Class Smoother
- java.lang.Object
-
- com.macrofocus.treemap.voronoi.smoothing.Smoother
-
public class Smoother extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Smoother()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.geom.GeneralPathcreateGeneralPath(java.util.List<SmoothedSegment> smoothedSegments)static java.util.Map<java.lang.Double,Point2d>createSamples(java.awt.geom.CubicCurve2D curve)static SmoothedSegmentcreateSmoothedSegment(SmoothedSegment commonSegment, SegmentLocation start, SegmentLocation end, Vertex startVertex, Vertex endVertex)static voidgetBezierLocation(java.awt.geom.CubicCurve2D curve, double t, Point2d sampleLocation)static doublegetDiagonalLength(java.awt.Rectangle bounds)static CurveLocationgetNearestCurveLocation(Vertex vertex, java.awt.geom.CubicCurve2D curve, java.util.Map<java.lang.Double,Point2d> samples, SmoothedSegment smoothedSegment)static java.awt.geom.CubicCurve2DgetSubCruveFromP1(CurveLocation curveLocation, java.awt.geom.CubicCurve2D curve)static java.awt.geom.CubicCurve2DgetSubCruveToP2(CurveLocation curveLocation, java.awt.geom.CubicCurve2D curve)static CurveLocationgetTheOneCloserToP1(CurveLocation l1, CurveLocation l2, java.awt.geom.CubicCurve2D curve)static SegmentLocationgetTheOneCloserToP2(CurveLocation l1, CurveLocation l2, java.awt.geom.CubicCurve2D curve)static java.awt.geom.CubicCurve2DnewCubicCurve2D(java.lang.Class<? extends java.awt.geom.CubicCurve2D> curveType)Creates a new instance of CubicCurve2D while the specific type CubicCurve2D.Float or CubicCurve2D.Double.static voidreverse(java.awt.geom.CubicCurve2D curve)static java.util.Map<java.lang.Double,Point2d>sample(java.awt.geom.CubicCurve2D curve, int nSamples)
-
-
-
Method Detail
-
createSmoothedSegment
public static SmoothedSegment createSmoothedSegment(SmoothedSegment commonSegment, SegmentLocation start, SegmentLocation end, Vertex startVertex, Vertex endVertex)
-
getNearestCurveLocation
public static CurveLocation getNearestCurveLocation(Vertex vertex, java.awt.geom.CubicCurve2D curve, java.util.Map<java.lang.Double,Point2d> samples, SmoothedSegment smoothedSegment)
-
createSamples
public static java.util.Map<java.lang.Double,Point2d> createSamples(java.awt.geom.CubicCurve2D curve)
-
getDiagonalLength
public static double getDiagonalLength(java.awt.Rectangle bounds)
-
sample
public static java.util.Map<java.lang.Double,Point2d> sample(java.awt.geom.CubicCurve2D curve, int nSamples)
-
getBezierLocation
public static void getBezierLocation(java.awt.geom.CubicCurve2D curve, double t, Point2d sampleLocation)
-
reverse
public static void reverse(java.awt.geom.CubicCurve2D curve)
-
getTheOneCloserToP1
public static CurveLocation getTheOneCloserToP1(CurveLocation l1, CurveLocation l2, java.awt.geom.CubicCurve2D curve)
-
getTheOneCloserToP2
public static SegmentLocation getTheOneCloserToP2(CurveLocation l1, CurveLocation l2, java.awt.geom.CubicCurve2D curve)
-
getSubCruveFromP1
public static java.awt.geom.CubicCurve2D getSubCruveFromP1(CurveLocation curveLocation, java.awt.geom.CubicCurve2D curve)
-
getSubCruveToP2
public static java.awt.geom.CubicCurve2D getSubCruveToP2(CurveLocation curveLocation, java.awt.geom.CubicCurve2D curve)
-
newCubicCurve2D
public static java.awt.geom.CubicCurve2D newCubicCurve2D(java.lang.Class<? extends java.awt.geom.CubicCurve2D> curveType)
Creates a new instance of CubicCurve2D while the specific type CubicCurve2D.Float or CubicCurve2D.Double.- Parameters:
curveType-- Returns:
-
createGeneralPath
public static java.awt.geom.GeneralPath createGeneralPath(java.util.List<SmoothedSegment> smoothedSegments)
-
-