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 java.lang.Object
Internal class used to perform tree condense operations.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
modifiedTree
Flag set to true if the tree was modified during the operation.
-
Constructor Summary
Constructors Modifier Constructor Description private
Condenser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
condense(N node)
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.
-
-
-
Method Detail
-
condense
boolean condense(N node)
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
private RegionLocation condenseRecursive(N node)
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
-
-