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 ClassesModifier and TypeClassDescriptionprotected static class
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(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
(Iterable<? extends LineConvexSubset> subsets) Add a collection of line subsets to the connector and attempt to connect each new line subset with existing subsets.Connect all current line subsets into connected paths, returning the result as a list of line paths.connectAll
(Iterable<LineConvexSubset> subsets) Add the given line subsets to this instance and connect all current subsets into connected paths.private LinePath
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
-
Constructor Details
-
AbstractLinePathConnector
public AbstractLinePathConnector()
-
-
Method Details
-
add
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:
-
add
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
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
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:
-
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
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
-