| public static final class | LayoutPathImpl.SegmentPathBuilder | Use to build a SegmentPath. This takes the data and preanalyzes it for
information that the SegmentPath needs, then constructs a SegmentPath
from that. Mainly, this lets SegmentPath cache the lengths along
the path to each line segment, and so avoid calculating them over and over. |
| public static final class | LayoutPathImpl.SegmentPath | Represents a path built from segments. Each segment is
represented by a triple: x, y, and cumulative advance.
These represent the end point of the segment. The start
point of the first segment is represented by the triple
at position 0.
The path might have breaks in it, e.g. it is not connected.
These will be represented by pairs of triplets that share the
same advance.
The path might be extended, pinned, or closed. If extended,
the initial and final segments are considered to extend
'indefinitely' past the bounds of the advance. If pinned,
they end at the bounds of the advance. If closed,
advances before the start or after the end 'wrap around' the
path.
The start of the path is the initial triple. This provides
the nominal advance at the given x, y position (typically
zero). The end of the path is the final triple. This provides
the advance at the end, the total length of the path is
thus the ending advance minus the starting advance.
Note: We might want to cache more auxiliary data than the
advance, but this seems adequate for now. |