Class AbstractRegionBSPTree.Condenser<P extends Point<P>,N extends AbstractRegionBSPTree.AbstractRegionNode<P,N>>
java.lang.Object
org.apache.commons.geometry.core.partitioning.bsp.AbstractRegionBSPTree.Condenser<P,N>
- Type Parameters:
P
- Point implementation typeN
- BSP tree node implementation type
- Enclosing class:
AbstractRegionBSPTree<P extends Point<P>,
N extends AbstractRegionBSPTree.AbstractRegionNode<P, N>>
private static final class AbstractRegionBSPTree.Condenser<P extends Point<P>,N extends AbstractRegionBSPTree.AbstractRegionNode<P,N>>
extends Object
Internal class used to perform tree condense operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Flag set to true if the tree was modified during the operation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Condense the nodes in the subtree rooted at the given node.private RegionLocation
condenseRecursive
(N node) Recursively condense nodes that have children with homogenous location attributes (eg, both inside, both outside) into single nodes.
-
Field Details
-
modifiedTree
private boolean modifiedTreeFlag set to true if the tree was modified during the operation.
-
-
Constructor Details
-
Condenser
private Condenser()
-
-
Method Details
-
condense
Condense the nodes in the subtree rooted at the given node. Redundant child nodes are removed. The tree is invalidated if the tree structure was modified.- Parameters:
node
- the root node of the subtree to condense- Returns:
- true if the tree was modified.
-
condenseRecursive
Recursively condense nodes that have children with homogenous location attributes (eg, both inside, both outside) into single nodes.- Parameters:
node
- the root of the subtree to condense- Returns:
- the location of the successfully condensed subtree or null if no condensing was able to be performed
-