de.cau.cs.kieler.klay.layered.p5edges
Interface ISplineGenerator

All Known Implementing Classes:
SimpleSplineGenerator

public interface ISplineGenerator

Rating red

Nested Class Summary
static class ISplineGenerator.curvature
          defines wheter curvature should be incresed or decreased.
 
Method Summary
 BezierSpline generateShortSpline(KVector q, KVector s)
          Generates a spline representation for straight edges.
 BezierSpline generateSpline(LinkedList<KVector> pArray)
          generates a simple piecewise bezier curve for given points.
 BezierSpline generateSpline(LinkedList<KVector> pArray, KVector vectorQ, KVector vectorS)
          generates a simple piecewise bezier curve for given points.
 boolean refineSpline(LinkedList<KVector> pArray, BezierSpline ospline, ISplineGenerator.curvature mode)
          perturb the control points of the spline in an attempt to make the spline fit.
 boolean straightenSpline(BezierSpline spline)
          straighten_spline adjusts the control points of the spline to reduce the curvature.
 

Method Detail

generateSpline

BezierSpline generateSpline(LinkedList<KVector> pArray,
                            KVector vectorQ,
                            KVector vectorS)
generates a simple piecewise bezier curve for given points.

Parameters:
pArray - array with points which should be lay on the spline
vectorQ - outgoing tangent vector of the initial node
vectorS - incoming tangent vector of the final node
Returns:
created spline

generateSpline

BezierSpline generateSpline(LinkedList<KVector> pArray)
generates a simple piecewise bezier curve for given points.

Parameters:
pArray - array with points which should be lay on the spline
Returns:
created spline

generateShortSpline

BezierSpline generateShortSpline(KVector q,
                                 KVector s)
Generates a spline representation for straight edges.

Parameters:
q - start point
s - end point
Returns:
BezierSpline representation.

straightenSpline

boolean straightenSpline(BezierSpline spline)
straighten_spline adjusts the control points of the spline to reduce the curvature. the method is only used if there's only one bezier segment in the spline

Parameters:
spline - spline to be straightened
Returns:
true if successful otherwise false

refineSpline

boolean refineSpline(LinkedList<KVector> pArray,
                     BezierSpline ospline,
                     ISplineGenerator.curvature mode)
perturb the control points of the spline in an attempt to make the spline fit. The approach is similar to the straightening approach. We try to decrease the curvature of the spline. If this does not seem to improve the fit, we try to increase the curvature. Since this process may never terminate, max_iterations controls how many times to try.

Parameters:
pArray - array with points which should be lay on the spline
ospline - spline to be refined
mode - either decrease or increase the curvature
Returns:
created spline