public abstract class InteriorAngleLinePathConnector extends AbstractLinePathConnector
This class provides two concrete implementations: InteriorAngleLinePathConnector.Maximize
and
InteriorAngleLinePathConnector.Minimize
, which choose connections with the largest or smallest interior
angles respectively.
Modifier and Type | Class and Description |
---|---|
static class |
InteriorAngleLinePathConnector.Maximize
Implementation of
InteriorAngleLinePathConnector that chooses line subset
connections that produce the largest interior angles. |
static class |
InteriorAngleLinePathConnector.Minimize
Implementation of
InteriorAngleLinePathConnector that chooses line subset
connections that produce the smallest interior angles. |
AbstractLinePathConnector.ConnectableLineSubset
AbstractPathConnector.ConnectableElement<E extends AbstractPathConnector.ConnectableElement<E>>
Constructor and Description |
---|
InteriorAngleLinePathConnector() |
Modifier and Type | Method and Description |
---|---|
static List<LinePath> |
connectMaximized(Collection<LineConvexSubset> subsets)
Convenience method for connecting a collection of line subsets with interior angles
maximized when possible.
|
static List<LinePath> |
connectMinimized(Collection<LineConvexSubset> subsets)
Convenience method for connecting a collection of line subsets with interior angles minimized
when possible.
|
protected abstract boolean |
isBetterAngle(double newAngle,
double previousAngle)
Return true if
newAngle represents a better interior angle than previousAngle . |
protected AbstractLinePathConnector.ConnectableLineSubset |
selectConnection(AbstractLinePathConnector.ConnectableLineSubset incoming,
List<AbstractLinePathConnector.ConnectableLineSubset> outgoing)
Method called to select a connection to use for a given segment when multiple non-length-zero
connections are available.
|
add, add, connect, connectAll, connectAll
addPathElement, computePathRoots, connectPathElements, selectPointConnection
public InteriorAngleLinePathConnector()
protected AbstractLinePathConnector.ConnectableLineSubset selectConnection(AbstractLinePathConnector.ConnectableLineSubset incoming, List<AbstractLinePathConnector.ConnectableLineSubset> outgoing)
selectConnection
in class AbstractPathConnector<AbstractLinePathConnector.ConnectableLineSubset>
incoming
- the incoming segmentoutgoing
- list of available outgoing connections; will always contain at least
two elementsprotected abstract boolean isBetterAngle(double newAngle, double previousAngle)
newAngle
represents a better interior angle than previousAngle
.newAngle
- the new angle under considerationpreviousAngle
- the previous best anglenewAngle
represents a better interior angle than previousAngle
public static List<LinePath> connectMaximized(Collection<LineConvexSubset> subsets)
new Maximize().connect(subsets)
.subsets
- line subsets to connectInteriorAngleLinePathConnector.Maximize
public static List<LinePath> connectMinimized(Collection<LineConvexSubset> subsets)
new Minimize().connect(subsets)
.subsets
- line subsets to connectInteriorAngleLinePathConnector.Minimize
Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.