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 Object
Internal class encapsulating the logic for building convex region boundaries from collections of hyperplanes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionHyperplane convex subset implementation type. -
Constructor Summary
ConstructorsConstructorDescriptionConvexRegionBoundaryBuilder
(Class<S> subsetType) Construct a new instance for building convex region boundaries with the given hyperplane convex subset implementation type. -
Method Summary
Modifier and TypeMethodDescriptionbuild
(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 IllegalArgumentException
nonConvexException
(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, 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 Details
-
subsetType
Hyperplane convex subset implementation type.
-
-
Constructor Details
-
ConvexRegionBoundaryBuilder
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 Details
-
build
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:
IllegalArgumentException
- if the given hyperplanes do not form a convex region
-
splitBound
private HyperplaneConvexSubset<P> splitBound(Hyperplane<P> currentBound, 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:
IllegalArgumentException
- if the hyperplanes do not form a convex region
-
nonConvexException
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
-