public final class RegionBSPTree1D extends AbstractRegionBSPTree<Vector1D,RegionBSPTree1D.RegionNode1D>
Modifier and Type | Class and Description |
---|---|
static class |
RegionBSPTree1D.RegionNode1D
BSP tree node for one dimensional Euclidean 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 |
---|
RegionBSPTree1D()
Create a new, empty region.
|
RegionBSPTree1D(boolean full)
Create a new region.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Interval interval)
Add an interval to this region.
|
RegionLocation |
classify(double x)
Classify a point location with respect to the region.
|
protected AbstractRegionBSPTree.RegionSizeProperties<Vector1D> |
computeRegionSizeProperties() |
boolean |
contains(double x)
Return true if the given point location is on the inside or boundary
of the region.
|
RegionBSPTree1D |
copy()
Return a deep copy of this instance.
|
protected RegionBSPTree1D.RegionNode1D |
createNode() |
static RegionBSPTree1D |
empty()
Return a new, empty
RegionBSPTree1D instance. |
static RegionBSPTree1D |
from(Interval interval,
Interval... more)
Construct a new instance from one or more intervals.
|
static RegionBSPTree1D |
from(Iterable<Interval> intervals)
Construct a new instance from the given collection of intervals.
|
static RegionBSPTree1D |
full()
Return a new
RegionBSPTree1D instance containing the entire space. |
double |
getBoundarySize() |
double |
getMax()
Get the maximum value on the inside of the region; returns
Double.POSITIVE_INFINITY
if the region does not have a maximum value and Double.NEGATIVE_INFINITY if
the region is empty. |
double |
getMin()
Get the minimum value on the inside of the region; returns
Double.NEGATIVE_INFINITY
if the region does not have a minimum value and Double.POSITIVE_INFINITY if
the region is empty. |
Vector1D |
project(Vector1D pt) |
Split<RegionBSPTree1D> |
split(Hyperplane<Vector1D> splitter) |
protected boolean |
swapsInsideOutside(Transform<Vector1D> transform)
Returns true if the given transform would result in a swapping of the interior
and exterior of the region if applied.
|
List<Interval> |
toIntervals()
Convert the region represented by this tree into a list of separate
Interval s, arranged in order of ascending min value. |
boundaries, classify, complement, complement, condense, copyNodeProperties, createBoundaryIterable, createBoundaryList, difference, difference, getBoundaries, 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, toString, transform, treeString, treeString, trimToNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFinite, isInfinite
public RegionBSPTree1D()
public RegionBSPTree1D(boolean full)
full
is true, then the region will
represent the entire number line. Otherwise, it will be empty.full
- whether or not the region should contain the entire
number line or be emptypublic RegionBSPTree1D copy()
AbstractBSPTree.copy(org.apache.commons.geometry.core.partitioning.bsp.BSPTree)
public void add(Interval interval)
interval
- the interval to addpublic RegionLocation classify(double x)
x
- the point to classifyAbstractRegionBSPTree.classify(org.apache.commons.geometry.core.Point)
public boolean contains(double x)
x
- the location to testRegion.contains(org.apache.commons.geometry.core.Point)
public double getBoundarySize()
This method simply returns 0 because boundaries in one dimension do not have any size.
getBoundarySize
in interface Region<Vector1D>
getBoundarySize
in class AbstractRegionBSPTree<Vector1D,RegionBSPTree1D.RegionNode1D>
public Vector1D project(Vector1D pt)
project
in interface Region<Vector1D>
project
in class AbstractRegionBSPTree<Vector1D,RegionBSPTree1D.RegionNode1D>
public Split<RegionBSPTree1D> split(Hyperplane<Vector1D> splitter)
When splitting trees representing single points with a splitter lying directly on the point, the result point is placed on one side of the splitter based on its orientation: if the splitter is positive-facing, the point is placed on the plus side of the split; if the splitter is negative-facing, the point is placed on the minus side of the split.
public double getMin()
Double.NEGATIVE_INFINITY
if the region does not have a minimum value and Double.POSITIVE_INFINITY
if
the region is empty.public double getMax()
Double.POSITIVE_INFINITY
if the region does not have a maximum value and Double.NEGATIVE_INFINITY
if
the region is empty.public List<Interval> toIntervals()
Interval
s, arranged in order of ascending min value.Interval
s representing this region in order of
ascending min valueprotected RegionBSPTree1D.RegionNode1D createNode()
createNode
in class AbstractBSPTree<Vector1D,RegionBSPTree1D.RegionNode1D>
protected AbstractRegionBSPTree.RegionSizeProperties<Vector1D> computeRegionSizeProperties()
computeRegionSizeProperties
in class AbstractRegionBSPTree<Vector1D,RegionBSPTree1D.RegionNode1D>
protected boolean swapsInsideOutside(Transform<Vector1D> transform)
This method always returns false since no swapping of this kind occurs in 1D.
swapsInsideOutside
in class AbstractBSPTree<Vector1D,RegionBSPTree1D.RegionNode1D>
public static RegionBSPTree1D full()
RegionBSPTree1D
instance containing the entire space.RegionBSPTree1D
instance containing the entire spacepublic static RegionBSPTree1D empty()
RegionBSPTree1D
instance.RegionBSPTree1D
instancepublic static RegionBSPTree1D from(Interval interval, Interval... more)
interval
- the input intervalmore
- additional intervals to add to the regionpublic static RegionBSPTree1D from(Iterable<Interval> intervals)
intervals
- the intervals to populate the region withCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.