com.partnersoft.geometry.xy
Interface XyPath<T extends XyPath>

All Superinterfaces:
Immutable, java.lang.Iterable<XyPoint>, XyShape<T>
All Known Implementing Classes:
XyArc, XyCubicCurve, XyLineSegment, XyPolyline, XyQuadraticCurve

public interface XyPath<T extends XyPath>
extends XyShape<T>

An XyPath is a shape with an ordered sequence of points or curves.

Examples of paths are polylines, curves, arcs, etc.

Copyright 2007 Partner Software, Inc.

Version:
$Id: XyPath.java 1012 2007-11-24 18:30:02Z paul $
Author:
Paul Reavis, Richard Fay, Rich Stepanski

Method Summary
 XyPoint getEndPoint()
          Returns the last point in the shape.
 double getLength()
          Returns the length of the path.
 XyPoint getStartPoint()
          Returns the first point in the shape.
 XyPolyline toPolyline()
          Same as toPolyline(XyAngle) with a default angle granularity of 1/60 circle (6 degrees, pi/30 radians).
 XyPolyline toPolyline(XyAngle granularity)
          Converts this area to a polyline which approximates it in some fashion.
 
Methods inherited from interface com.partnersoft.geometry.xy.XyShape
getBounds, scaledBy, transformedBy, translatedBy
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getLength

double getLength()
Returns the length of the path.

Returns:
geometric length of this shape

toPolyline

XyPolyline toPolyline(XyAngle granularity)
Converts this area to a polyline which approximates it in some fashion. For example, a curve can be converted to a polyline with enough segments to roughly approximate its shape. Paths consisting of linked line segments can be represented exactly.

The angle parameter allows a certain level of control of the output. Essentially it dictates the minimum angular granularity used to approximate curved paths. For example, an arc would be turned into a polyline by placing points around the arc's slice of a circle, separated by the given angle.


toPolyline

XyPolyline toPolyline()
Same as toPolyline(XyAngle) with a default angle granularity of 1/60 circle (6 degrees, pi/30 radians).


getStartPoint

XyPoint getStartPoint()
Returns the first point in the shape.


getEndPoint

XyPoint getEndPoint()
Returns the last point in the shape.