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 type
N - 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

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Flag set to true if the tree was modified during the operation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) boolean
    condense(N node)
    Condense the nodes in the subtree rooted at the given node.
    Recursively condense nodes that have children with homogenous location attributes (eg, both inside, both outside) into single nodes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • modifiedTree

      private boolean modifiedTree
      Flag set to true if the tree was modified during the operation.
  • Constructor Details

    • Condenser

      private Condenser()
  • Method Details

    • 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