Class AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P extends Point<P>,S extends HyperplaneConvexSubset<P>>
- java.lang.Object
-
- org.apache.commons.geometry.core.partitioning.AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P,S>
-
- Type Parameters:
P
- Point implementation typeS
- Hyperplane convex subset implementation type
- Enclosing class:
- AbstractConvexHyperplaneBoundedRegion<P extends Point<P>,S extends HyperplaneConvexSubset<P>>
protected static class AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P extends Point<P>,S extends HyperplaneConvexSubset<P>> extends java.lang.Object
Internal class encapsulating the logic for building convex region boundaries from collections of hyperplanes.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<S>
subsetType
Hyperplane convex subset implementation type.
-
Constructor Summary
Constructors Constructor Description ConvexRegionBoundaryBuilder(java.lang.Class<S> subsetType)
Construct a new instance for building convex region boundaries with the given hyperplane convex subset implementation type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<S>
build(java.lang.Iterable<? extends Hyperplane<P>> bounds)
Compute a list of hyperplane convex subsets representing the boundaries of the convex region bounded by the given collection of hyperplanes.private java.lang.IllegalArgumentException
nonConvexException(java.lang.Iterable<? extends Hyperplane<P>> bounds)
Return an exception indicating that the given collection of hyperplanes do not produce a convex region.private HyperplaneConvexSubset<P>
splitBound(Hyperplane<P> currentBound, java.lang.Iterable<? extends Hyperplane<P>> bounds, int currentBoundIdx)
Split the given bounding hyperplane by all of the other hyperplanes in the given collection, returning the remaining hyperplane subset.
-
-
-
Field Detail
-
subsetType
private final java.lang.Class<S extends HyperplaneConvexSubset<P>> subsetType
Hyperplane convex subset implementation type.
-
-
Constructor Detail
-
ConvexRegionBoundaryBuilder
public ConvexRegionBoundaryBuilder(java.lang.Class<S> subsetType)
Construct a new instance for building convex region boundaries with the given hyperplane convex subset implementation type.- Parameters:
subsetType
- Hyperplane convex subset implementation type
-
-
Method Detail
-
build
public java.util.List<S> build(java.lang.Iterable<? extends Hyperplane<P>> bounds)
Compute a list of hyperplane convex subsets representing the boundaries of the convex region bounded by the given collection of hyperplanes.- Parameters:
bounds
- hyperplanes defining the convex region- Returns:
- a list of hyperplane convex subsets representing the boundaries of the convex region
- Throws:
java.lang.IllegalArgumentException
- if the given hyperplanes do not form a convex region
-
splitBound
private HyperplaneConvexSubset<P> splitBound(Hyperplane<P> currentBound, java.lang.Iterable<? extends Hyperplane<P>> bounds, int currentBoundIdx)
Split the given bounding hyperplane by all of the other hyperplanes in the given collection, returning the remaining hyperplane subset.- Parameters:
currentBound
- the bound to split; this value is assumed to have come frombounds
bounds
- collection of bounds to use to splitcurrentBound
currentBoundIdx
- the index ofcurrentBound
inbounds
- Returns:
- the part of
currentBound
's hyperplane subset that lies on the minus side of all of the splitting hyperplanes - Throws:
java.lang.IllegalArgumentException
- if the hyperplanes do not form a convex region
-
nonConvexException
private java.lang.IllegalArgumentException nonConvexException(java.lang.Iterable<? extends Hyperplane<P>> bounds)
Return an exception indicating that the given collection of hyperplanes do not produce a convex region.- Parameters:
bounds
- collection of hyperplanes- Returns:
- an exception indicating that the given collection of hyperplanes do not produce a convex region
-
-