Class OrientedPoint.OrientedPointConvexSubset
- All Implemented Interfaces:
HyperplaneConvexSubset<Vector1D>
,HyperplaneSubset<Vector1D>
,Splittable<Vector1D,
,HyperplaneSubset<Vector1D>> Sized
- Enclosing class:
OrientedPoint
HyperplaneConvexSubset
implementation for Euclidean 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
FieldsModifier and TypeFieldDescriptionprivate final OrientedPoint
The underlying hyperplane for this instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClassify a point with respect to the subset region.Return the closest point to the argument that is contained in the subset (ie, not classified asoutside
), or null if no such point exists.Get the centroid, or geometric center, of the hyperplane subset or null if no centroid exists or one exists but is not unique.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
Return true if the size of the instance is infinite.reverse()
Reverse the orientation of the hyperplane for this instance, returning the result as a new instance.split
(Hyperplane<Vector1D> splitter) Split this instance with the given hyperplane.toConvex()
Convert this instance into a list of convex child subsets representing the same region.toString()
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 Details
-
hyperplane
The underlying hyperplane for this instance.
-
-
Constructor Details
-
OrientedPointConvexSubset
OrientedPointConvexSubset(OrientedPoint hyperplane) Simple constructor.- Parameters:
hyperplane
- underlying hyperplane instance
-
-
Method Details
-
getHyperplane
Get the hyperplane containing this instance.- Specified by:
getHyperplane
in interfaceHyperplaneSubset<Vector1D>
- 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<Vector1D>
- 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<Vector1D>
- 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
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 defining hyperplane.
- Specified by:
getCentroid
in interfaceHyperplaneSubset<Vector1D>
- Returns:
- the centroid of the hyperplane subset or null if no unique centroid exists
- See Also:
-
classify
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<Vector1D>
- Parameters:
point
- the point to classify- Returns:
- classification of the point with respect to the hyperplane and subspace region
-
closest
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<Vector1D>
- 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
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<Vector1D>
- Specified by:
split
in interfaceSplittable<Vector1D,
HyperplaneSubset<Vector1D>> - Parameters:
splitter
- the hyperplane to split this object with.- Returns:
- result of the split operation
-
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<Vector1D>
- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
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<Vector1D>
- Specified by:
transform
in interfaceHyperplaneSubset<Vector1D>
- Parameters:
transform
- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
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<Vector1D>
- Returns:
- a hyperplane convex subset representing the same region but with the opposite orientation.
-
toString
-