Class OrientedPoint.OrientedPointConvexSubset

java.lang.Object
org.apache.commons.geometry.euclidean.oned.OrientedPoint.OrientedPointConvexSubset
All Implemented Interfaces:
HyperplaneConvexSubset<Vector1D>, HyperplaneSubset<Vector1D>, Splittable<Vector1D,HyperplaneSubset<Vector1D>>, Sized
Enclosing class:
OrientedPoint

private static class OrientedPoint.OrientedPointConvexSubset extends Object implements HyperplaneConvexSubset<Vector1D>
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 Details

    • hyperplane

      private final OrientedPoint hyperplane
      The underlying hyperplane for this instance.
  • Constructor Details

    • OrientedPointConvexSubset

      OrientedPointConvexSubset(OrientedPoint hyperplane)
      Simple constructor.
      Parameters:
      hyperplane - underlying hyperplane instance
  • Method Details

    • getHyperplane

      public OrientedPoint getHyperplane()
      Get the hyperplane containing this instance.
      Specified by:
      getHyperplane in interface HyperplaneSubset<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 interface HyperplaneSubset<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 interface HyperplaneSubset<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 interface Sized
      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.

      Specified by:
      isFinite in interface Sized
      Returns:
      true if the size of the instance is finite
    • getSize

      public double getSize()
      Get the size of the instance.

      This method always returns 0.

      Specified by:
      getSize in interface Sized
      Returns:
      the size of the instance
    • getCentroid

      public Vector1D 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 interface HyperplaneSubset<Vector1D>
      Returns:
      the centroid of the hyperplane subset or null if no unique centroid exists
      See Also:
    • classify

      public RegionLocation classify(Vector1D 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 and RegionLocation.OUTSIDE otherwise.

      Specified by:
      classify in interface HyperplaneSubset<Vector1D>
      Parameters:
      point - the point to classify
      Returns:
      classification of the point with respect to the hyperplane and subspace region
    • closest

      public Vector1D closest(Vector1D point)
      Return the closest point to the argument that is contained in the subset (ie, not classified as outside), or null if no such point exists.
      Specified by:
      closest in interface HyperplaneSubset<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 interface HyperplaneConvexSubset<Vector1D>
      Specified by:
      split in interface Splittable<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 interface HyperplaneSubset<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 interface HyperplaneConvexSubset<Vector1D>
      Specified by:
      transform in interface HyperplaneSubset<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 interface HyperplaneConvexSubset<Vector1D>
      Returns:
      a hyperplane convex subset representing the same region but with the opposite orientation.
    • toString

      public String toString()
      Overrides:
      toString in class Object