Class EmbeddedTreeGreatCircleSubset
- java.lang.Object
-
- org.apache.commons.geometry.spherical.twod.GreatCircleSubset
-
- org.apache.commons.geometry.spherical.twod.EmbeddedTreeGreatCircleSubset
-
- All Implemented Interfaces:
Embedding<Point2S,Point1S>
,HyperplaneSubset<Point2S>
,Splittable<Point2S,HyperplaneSubset<Point2S>>
,RegionEmbedding<Point2S,Point1S>
,Sized
public final class EmbeddedTreeGreatCircleSubset extends GreatCircleSubset
Class representing an arbitrary subset of the points on a great circle using aRegionBSPTree1S
. This class can represent convex, non-convex, and empty regions.This class is mutable and not thread safe.
-
-
Field Summary
Fields Modifier and Type Field Description private RegionBSPTree1S
region
The 1D region on the great circle.
-
Constructor Summary
Constructors Constructor Description EmbeddedTreeGreatCircleSubset(GreatCircle greatCircle)
Construct a new, empty hyperplane subset for the given great circle.EmbeddedTreeGreatCircleSubset(GreatCircle circle, boolean full)
Construct a new sub-region for the given great circle.EmbeddedTreeGreatCircleSubset(GreatCircle circle, RegionBSPTree1S region)
Construct a new instance from its defining great circle and subspace region.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(EmbeddedTreeGreatCircleSubset subcircle)
Add the region represented by the given subcircle to this instance.void
add(GreatArc arc)
Add an arc to this instance.RegionBSPTree1S
getSubspaceRegion()
Get the embedded subspace region.Split<EmbeddedTreeGreatCircleSubset>
split(Hyperplane<Point2S> splitter)
Split this instance with the given hyperplane.java.util.List<GreatArc>
toConvex()
Convert this instance into a list of convex child subsets representing the same region.java.lang.String
toString()
EmbeddedTreeGreatCircleSubset
transform(Transform<Point2S> transform)
Return a new hyperplane subset resulting from the application of the given transform.-
Methods inherited from class org.apache.commons.geometry.spherical.twod.GreatCircleSubset
classify, closest, getCentroid, getCircle, getHyperplane, getPrecision, getSize, isEmpty, isFull, toSpace, toSubspace
-
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.Embedding
toSpace, toSubspace
-
Methods inherited from interface org.apache.commons.geometry.core.partitioning.HyperplaneSubset
contains
-
Methods inherited from interface org.apache.commons.geometry.core.Sized
isFinite, isInfinite
-
-
-
-
Field Detail
-
region
private final RegionBSPTree1S region
The 1D region on the great circle.
-
-
Constructor Detail
-
EmbeddedTreeGreatCircleSubset
public EmbeddedTreeGreatCircleSubset(GreatCircle greatCircle)
Construct a new, empty hyperplane subset for the given great circle.- Parameters:
greatCircle
- great circle defining this instance
-
EmbeddedTreeGreatCircleSubset
public EmbeddedTreeGreatCircleSubset(GreatCircle circle, boolean full)
Construct a new sub-region for the given great circle. Iffull
is true, then the region will cover the entire circle; otherwise, it will be empty.- Parameters:
circle
- great circle that the sub-region will belong tofull
- if true, the sub-region will cover the entire circle; otherwise it will be empty
-
EmbeddedTreeGreatCircleSubset
public EmbeddedTreeGreatCircleSubset(GreatCircle circle, RegionBSPTree1S region)
Construct a new instance from its defining great circle and subspace region.- Parameters:
circle
- great circle that the sub-region will belong toregion
- subspace region
-
-
Method Detail
-
getSubspaceRegion
public RegionBSPTree1S getSubspaceRegion()
Get the embedded subspace region.- Specified by:
getSubspaceRegion
in interfaceRegionEmbedding<Point2S,Point1S>
- Specified by:
getSubspaceRegion
in classGreatCircleSubset
- Returns:
- the embedded subspace region
-
transform
public EmbeddedTreeGreatCircleSubset transform(Transform<Point2S> transform)
Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.- Parameters:
transform
- the transform instance to apply- Returns:
- new transformed hyperplane subset
-
toConvex
public java.util.List<GreatArc> 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<Point2S>
- Specified by:
toConvex
in classGreatCircleSubset
- Returns:
- a list of hyperplane convex subsets representing the same subspace region as this instance
-
split
public Split<EmbeddedTreeGreatCircleSubset> split(Hyperplane<Point2S> splitter)
Split this instance with the given hyperplane.In all cases, the current instance is not modified. However, In order to avoid unnecessary copying, this method will use the current instance as the split value when the instance lies entirely on the plus or minus side of the splitter. For example, if this instance lies entirely on the minus side of the splitter, the sub great circle returned by
Split.getMinus()
will be this instance. Similarly,Split.getPlus()
will return the current instance if it lies entirely on the plus side. Callers need to make special note of this, since this class is mutable.- Parameters:
splitter
- the hyperplane to split this object with.- Returns:
- result of the split operation
-
add
public void add(GreatArc arc)
Add an arc to this instance.- Parameters:
arc
- arc to add- Throws:
java.lang.IllegalArgumentException
- if the given arc is not from a great circle equivalent to this instance
-
add
public void add(EmbeddedTreeGreatCircleSubset subcircle)
Add the region represented by the given subcircle to this instance. The argument is not modified.- Parameters:
subcircle
- subcircle to add- Throws:
java.lang.IllegalArgumentException
- if the given subcircle is not from a great circle equivalent to this instance
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-