Class AbstractLinePathConnector
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.internal.AbstractPathConnector<AbstractLinePathConnector.ConnectableLineSubset>
-
- org.apache.commons.geometry.euclidean.twod.path.AbstractLinePathConnector
-
- Direct Known Subclasses:
InteriorAngleLinePathConnector
public abstract class AbstractLinePathConnector extends AbstractPathConnector<AbstractLinePathConnector.ConnectableLineSubset>
Abstract class for joining collections of line subsets into connected paths. This class is not thread-safe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractLinePathConnector.ConnectableLineSubset
Internal class used to connect line subsets together.-
Nested classes/interfaces inherited from class org.apache.commons.geometry.euclidean.internal.AbstractPathConnector
AbstractPathConnector.ConnectableElement<E extends AbstractPathConnector.ConnectableElement<E>>
-
-
Constructor Summary
Constructors Constructor Description AbstractLinePathConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.Iterable<? extends LineConvexSubset> subsets)
Add a collection of line subsets to the connector, leaving them unconnected until a later call toconnect(Iterable)
orconnectAll()
.void
add(LineConvexSubset subset)
Add a line subset to the connector, leaving it unconnected until a later call to toconnect(Iterable)
orconnectAll()
.void
connect(java.lang.Iterable<? extends LineConvexSubset> subsets)
Add a collection of line subsets to the connector and attempt to connect each new line subset with existing subsets.java.util.List<LinePath>
connectAll()
Connect all current line subsets into connected paths, returning the result as a list of line paths.java.util.List<LinePath>
connectAll(java.lang.Iterable<LineConvexSubset> subsets)
Add the given line subsets to this instance and connect all current subsets into connected paths.private LinePath
toPath(AbstractLinePathConnector.ConnectableLineSubset root)
Convert the linked list of path elements starting at the argument into aLinePath
.-
Methods inherited from class org.apache.commons.geometry.euclidean.internal.AbstractPathConnector
addPathElement, computePathRoots, connectPathElements, selectConnection, selectPointConnection
-
-
-
-
Method Detail
-
add
public void add(LineConvexSubset subset)
Add a line subset to the connector, leaving it unconnected until a later call to toconnect(Iterable)
orconnectAll()
.- Parameters:
subset
- line subset to add- See Also:
connect(Iterable)
,connectAll()
-
add
public void add(java.lang.Iterable<? extends LineConvexSubset> subsets)
Add a collection of line subsets to the connector, leaving them unconnected until a later call toconnect(Iterable)
orconnectAll()
.- Parameters:
subsets
- line subsets to add- See Also:
connect(Iterable)
,connectAll()
,add(LineConvexSubset)
-
connect
public void connect(java.lang.Iterable<? extends LineConvexSubset> subsets)
Add a collection of line subsets to the connector and attempt to connect each new line subset with existing subsets. Connections made at this time will not be overwritten by subsequent calls to this or other connection methods. (eg,connectAll()
).The connector is not reset by this call. Additional line subsets can still be added to the current set of paths.
- Parameters:
subsets
- line subsets to connect- See Also:
connectAll()
-
connectAll
public java.util.List<LinePath> connectAll(java.lang.Iterable<LineConvexSubset> subsets)
Add the given line subsets to this instance and connect all current subsets into connected paths. This call is equivalent toconnector.add(subsets); List<LinePath> result = connector.connectAll();
The connector is reset after this call. Further calls to add or connect line subsets will result in new paths being generated.
- Parameters:
subsets
- line subsets to add- Returns:
- the connected 2D paths
- See Also:
add(Iterable)
,connectAll()
-
connectAll
public java.util.List<LinePath> connectAll()
Connect all current line subsets into connected paths, returning the result as a list of line paths.The connector is reset after this call. Further calls to add or connect line subsets will result in new paths being generated.
- Returns:
- the connected 2D paths
-
toPath
private LinePath toPath(AbstractLinePathConnector.ConnectableLineSubset root)
Convert the linked list of path elements starting at the argument into aLinePath
.- Parameters:
root
- root of a connected path linked list- Returns:
- a line path representing the linked list path
-
-