P
- Point implementation typeS
- Hyperplane convex subset implementation typepublic abstract class AbstractConvexHyperplaneBoundedRegion<P extends Point<P>,S extends HyperplaneConvexSubset<P>> extends Object implements HyperplaneBoundedRegion<P>
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P extends Point<P>,S extends HyperplaneConvexSubset<P>>
Internal class encapsulating the logic for building convex region boundaries from collections of hyperplanes.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractConvexHyperplaneBoundedRegion(List<S> boundaries)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
RegionLocation |
classify(P pt)
Classify the given point with respect to the region.
|
List<S> |
getBoundaries()
Get the boundaries of the convex region.
|
double |
getBoundarySize()
Get the size of the boundary of the region.
|
boolean |
isEmpty()
Return true if the region is completely empty, ie all points in
the space are classified as
outside . |
boolean |
isFull()
Return true if the region spans the entire space.
|
P |
project(P pt)
Project a point onto the boundary of the region.
|
protected <R extends AbstractConvexHyperplaneBoundedRegion<P,S>> |
splitInternal(Hyperplane<P> splitter,
R thisInstance,
Class<S> boundaryType,
Function<List<S>,R> factory)
Generic, internal split method.
|
protected boolean |
swapsInsideOutside(Transform<P> transform)
Return true if the given transform swaps the inside and outside of
the region.
|
String |
toString() |
protected <R extends AbstractConvexHyperplaneBoundedRegion<P,S>> |
transformInternal(Transform<P> transform,
R thisInstance,
Class<S> boundaryType,
Function<? super List<S>,R> factory)
Generic, internal transform method.
|
HyperplaneConvexSubset<P> |
trim(HyperplaneConvexSubset<P> sub)
Trim the given hyperplane subset to the portion contained inside this instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, getCentroid
getSize, isFinite, isInfinite
split
protected AbstractConvexHyperplaneBoundedRegion(List<S> boundaries)
boundaries
- the boundaries of the convex regionpublic List<S> getBoundaries()
public boolean isFull()
outside
.public boolean isEmpty()
outside
.
This method always returns false.
public double getBoundarySize()
d-1
dimension space. For example, in Euclidean space,
this will be a length in 2D and an area in 3D.getBoundarySize
in interface Region<P extends Point<P>>
public RegionLocation classify(P pt)
public HyperplaneConvexSubset<P> trim(HyperplaneConvexSubset<P> sub)
sub
- hyperplane subset to trim. Null is returned if the subset does not intersect the instance.protected <R extends AbstractConvexHyperplaneBoundedRegion<P,S>> R transformInternal(Transform<P> transform, R thisInstance, Class<S> boundaryType, Function<? super List<S>,R> factory)
R
- Region implementation typetransform
- the transform to apply to the instancethisInstance
- a reference to the current instance; this is passed as
an argument in order to allow it to be a generic typeboundaryType
- the type used for the boundary hyperplane subsetsfactory
- function used to create new convex region instancesprotected boolean swapsInsideOutside(Transform<P> transform)
The default behavior of this method is to return true if the transform
does not preserve spatial orientation (ie, Transform.preservesOrientation()
is false). Subclasses may need to override this method to implement the correct
behavior for their space and dimension.
transform
- transform to checkprotected <R extends AbstractConvexHyperplaneBoundedRegion<P,S>> Split<R> splitInternal(Hyperplane<P> splitter, R thisInstance, Class<S> boundaryType, Function<List<S>,R> factory)
Splittable.split(Hyperplane)
methods.R
- Region implementation typesplitter
- splitting hyperplanethisInstance
- a reference to the current instance; this is passed as
an argument in order to allow it to be a generic typeboundaryType
- the type used for the boundary hyperplane subsetsfactory
- function used to create new convex region instancesCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.