Class CutAngle.CutAngleConvexSubset
- java.lang.Object
-
- org.apache.commons.geometry.spherical.oned.CutAngle.CutAngleConvexSubset
-
- All Implemented Interfaces:
HyperplaneConvexSubset<Point1S>
,HyperplaneSubset<Point1S>
,Splittable<Point1S,HyperplaneSubset<Point1S>>
,Sized
- Enclosing class:
- CutAngle
private static final class CutAngle.CutAngleConvexSubset extends java.lang.Object implements HyperplaneConvexSubset<Point1S>
HyperplaneConvexSubset
implementation for spherical 1D space. Since there are no subspaces in 1D, this is effectively a stub implementation, its main use being to allow for the correct functioning of partitioning code.
-
-
Field Summary
Fields Modifier and Type Field Description private CutAngle
hyperplane
The hyperplane containing for this instance.
-
Constructor Summary
Constructors Constructor Description CutAngleConvexSubset(CutAngle hyperplane)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegionLocation
classify(Point1S point)
Classify a point with respect to the subset region.Point1S
closest(Point1S point)
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.Point1S
getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique.CutAngle
getHyperplane()
Get the hyperplane containing this instance.double
getSize()
Get the size of the instance.boolean
isEmpty()
Return true if this instance does not contain any points.boolean
isFinite()
Return true if the size of the instance is finite.boolean
isFull()
Return true if this instance contains all points in the hyperplane.boolean
isInfinite()
Return true if the size of the instance is infinite.CutAngle.CutAngleConvexSubset
reverse()
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance.Split<CutAngle.CutAngleConvexSubset>
split(Hyperplane<Point1S> splitter)
Split this instance with the given hyperplane.java.util.List<CutAngle.CutAngleConvexSubset>
toConvex()
Convert this instance into a list of convex child subsets representing the same region.java.lang.String
toString()
CutAngle.CutAngleConvexSubset
transform(Transform<Point1S> transform)
Return a new hyperplane subset resulting from the application of the given transform.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.HyperplaneSubset
contains
-
-
-
-
Field Detail
-
hyperplane
private final CutAngle hyperplane
The hyperplane containing for this instance.
-
-
Constructor Detail
-
CutAngleConvexSubset
CutAngleConvexSubset(CutAngle hyperplane)
Simple constructor.- Parameters:
hyperplane
- containing hyperplane instance
-
-
Method Detail
-
getHyperplane
public CutAngle getHyperplane()
Get the hyperplane containing this instance.- Specified by:
getHyperplane
in interfaceHyperplaneSubset<Point1S>
- Returns:
- the hyperplane containing this instance
-
isFull
public boolean isFull()
Return true if this instance contains all points in the hyperplane.This method always returns
false
.- Specified by:
isFull
in interfaceHyperplaneSubset<Point1S>
- Returns:
- true if this instance contains all points in the hyperplane
-
isEmpty
public boolean isEmpty()
Return true if this instance does not contain any points.This method always returns
false
.- Specified by:
isEmpty
in interfaceHyperplaneSubset<Point1S>
- Returns:
- true if this instance does not contain any points
-
isInfinite
public boolean isInfinite()
Return true if the size of the instance is infinite.This method always returns
false
.- Specified by:
isInfinite
in interfaceSized
- Returns:
- true if the size of the instance is infinite
-
isFinite
public boolean isFinite()
Return true if the size of the instance is finite.This method always returns
true
.
-
getSize
public double getSize()
Get the size of the instance.This method always returns
0
.
-
getCentroid
public Point1S getCentroid()
Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique. A centroid will not exist for empty or infinite subsets.The centroid of a geometric object is defined as the mean position of all points in the object, including interior points, vertices, and other points lying on the boundary. If a physical object has a uniform density, then its center of mass is the same as its geometric centroid.
This method returns the point for the underlying hyperplane.
- Specified by:
getCentroid
in interfaceHyperplaneSubset<Point1S>
- Returns:
- the centroid of the hyperplane subset or null if no unique centroid exists
- See Also:
- Centroid
-
classify
public RegionLocation classify(Point1S point)
Classify a point with respect to the subset region. The point is classified as follows:INSIDE
- The point lies on the hyperplane and inside of the subset region.BOUNDARY
- The point lies on the hyperplane and is on the boundary of the subset region.OUTSIDE
- The point does not lie on the hyperplane or it does lie on the hyperplane but is outside of the subset region.
This method returns
RegionLocation.BOUNDARY
if the point is on the hyperplane andRegionLocation.OUTSIDE
otherwise.- Specified by:
classify
in interfaceHyperplaneSubset<Point1S>
- Parameters:
point
- the point to classify- Returns:
- classification of the point with respect to the hyperplane and subspace region
-
closest
public Point1S closest(Point1S point)
Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.- Specified by:
closest
in interfaceHyperplaneSubset<Point1S>
- Parameters:
point
- the reference point- Returns:
- the closest point to the reference point that is contained in the subset, or null if no such point exists
-
split
public Split<CutAngle.CutAngleConvexSubset> split(Hyperplane<Point1S> splitter)
Split this instance with the given hyperplane.The parts resulting from a split operation with a convex subset are guaranteed to also be convex.
- Specified by:
split
in interfaceHyperplaneConvexSubset<Point1S>
- Specified by:
split
in interfaceSplittable<Point1S,HyperplaneSubset<Point1S>>
- Parameters:
splitter
- the hyperplane to split this object with.- Returns:
- result of the split operation
-
toConvex
public java.util.List<CutAngle.CutAngleConvexSubset> toConvex()
Convert this instance into a list of convex child subsets representing the same region. Implementations are not required to return an optimal convex subdivision of the current instance. They are free to return whatever subdivision is readily available.- Specified by:
toConvex
in interfaceHyperplaneSubset<Point1S>
- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
transform
public CutAngle.CutAngleConvexSubset transform(Transform<Point1S> transform)
Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.Hyperplane convex subsets subjected to affine transformations remain convex.
- Specified by:
transform
in interfaceHyperplaneConvexSubset<Point1S>
- Specified by:
transform
in interfaceHyperplaneSubset<Point1S>
- Parameters:
transform
- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
reverse
public CutAngle.CutAngleConvexSubset reverse()
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance. The returned subset contains the same points but has a reversed orientation.- Specified by:
reverse
in interfaceHyperplaneConvexSubset<Point1S>
- Returns:
- a hyperplane convex subset representing the same region but with the opposite orientation.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-