Class RegionBSPTree1S
- All Implemented Interfaces:
BSPSubtree<Point1S, RegionBSPTree1S.RegionNode1S>, BSPTree<Point1S, RegionBSPTree1S.RegionNode1S>, HyperplaneBoundedRegion<Point1S>, Splittable<Point1S, HyperplaneBoundedRegion<Point1S>>, Region<Point1S>, Sized
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBSP tree node for one dimensional spherical space.Nested classes/interfaces inherited from class AbstractRegionBSPTree
AbstractRegionBSPTree.AbstractRegionNode<P,N>, AbstractRegionBSPTree.BoundaryProjector<P, N>, AbstractRegionBSPTree.RegionSizeProperties<P> Nested classes/interfaces inherited from class AbstractBSPTree
AbstractBSPTree.AbstractNode<P,N>, AbstractBSPTree.SubtreeInitializer<N> Nested classes/interfaces inherited from interface BSPTree
BSPTree.FindNodeCutRule, BSPTree.Node<P,N> -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new, empty instance.RegionBSPTree1S(boolean full) Create a new region. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AngularInterval interval) Add an interval to this region.Compute the size-related properties of the region.copy()Return a deep copy of this instance.protected RegionBSPTree1S.RegionNode1SCreate a new node for this tree.static RegionBSPTree1Sempty()Return a new, empty BSP tree.static RegionBSPTree1SfromInterval(AngularInterval interval) Return a new BSP tree representing the same region as the given angular interval.static RegionBSPTree1Sfull()Return a new, full BSP tree.Project a point onto the boundary of the region.split(Hyperplane<Point1S> splitter) Split this instance with the given hyperplane.splitDiameter(CutAngle splitter) Split the instance along a circle diameter.The diameter is defined by the given split point and its reversed antipodal point.Convert the region represented by this tree into a list of separateAngularIntervals, arranged in order of ascending min value.voidTransform this tree.Methods inherited from class AbstractRegionBSPTree
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, xorMethods inherited from class AbstractBSPTree
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, trimToNodeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Sized
isFinite, isInfinite
-
Constructor Details
-
RegionBSPTree1S
public RegionBSPTree1S()Create a new, empty instance. -
RegionBSPTree1S
Create a new region. Iffullis true, then the region will represent the entire circle. Otherwise, it will be empty.- Parameters:
full- whether or not the region should contain the entire circle or be empty
-
-
Method Details
-
copy
Return a deep copy of this instance.- Returns:
- a deep copy of this instance.
- See Also:
-
add
Add an interval to this region. The resulting region will be the union of the interval and the region represented by this instance.- Parameters:
interval- the interval to add
-
project
Project a point onto the boundary of the region. Null is returned if the region contains no boundaries (ie, is eitherfullorempty).- Specified by:
projectin interfaceRegion<Point1S>- Overrides:
projectin classAbstractRegionBSPTree<Point1S, RegionBSPTree1S.RegionNode1S>- Parameters:
pt- pt to project- Returns:
- projection of the point on the boundary of the region or null if the region does not contain any boundaries
-
transform
Transform this tree. Each cut in the tree is transformed in place using the givenTransform.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.
- Specified by:
transformin interfaceBSPTree<Point1S, RegionBSPTree1S.RegionNode1S>- Overrides:
transformin classAbstractBSPTree<Point1S, RegionBSPTree1S.RegionNode1S>- Parameters:
transform- the transform to apply
-
split
Split this instance with the given hyperplane.It is important to note that split operations occur according to the rules of the
CutAnglehyperplane 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), wherexis the location of the hyperplane. For example, a positive-facingCutAngleinstance with an azimuth of0.5pihas a minus side consisting of the angles[0, 0.5pi]and a plus side consisting of the angles[0.5pi, 2pi). Similarly, a positive-facingCutAnglewith an azimuth of0pihas 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 at0piis 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.- Parameters:
splitter- the hyperplane to split this object with.- Returns:
- result of the split operation
- See Also:
-
splitDiameter
Split the instance along a circle diameter.The diameter is defined by the given split point and its reversed antipodal point.- Parameters:
splitter- split point defining one side of the split diameter- Returns:
- result of the split operation
-
toIntervals
Convert the region represented by this tree into a list of separateAngularIntervals, arranged in order of ascending min value.- Returns:
- list of
AngularIntervals representing this region in order of ascending min value
-
computeRegionSizeProperties
Compute the size-related properties of the region.- Specified by:
computeRegionSizePropertiesin classAbstractRegionBSPTree<Point1S, RegionBSPTree1S.RegionNode1S>- Returns:
- object containing size properties for the region
-
createNode
Create a new node for this tree.- Specified by:
createNodein classAbstractBSPTree<Point1S, RegionBSPTree1S.RegionNode1S>- Returns:
- a new node for this tree
-
empty
-
full
Return a new, full BSP tree. The returned tree represents the full space.- Returns:
- a new, full BSP tree.
-
fromInterval
Return a new BSP tree representing the same region as the given angular interval.- Parameters:
interval- the input interval- Returns:
- a new BSP tree representing the same region as the given angular interval
-