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
Class representing an arbitrary subset of the points on a great circle using a
RegionBSPTree1S
. This class can represent convex, non-convex, and empty regions.
This class is mutable and not thread safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RegionBSPTree1S
The 1D region on the great circle. -
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedTreeGreatCircleSubset
(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
Modifier and TypeMethodDescriptionvoid
add
(EmbeddedTreeGreatCircleSubset subcircle) Add the region represented by the given subcircle to this instance.void
Add an arc to this instance.Get the embedded subspace region.split
(Hyperplane<Point2S> 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 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 Details
-
region
The 1D region on the great circle.
-
-
Constructor Details
-
EmbeddedTreeGreatCircleSubset
Construct a new, empty hyperplane subset for the given great circle.- Parameters:
greatCircle
- great circle defining this instance
-
EmbeddedTreeGreatCircleSubset
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
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 Details
-
getSubspaceRegion
Get the embedded subspace region.- Specified by:
getSubspaceRegion
in interfaceRegionEmbedding<Point2S,
Point1S> - Specified by:
getSubspaceRegion
in classGreatCircleSubset
- Returns:
- the embedded subspace region
-
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
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
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
Add an arc to this instance.- Parameters:
arc
- arc to add- Throws:
IllegalArgumentException
- if the given arc is not from a great circle equivalent to this instance
-
add
Add the region represented by the given subcircle to this instance. The argument is not modified.- Parameters:
subcircle
- subcircle to add- Throws:
IllegalArgumentException
- if the given subcircle is not from a great circle equivalent to this instance
-
toString
-