public class RegionBSPTree1S extends AbstractRegionBSPTree<Point1S,RegionBSPTree1S.RegionNode1S>
Modifier and Type | Class and Description |
---|---|
static class |
RegionBSPTree1S.RegionNode1S
BSP tree node for one dimensional spherical space.
|
AbstractRegionBSPTree.AbstractRegionNode<P extends Point<P>,N extends AbstractRegionBSPTree.AbstractRegionNode<P,N>>, AbstractRegionBSPTree.BoundaryProjector<P extends Point<P>,N extends AbstractRegionBSPTree.AbstractRegionNode<P,N>>, AbstractRegionBSPTree.RegionSizeProperties<P extends Point<P>>
AbstractBSPTree.AbstractNode<P extends Point<P>,N extends AbstractBSPTree.AbstractNode<P,N>>, AbstractBSPTree.SubtreeInitializer<N extends AbstractBSPTree.AbstractNode<?,?>>
BSPTree.FindNodeCutRule, BSPTree.Node<P extends Point<P>,N extends BSPTree.Node<P,N>>
Constructor and Description |
---|
RegionBSPTree1S()
Create a new, empty instance.
|
RegionBSPTree1S(boolean full)
Create a new region.
|
Modifier and Type | Method and Description |
---|---|
void |
add(AngularInterval interval)
Add an interval to this region.
|
protected AbstractRegionBSPTree.RegionSizeProperties<Point1S> |
computeRegionSizeProperties() |
RegionBSPTree1S |
copy()
Return a deep copy of this instance.
|
protected RegionBSPTree1S.RegionNode1S |
createNode() |
static RegionBSPTree1S |
empty()
Return a new, empty BSP tree.
|
static RegionBSPTree1S |
fromInterval(AngularInterval interval)
Return a new BSP tree representing the same region as the given angular interval.
|
static RegionBSPTree1S |
full()
Return a new, full BSP tree.
|
Point1S |
project(Point1S pt) |
Split<RegionBSPTree1S> |
split(Hyperplane<Point1S> splitter) |
Split<RegionBSPTree1S> |
splitDiameter(CutAngle splitter)
Split the instance along a circle diameter.The diameter is defined by the given
split point and its reversed antipodal point.
|
List<AngularInterval> |
toIntervals()
Convert the region represented by this tree into a list of separate
AngularInterval s, arranged in order of ascending min value. |
void |
transform(Transform<Point1S> transform) |
boundaries, classify, complement, complement, condense, copyNodeProperties, createBoundaryIterable, createBoundaryList, difference, difference, getBoundaries, getBoundarySize, getCentroid, getRegionSizeProperties, getSize, getSubtreeInitializer, insert, insert, insert, insert, insert, insert, insert, insert, intersection, intersection, invalidate, isEmpty, isFull, setEmpty, setFull, split, union, union, xor, xor
accept, accept, copy, copyNode, copySubtree, count, cutNode, extract, extractParentPath, findNode, findNode, getRoot, getVersion, height, importSubtree, insert, nodes, removeNodeCut, setNodeCut, setRoot, splitIntoTrees, splitSubtree, swapsInsideOutside, toString, treeString, treeString, trimToNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFinite, isInfinite
public RegionBSPTree1S()
public RegionBSPTree1S(boolean full)
full
is true, then the region will
represent the entire circle. Otherwise, it will be empty.full
- whether or not the region should contain the entire
circle or be emptypublic RegionBSPTree1S copy()
AbstractBSPTree.copy(org.apache.commons.geometry.core.partitioning.bsp.BSPTree)
public void add(AngularInterval interval)
interval
- the interval to addpublic Point1S project(Point1S pt)
project
in interface Region<Point1S>
project
in class AbstractRegionBSPTree<Point1S,RegionBSPTree1S.RegionNode1S>
public void transform(Transform<Point1S> transform)
Each interval of the region is transformed individually and the results are unioned. If the size of any transformed interval is greater than or equal to 2pi, then the region is set to the full space.
transform
in interface BSPTree<Point1S,RegionBSPTree1S.RegionNode1S>
transform
in class AbstractBSPTree<Point1S,RegionBSPTree1S.RegionNode1S>
public Split<RegionBSPTree1S> split(Hyperplane<Point1S> splitter)
It is important to note that split operations occur according to the rules of the
CutAngle
hyperplane class. In this class, the continuous circle is viewed
as a non-circular segment of the number line in the range [0, 2pi)
. Hyperplanes
are placed along this line and partition it into the segments [0, x]
and [x, 2pi)
, where x
is the location of the hyperplane. For example,
a positive-facing CutAngle
instance with an azimuth of 0.5pi
has
a minus side consisting of the angles [0, 0.5pi]
and a plus side consisting of
the angles [0.5pi, 2pi)
. Similarly, a positive-facing CutAngle
with
an azimuth of 0pi
has a plus side of [0, 2pi)
(the full space) and
a minus side that is completely empty (since no points exist in our domain that are
less than zero). These rules can result in somewhat non-intuitive behavior at times.
For example, splitting a non-empty region with a hyperplane at 0pi
is
essentially a no-op, since the region will either lie entirely on the plus or minus
side of the hyperplane (depending on the hyperplane's orientation) regardless of the actual
content of the region. In these situations, a copy of the tree is returned on the
appropriate side of the split.
CutAngle
,
splitDiameter(CutAngle)
public Split<RegionBSPTree1S> splitDiameter(CutAngle splitter)
splitter
- split point defining one side of the split diameterpublic List<AngularInterval> toIntervals()
AngularInterval
s, arranged in order of ascending min value.AngularInterval
s representing this region in order of
ascending min valueprotected AbstractRegionBSPTree.RegionSizeProperties<Point1S> computeRegionSizeProperties()
computeRegionSizeProperties
in class AbstractRegionBSPTree<Point1S,RegionBSPTree1S.RegionNode1S>
protected RegionBSPTree1S.RegionNode1S createNode()
createNode
in class AbstractBSPTree<Point1S,RegionBSPTree1S.RegionNode1S>
public static RegionBSPTree1S empty()
public static RegionBSPTree1S full()
public static RegionBSPTree1S fromInterval(AngularInterval interval)
interval
- the input intervalCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.